1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * envoy/config/core/v3/udp_socket_config.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_
10 #define ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_
11
12 #include "upb/collections/array_internal.h"
13 #include "upb/collections/map_gencode_util.h"
14 #include "upb/message/accessors.h"
15 #include "upb/message/internal.h"
16 #include "upb/mini_table/enum_internal.h"
17 #include "upb/wire/decode.h"
18 #include "upb/wire/decode_fast.h"
19 #include "upb/wire/encode.h"
20
21 // Must be last.
22 #include "upb/port/def.inc"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 typedef struct envoy_config_core_v3_UdpSocketConfig envoy_config_core_v3_UdpSocketConfig;
29 extern const upb_MiniTable envoy_config_core_v3_UdpSocketConfig_msg_init;
30 struct google_protobuf_BoolValue;
31 struct google_protobuf_UInt64Value;
32 extern const upb_MiniTable google_protobuf_BoolValue_msg_init;
33 extern const upb_MiniTable google_protobuf_UInt64Value_msg_init;
34
35
36
37 /* envoy.config.core.v3.UdpSocketConfig */
38
envoy_config_core_v3_UdpSocketConfig_new(upb_Arena * arena)39 UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketConfig_new(upb_Arena* arena) {
40 return (envoy_config_core_v3_UdpSocketConfig*)_upb_Message_New(&envoy_config_core_v3_UdpSocketConfig_msg_init, arena);
41 }
envoy_config_core_v3_UdpSocketConfig_parse(const char * buf,size_t size,upb_Arena * arena)42 UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
43 envoy_config_core_v3_UdpSocketConfig* ret = envoy_config_core_v3_UdpSocketConfig_new(arena);
44 if (!ret) return NULL;
45 if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UdpSocketConfig_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
46 return NULL;
47 }
48 return ret;
49 }
envoy_config_core_v3_UdpSocketConfig_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)50 UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketConfig_parse_ex(const char* buf, size_t size,
51 const upb_ExtensionRegistry* extreg,
52 int options, upb_Arena* arena) {
53 envoy_config_core_v3_UdpSocketConfig* ret = envoy_config_core_v3_UdpSocketConfig_new(arena);
54 if (!ret) return NULL;
55 if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UdpSocketConfig_msg_init, extreg, options, arena) !=
56 kUpb_DecodeStatus_Ok) {
57 return NULL;
58 }
59 return ret;
60 }
envoy_config_core_v3_UdpSocketConfig_serialize(const envoy_config_core_v3_UdpSocketConfig * msg,upb_Arena * arena,size_t * len)61 UPB_INLINE char* envoy_config_core_v3_UdpSocketConfig_serialize(const envoy_config_core_v3_UdpSocketConfig* msg, upb_Arena* arena, size_t* len) {
62 char* ptr;
63 (void)upb_Encode(msg, &envoy_config_core_v3_UdpSocketConfig_msg_init, 0, arena, &ptr, len);
64 return ptr;
65 }
envoy_config_core_v3_UdpSocketConfig_serialize_ex(const envoy_config_core_v3_UdpSocketConfig * msg,int options,upb_Arena * arena,size_t * len)66 UPB_INLINE char* envoy_config_core_v3_UdpSocketConfig_serialize_ex(const envoy_config_core_v3_UdpSocketConfig* msg, int options,
67 upb_Arena* arena, size_t* len) {
68 char* ptr;
69 (void)upb_Encode(msg, &envoy_config_core_v3_UdpSocketConfig_msg_init, options, arena, &ptr, len);
70 return ptr;
71 }
envoy_config_core_v3_UdpSocketConfig_clear_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig * msg)72 UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_clear_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig* msg) {
73 const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
74 _upb_Message_ClearNonExtensionField(msg, &field);
75 }
envoy_config_core_v3_UdpSocketConfig_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig * msg)76 UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_core_v3_UdpSocketConfig_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig* msg) {
77 const struct google_protobuf_UInt64Value* default_val = NULL;
78 const struct google_protobuf_UInt64Value* ret;
79 const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
80 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
81 return ret;
82 }
envoy_config_core_v3_UdpSocketConfig_has_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig * msg)83 UPB_INLINE bool envoy_config_core_v3_UdpSocketConfig_has_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig* msg) {
84 const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
85 return _upb_Message_HasNonExtensionField(msg, &field);
86 }
envoy_config_core_v3_UdpSocketConfig_clear_prefer_gro(envoy_config_core_v3_UdpSocketConfig * msg)87 UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_clear_prefer_gro(envoy_config_core_v3_UdpSocketConfig* msg) {
88 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)};
89 _upb_Message_ClearNonExtensionField(msg, &field);
90 }
envoy_config_core_v3_UdpSocketConfig_prefer_gro(const envoy_config_core_v3_UdpSocketConfig * msg)91 UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_UdpSocketConfig_prefer_gro(const envoy_config_core_v3_UdpSocketConfig* msg) {
92 const struct google_protobuf_BoolValue* default_val = NULL;
93 const struct google_protobuf_BoolValue* ret;
94 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)};
95 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
96 return ret;
97 }
envoy_config_core_v3_UdpSocketConfig_has_prefer_gro(const envoy_config_core_v3_UdpSocketConfig * msg)98 UPB_INLINE bool envoy_config_core_v3_UdpSocketConfig_has_prefer_gro(const envoy_config_core_v3_UdpSocketConfig* msg) {
99 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)};
100 return _upb_Message_HasNonExtensionField(msg, &field);
101 }
102
envoy_config_core_v3_UdpSocketConfig_set_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig * msg,struct google_protobuf_UInt64Value * value)103 UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_set_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig *msg, struct google_protobuf_UInt64Value* value) {
104 const upb_MiniTableField field = {1, UPB_SIZE(4, 8), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
105 _upb_Message_SetNonExtensionField(msg, &field, &value);
106 }
envoy_config_core_v3_UdpSocketConfig_mutable_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig * msg,upb_Arena * arena)107 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) {
108 struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_core_v3_UdpSocketConfig_max_rx_datagram_size(msg);
109 if (sub == NULL) {
110 sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msg_init, arena);
111 if (sub) envoy_config_core_v3_UdpSocketConfig_set_max_rx_datagram_size(msg, sub);
112 }
113 return sub;
114 }
envoy_config_core_v3_UdpSocketConfig_set_prefer_gro(envoy_config_core_v3_UdpSocketConfig * msg,struct google_protobuf_BoolValue * value)115 UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_set_prefer_gro(envoy_config_core_v3_UdpSocketConfig *msg, struct google_protobuf_BoolValue* value) {
116 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)};
117 _upb_Message_SetNonExtensionField(msg, &field, &value);
118 }
envoy_config_core_v3_UdpSocketConfig_mutable_prefer_gro(envoy_config_core_v3_UdpSocketConfig * msg,upb_Arena * arena)119 UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_UdpSocketConfig_mutable_prefer_gro(envoy_config_core_v3_UdpSocketConfig* msg, upb_Arena* arena) {
120 struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_UdpSocketConfig_prefer_gro(msg);
121 if (sub == NULL) {
122 sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msg_init, arena);
123 if (sub) envoy_config_core_v3_UdpSocketConfig_set_prefer_gro(msg, sub);
124 }
125 return sub;
126 }
127
128 extern const upb_MiniTableFile envoy_config_core_v3_udp_socket_config_proto_upb_file_layout;
129
130 #ifdef __cplusplus
131 } /* extern "C" */
132 #endif
133
134 #include "upb/port/undef.inc"
135
136 #endif /* ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_ */
137