/* This file was generated by upbc (the upb compiler) from the input * file: * * envoy/config/overload/v3/overload.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ #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/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; typedef struct envoy_config_overload_v3_Trigger envoy_config_overload_v3_Trigger; typedef struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig envoy_config_overload_v3_ScaleTimersOverloadActionConfig; typedef struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer; typedef struct envoy_config_overload_v3_OverloadAction envoy_config_overload_v3_OverloadAction; typedef struct envoy_config_overload_v3_BufferFactoryConfig envoy_config_overload_v3_BufferFactoryConfig; typedef struct envoy_config_overload_v3_OverloadManager envoy_config_overload_v3_OverloadManager; extern const upb_msglayout envoy_config_overload_v3_ResourceMonitor_msginit; extern const upb_msglayout envoy_config_overload_v3_ThresholdTrigger_msginit; extern const upb_msglayout envoy_config_overload_v3_ScaledTrigger_msginit; extern const upb_msglayout envoy_config_overload_v3_Trigger_msginit; extern const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit; extern const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit; extern const upb_msglayout envoy_config_overload_v3_OverloadAction_msginit; extern const upb_msglayout envoy_config_overload_v3_BufferFactoryConfig_msginit; extern const upb_msglayout envoy_config_overload_v3_OverloadManager_msginit; struct envoy_type_v3_Percent; struct google_protobuf_Any; struct google_protobuf_Duration; extern const upb_msglayout envoy_type_v3_Percent_msginit; extern const upb_msglayout google_protobuf_Any_msginit; extern const upb_msglayout google_protobuf_Duration_msginit; typedef enum { envoy_config_overload_v3_ScaleTimersOverloadActionConfig_UNSPECIFIED = 0, envoy_config_overload_v3_ScaleTimersOverloadActionConfig_HTTP_DOWNSTREAM_CONNECTION_IDLE = 1, envoy_config_overload_v3_ScaleTimersOverloadActionConfig_HTTP_DOWNSTREAM_STREAM_IDLE = 2, envoy_config_overload_v3_ScaleTimersOverloadActionConfig_TRANSPORT_SOCKET_CONNECT = 3 } envoy_config_overload_v3_ScaleTimersOverloadActionConfig_TimerType; /* envoy.config.overload.v3.ResourceMonitor */ UPB_INLINE envoy_config_overload_v3_ResourceMonitor *envoy_config_overload_v3_ResourceMonitor_new(upb_arena *arena) { return (envoy_config_overload_v3_ResourceMonitor *)_upb_msg_new(&envoy_config_overload_v3_ResourceMonitor_msginit, arena); } UPB_INLINE envoy_config_overload_v3_ResourceMonitor *envoy_config_overload_v3_ResourceMonitor_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, arena)) return NULL; return ret; } UPB_INLINE envoy_config_overload_v3_ResourceMonitor *envoy_config_overload_v3_ResourceMonitor_parse_ex(const char *buf, size_t size, const upb_extreg *extreg, int options, upb_arena *arena) { envoy_config_overload_v3_ResourceMonitor *ret = envoy_config_overload_v3_ResourceMonitor_new(arena); if (!ret) return NULL; if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, extreg, options, arena)) { return NULL; } return ret; } UPB_INLINE char *envoy_config_overload_v3_ResourceMonitor_serialize(const envoy_config_overload_v3_ResourceMonitor *msg, upb_arena *arena, size_t *len) { return upb_encode(msg, &envoy_config_overload_v3_ResourceMonitor_msginit, arena, len); } typedef enum { envoy_config_overload_v3_ResourceMonitor_config_type_typed_config = 3, envoy_config_overload_v3_ResourceMonitor_config_type_NOT_SET = 0 } envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases; UPB_INLINE envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases envoy_config_overload_v3_ResourceMonitor_config_type_case(const envoy_config_overload_v3_ResourceMonitor* msg) { return (envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); } UPB_INLINE upb_strview envoy_config_overload_v3_ResourceMonitor_name(const envoy_config_overload_v3_ResourceMonitor *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); } UPB_INLINE bool envoy_config_overload_v3_ResourceMonitor_has_typed_config(const envoy_config_overload_v3_ResourceMonitor *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; } UPB_INLINE const struct google_protobuf_Any* envoy_config_overload_v3_ResourceMonitor_typed_config(const envoy_config_overload_v3_ResourceMonitor *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); } UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_set_name(envoy_config_overload_v3_ResourceMonitor *msg, upb_strview value) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value; } UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_set_typed_config(envoy_config_overload_v3_ResourceMonitor *msg, struct google_protobuf_Any* value) { UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3); } UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_ResourceMonitor_mutable_typed_config(envoy_config_overload_v3_ResourceMonitor *msg, upb_arena *arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_overload_v3_ResourceMonitor_typed_config(msg); if (sub == NULL) { sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena); if (!sub) return NULL; envoy_config_overload_v3_ResourceMonitor_set_typed_config(msg, sub); } return sub; } /* envoy.config.overload.v3.ThresholdTrigger */ UPB_INLINE envoy_config_overload_v3_ThresholdTrigger *envoy_config_overload_v3_ThresholdTrigger_new(upb_arena *arena) { return (envoy_config_overload_v3_ThresholdTrigger *)_upb_msg_new(&envoy_config_overload_v3_ThresholdTrigger_msginit, arena); } UPB_INLINE envoy_config_overload_v3_ThresholdTrigger *envoy_config_overload_v3_ThresholdTrigger_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, arena)) return NULL; return ret; } UPB_INLINE envoy_config_overload_v3_ThresholdTrigger *envoy_config_overload_v3_ThresholdTrigger_parse_ex(const char *buf, size_t size, const upb_extreg *extreg, int options, upb_arena *arena) { envoy_config_overload_v3_ThresholdTrigger *ret = envoy_config_overload_v3_ThresholdTrigger_new(arena); if (!ret) return NULL; if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, extreg, options, arena)) { return NULL; } return ret; } UPB_INLINE char *envoy_config_overload_v3_ThresholdTrigger_serialize(const envoy_config_overload_v3_ThresholdTrigger *msg, upb_arena *arena, size_t *len) { return upb_encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msginit, arena, len); } UPB_INLINE double envoy_config_overload_v3_ThresholdTrigger_value(const envoy_config_overload_v3_ThresholdTrigger *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); } UPB_INLINE void envoy_config_overload_v3_ThresholdTrigger_set_value(envoy_config_overload_v3_ThresholdTrigger *msg, double value) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value; } /* envoy.config.overload.v3.ScaledTrigger */ UPB_INLINE envoy_config_overload_v3_ScaledTrigger *envoy_config_overload_v3_ScaledTrigger_new(upb_arena *arena) { return (envoy_config_overload_v3_ScaledTrigger *)_upb_msg_new(&envoy_config_overload_v3_ScaledTrigger_msginit, arena); } UPB_INLINE envoy_config_overload_v3_ScaledTrigger *envoy_config_overload_v3_ScaledTrigger_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, arena)) return NULL; return ret; } UPB_INLINE envoy_config_overload_v3_ScaledTrigger *envoy_config_overload_v3_ScaledTrigger_parse_ex(const char *buf, size_t size, const upb_extreg *extreg, int options, upb_arena *arena) { envoy_config_overload_v3_ScaledTrigger *ret = envoy_config_overload_v3_ScaledTrigger_new(arena); if (!ret) return NULL; if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, extreg, options, arena)) { return NULL; } return ret; } UPB_INLINE char *envoy_config_overload_v3_ScaledTrigger_serialize(const envoy_config_overload_v3_ScaledTrigger *msg, upb_arena *arena, size_t *len) { return upb_encode(msg, &envoy_config_overload_v3_ScaledTrigger_msginit, arena, len); } UPB_INLINE double envoy_config_overload_v3_ScaledTrigger_scaling_threshold(const envoy_config_overload_v3_ScaledTrigger *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); } UPB_INLINE double envoy_config_overload_v3_ScaledTrigger_saturation_threshold(const envoy_config_overload_v3_ScaledTrigger *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); } UPB_INLINE void envoy_config_overload_v3_ScaledTrigger_set_scaling_threshold(envoy_config_overload_v3_ScaledTrigger *msg, double value) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value; } 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; } /* envoy.config.overload.v3.Trigger */ UPB_INLINE envoy_config_overload_v3_Trigger *envoy_config_overload_v3_Trigger_new(upb_arena *arena) { return (envoy_config_overload_v3_Trigger *)_upb_msg_new(&envoy_config_overload_v3_Trigger_msginit, arena); } UPB_INLINE envoy_config_overload_v3_Trigger *envoy_config_overload_v3_Trigger_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, arena)) return NULL; return ret; } UPB_INLINE envoy_config_overload_v3_Trigger *envoy_config_overload_v3_Trigger_parse_ex(const char *buf, size_t size, const upb_extreg *extreg, int options, upb_arena *arena) { envoy_config_overload_v3_Trigger *ret = envoy_config_overload_v3_Trigger_new(arena); if (!ret) return NULL; if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, extreg, options, arena)) { return NULL; } return ret; } UPB_INLINE char *envoy_config_overload_v3_Trigger_serialize(const envoy_config_overload_v3_Trigger *msg, upb_arena *arena, size_t *len) { return upb_encode(msg, &envoy_config_overload_v3_Trigger_msginit, arena, len); } typedef enum { envoy_config_overload_v3_Trigger_trigger_oneof_threshold = 2, envoy_config_overload_v3_Trigger_trigger_oneof_scaled = 3, envoy_config_overload_v3_Trigger_trigger_oneof_NOT_SET = 0 } envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases; UPB_INLINE envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases envoy_config_overload_v3_Trigger_trigger_oneof_case(const envoy_config_overload_v3_Trigger* msg) { return (envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); } UPB_INLINE upb_strview envoy_config_overload_v3_Trigger_name(const envoy_config_overload_v3_Trigger *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); } UPB_INLINE bool envoy_config_overload_v3_Trigger_has_threshold(const envoy_config_overload_v3_Trigger *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; } UPB_INLINE const envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_Trigger_threshold(const envoy_config_overload_v3_Trigger *msg) { return UPB_READ_ONEOF(msg, const envoy_config_overload_v3_ThresholdTrigger*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); } UPB_INLINE bool envoy_config_overload_v3_Trigger_has_scaled(const envoy_config_overload_v3_Trigger *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; } UPB_INLINE const envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Trigger_scaled(const envoy_config_overload_v3_Trigger *msg) { return UPB_READ_ONEOF(msg, const envoy_config_overload_v3_ScaledTrigger*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); } UPB_INLINE void envoy_config_overload_v3_Trigger_set_name(envoy_config_overload_v3_Trigger *msg, upb_strview value) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value; } UPB_INLINE void envoy_config_overload_v3_Trigger_set_threshold(envoy_config_overload_v3_Trigger *msg, envoy_config_overload_v3_ThresholdTrigger* value) { UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ThresholdTrigger*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2); } UPB_INLINE struct envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_Trigger_mutable_threshold(envoy_config_overload_v3_Trigger *msg, upb_arena *arena) { struct envoy_config_overload_v3_ThresholdTrigger* sub = (struct envoy_config_overload_v3_ThresholdTrigger*)envoy_config_overload_v3_Trigger_threshold(msg); if (sub == NULL) { sub = (struct envoy_config_overload_v3_ThresholdTrigger*)_upb_msg_new(&envoy_config_overload_v3_ThresholdTrigger_msginit, arena); if (!sub) return NULL; envoy_config_overload_v3_Trigger_set_threshold(msg, sub); } return sub; } UPB_INLINE void envoy_config_overload_v3_Trigger_set_scaled(envoy_config_overload_v3_Trigger *msg, envoy_config_overload_v3_ScaledTrigger* value) { UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ScaledTrigger*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3); } UPB_INLINE struct envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Trigger_mutable_scaled(envoy_config_overload_v3_Trigger *msg, upb_arena *arena) { struct envoy_config_overload_v3_ScaledTrigger* sub = (struct envoy_config_overload_v3_ScaledTrigger*)envoy_config_overload_v3_Trigger_scaled(msg); if (sub == NULL) { sub = (struct envoy_config_overload_v3_ScaledTrigger*)_upb_msg_new(&envoy_config_overload_v3_ScaledTrigger_msginit, arena); if (!sub) return NULL; envoy_config_overload_v3_Trigger_set_scaled(msg, sub); } return sub; } /* envoy.config.overload.v3.ScaleTimersOverloadActionConfig */ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(upb_arena *arena) { return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig *)_upb_msg_new(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena); } UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_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, arena)) return NULL; return ret; } UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_parse_ex(const char *buf, size_t size, const upb_extreg *extreg, int options, upb_arena *arena) { envoy_config_overload_v3_ScaleTimersOverloadActionConfig *ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(arena); if (!ret) return NULL; if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, extreg, options, arena)) { return NULL; } return ret; } UPB_INLINE char *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_serialize(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, upb_arena *arena, size_t *len) { return upb_encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena, len); } UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_has_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); } UPB_INLINE const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* const* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, size_t *len) { return (const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); } UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer** envoy_config_overload_v3_ScaleTimersOverloadActionConfig_mutable_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, size_t *len) { return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); } UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer** envoy_config_overload_v3_ScaleTimersOverloadActionConfig_resize_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, size_t len, upb_arena *arena) { return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_add_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, upb_arena *arena) { struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* sub = (struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer*)_upb_msg_new(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena); bool ok = _upb_array_append_accessor2( msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } /* envoy.config.overload.v3.ScaleTimersOverloadActionConfig.ScaleTimer */ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(upb_arena *arena) { return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *)_upb_msg_new(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena); } UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_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, arena)) return NULL; return ret; } UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_parse_ex(const char *buf, size_t size, const upb_extreg *extreg, int options, upb_arena *arena) { envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(arena); if (!ret) return NULL; if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, extreg, options, arena)) { return NULL; } return ret; } UPB_INLINE char *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_serialize(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, upb_arena *arena, size_t *len) { return upb_encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena, len); } typedef enum { envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_min_timeout = 2, envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_min_scale = 3, envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_NOT_SET = 0 } envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases; UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_case(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); } UPB_INLINE int32_t envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_timer(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); } UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_has_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; } UPB_INLINE const struct google_protobuf_Duration* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 2, NULL); } UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_has_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; } UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Percent*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 3, NULL); } UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_timer(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, int32_t value) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; } UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_timeout(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, struct google_protobuf_Duration* value) { UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 2); } UPB_INLINE struct google_protobuf_Duration* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_mutable_min_timeout(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, upb_arena *arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_timeout(msg); if (sub == NULL) { sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena); if (!sub) return NULL; envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_timeout(msg, sub); } return sub; } UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_scale(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, struct envoy_type_v3_Percent* value) { UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Percent*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 3); } UPB_INLINE struct envoy_type_v3_Percent* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_mutable_min_scale(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, upb_arena *arena) { struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_scale(msg); if (sub == NULL) { sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena); if (!sub) return NULL; envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_scale(msg, sub); } return sub; } /* envoy.config.overload.v3.OverloadAction */ UPB_INLINE envoy_config_overload_v3_OverloadAction *envoy_config_overload_v3_OverloadAction_new(upb_arena *arena) { return (envoy_config_overload_v3_OverloadAction *)_upb_msg_new(&envoy_config_overload_v3_OverloadAction_msginit, arena); } UPB_INLINE envoy_config_overload_v3_OverloadAction *envoy_config_overload_v3_OverloadAction_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, arena)) return NULL; return ret; } UPB_INLINE envoy_config_overload_v3_OverloadAction *envoy_config_overload_v3_OverloadAction_parse_ex(const char *buf, size_t size, const upb_extreg *extreg, int options, upb_arena *arena) { envoy_config_overload_v3_OverloadAction *ret = envoy_config_overload_v3_OverloadAction_new(arena); if (!ret) return NULL; if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, extreg, options, arena)) { return NULL; } return ret; } UPB_INLINE char *envoy_config_overload_v3_OverloadAction_serialize(const envoy_config_overload_v3_OverloadAction *msg, upb_arena *arena, size_t *len) { return upb_encode(msg, &envoy_config_overload_v3_OverloadAction_msginit, arena, len); } UPB_INLINE upb_strview envoy_config_overload_v3_OverloadAction_name(const envoy_config_overload_v3_OverloadAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); } UPB_INLINE bool envoy_config_overload_v3_OverloadAction_has_triggers(const envoy_config_overload_v3_OverloadAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); } UPB_INLINE const envoy_config_overload_v3_Trigger* const* envoy_config_overload_v3_OverloadAction_triggers(const envoy_config_overload_v3_OverloadAction *msg, size_t *len) { return (const envoy_config_overload_v3_Trigger* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); } UPB_INLINE bool envoy_config_overload_v3_OverloadAction_has_typed_config(const envoy_config_overload_v3_OverloadAction *msg) { return _upb_hasbit(msg, 1); } UPB_INLINE const struct google_protobuf_Any* envoy_config_overload_v3_OverloadAction_typed_config(const envoy_config_overload_v3_OverloadAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); } UPB_INLINE void envoy_config_overload_v3_OverloadAction_set_name(envoy_config_overload_v3_OverloadAction *msg, upb_strview value) { *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value; } UPB_INLINE envoy_config_overload_v3_Trigger** envoy_config_overload_v3_OverloadAction_mutable_triggers(envoy_config_overload_v3_OverloadAction *msg, size_t *len) { return (envoy_config_overload_v3_Trigger**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); } UPB_INLINE envoy_config_overload_v3_Trigger** envoy_config_overload_v3_OverloadAction_resize_triggers(envoy_config_overload_v3_OverloadAction *msg, size_t len, upb_arena *arena) { return (envoy_config_overload_v3_Trigger**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct envoy_config_overload_v3_Trigger* envoy_config_overload_v3_OverloadAction_add_triggers(envoy_config_overload_v3_OverloadAction *msg, upb_arena *arena) { struct envoy_config_overload_v3_Trigger* sub = (struct envoy_config_overload_v3_Trigger*)_upb_msg_new(&envoy_config_overload_v3_Trigger_msginit, arena); bool ok = _upb_array_append_accessor2( msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } UPB_INLINE void envoy_config_overload_v3_OverloadAction_set_typed_config(envoy_config_overload_v3_OverloadAction *msg, struct google_protobuf_Any* value) { _upb_sethas(msg, 1); *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value; } UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_OverloadAction_mutable_typed_config(envoy_config_overload_v3_OverloadAction *msg, upb_arena *arena) { struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_overload_v3_OverloadAction_typed_config(msg); if (sub == NULL) { sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena); if (!sub) return NULL; envoy_config_overload_v3_OverloadAction_set_typed_config(msg, sub); } return sub; } /* 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_msg_new(&envoy_config_overload_v3_BufferFactoryConfig_msginit, arena); } UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig *envoy_config_overload_v3_BufferFactoryConfig_parse(const char *buf, size_t size, upb_arena *arena) { envoy_config_overload_v3_BufferFactoryConfig *ret = envoy_config_overload_v3_BufferFactoryConfig_new(arena); if (!ret) return NULL; if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_BufferFactoryConfig_msginit, arena)) return NULL; return ret; } UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig *envoy_config_overload_v3_BufferFactoryConfig_parse_ex(const char *buf, size_t size, const upb_extreg *extreg, int options, upb_arena *arena) { envoy_config_overload_v3_BufferFactoryConfig *ret = envoy_config_overload_v3_BufferFactoryConfig_new(arena); if (!ret) return NULL; if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_BufferFactoryConfig_msginit, extreg, options, arena)) { return NULL; } return ret; } UPB_INLINE char *envoy_config_overload_v3_BufferFactoryConfig_serialize(const envoy_config_overload_v3_BufferFactoryConfig *msg, upb_arena *arena, size_t *len) { return upb_encode(msg, &envoy_config_overload_v3_BufferFactoryConfig_msginit, arena, len); } UPB_INLINE uint32_t envoy_config_overload_v3_BufferFactoryConfig_minimum_account_to_track_power_of_two(const envoy_config_overload_v3_BufferFactoryConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); } UPB_INLINE 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; } /* 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_msg_new(&envoy_config_overload_v3_OverloadManager_msginit, arena); } UPB_INLINE envoy_config_overload_v3_OverloadManager *envoy_config_overload_v3_OverloadManager_parse(const char *buf, size_t size, upb_arena *arena) { envoy_config_overload_v3_OverloadManager *ret = envoy_config_overload_v3_OverloadManager_new(arena); if (!ret) return NULL; if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, arena)) return NULL; return ret; } UPB_INLINE envoy_config_overload_v3_OverloadManager *envoy_config_overload_v3_OverloadManager_parse_ex(const char *buf, size_t size, const upb_extreg *extreg, int options, upb_arena *arena) { envoy_config_overload_v3_OverloadManager *ret = envoy_config_overload_v3_OverloadManager_new(arena); if (!ret) return NULL; if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, extreg, options, arena)) { return NULL; } return ret; } UPB_INLINE char *envoy_config_overload_v3_OverloadManager_serialize(const envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena, size_t *len) { return upb_encode(msg, &envoy_config_overload_v3_OverloadManager_msginit, arena, len); } UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_refresh_interval(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_hasbit(msg, 1); } UPB_INLINE const struct google_protobuf_Duration* envoy_config_overload_v3_OverloadManager_refresh_interval(const envoy_config_overload_v3_OverloadManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); } UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_resource_monitors(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); } 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(12, 24), len); } UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_actions(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); } 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(16, 32), 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 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(8, 16), const envoy_config_overload_v3_BufferFactoryConfig*); } UPB_INLINE void envoy_config_overload_v3_OverloadManager_set_refresh_interval(envoy_config_overload_v3_OverloadManager *msg, struct google_protobuf_Duration* value) { _upb_sethas(msg, 1); *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value; } UPB_INLINE struct google_protobuf_Duration* envoy_config_overload_v3_OverloadManager_mutable_refresh_interval(envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_overload_v3_OverloadManager_refresh_interval(msg); if (sub == NULL) { sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena); if (!sub) return NULL; envoy_config_overload_v3_OverloadManager_set_refresh_interval(msg, sub); } return sub; } UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_mutable_resource_monitors(envoy_config_overload_v3_OverloadManager *msg, size_t *len) { return (envoy_config_overload_v3_ResourceMonitor**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); } UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_resize_resource_monitors(envoy_config_overload_v3_OverloadManager *msg, size_t len, upb_arena *arena) { return (envoy_config_overload_v3_ResourceMonitor**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_OverloadManager_add_resource_monitors(envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena) { struct envoy_config_overload_v3_ResourceMonitor* sub = (struct envoy_config_overload_v3_ResourceMonitor*)_upb_msg_new(&envoy_config_overload_v3_ResourceMonitor_msginit, arena); bool ok = _upb_array_append_accessor2( msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_mutable_actions(envoy_config_overload_v3_OverloadManager *msg, size_t *len) { return (envoy_config_overload_v3_OverloadAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); } UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_resize_actions(envoy_config_overload_v3_OverloadManager *msg, size_t len, upb_arena *arena) { return (envoy_config_overload_v3_OverloadAction**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena); } UPB_INLINE struct envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_OverloadManager_add_actions(envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena) { struct envoy_config_overload_v3_OverloadAction* sub = (struct envoy_config_overload_v3_OverloadAction*)_upb_msg_new(&envoy_config_overload_v3_OverloadAction_msginit, arena); bool ok = _upb_array_append_accessor2( msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena); if (!ok) return NULL; return sub; } UPB_INLINE void envoy_config_overload_v3_OverloadManager_set_buffer_factory_config(envoy_config_overload_v3_OverloadManager *msg, envoy_config_overload_v3_BufferFactoryConfig* value) { _upb_sethas(msg, 2); *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_overload_v3_BufferFactoryConfig*) = value; } UPB_INLINE struct envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_OverloadManager_mutable_buffer_factory_config(envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena) { struct envoy_config_overload_v3_BufferFactoryConfig* sub = (struct envoy_config_overload_v3_BufferFactoryConfig*)envoy_config_overload_v3_OverloadManager_buffer_factory_config(msg); if (sub == NULL) { sub = (struct envoy_config_overload_v3_BufferFactoryConfig*)_upb_msg_new(&envoy_config_overload_v3_BufferFactoryConfig_msginit, arena); if (!sub) return NULL; envoy_config_overload_v3_OverloadManager_set_buffer_factory_config(msg, sub); } return sub; } extern const upb_msglayout_file envoy_config_overload_v3_overload_proto_upb_file_layout; #ifdef __cplusplus } /* extern "C" */ #endif #include "upb/port_undef.inc" #endif /* ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPB_H_ */