1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * envoy/config/core/v3/socket_option.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_
10 #define ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_
11
12 #include "upb/msg.h"
13 #include "upb/decode.h"
14 #include "upb/decode_fast.h"
15 #include "upb/encode.h"
16
17 #include "upb/port_def.inc"
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 struct envoy_config_core_v3_SocketOption;
24 typedef struct envoy_config_core_v3_SocketOption envoy_config_core_v3_SocketOption;
25 extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
26
27 typedef enum {
28 envoy_config_core_v3_SocketOption_STATE_PREBIND = 0,
29 envoy_config_core_v3_SocketOption_STATE_BOUND = 1,
30 envoy_config_core_v3_SocketOption_STATE_LISTENING = 2
31 } envoy_config_core_v3_SocketOption_SocketState;
32
33
34 /* envoy.config.core.v3.SocketOption */
35
envoy_config_core_v3_SocketOption_new(upb_arena * arena)36 UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_new(upb_arena *arena) {
37 return (envoy_config_core_v3_SocketOption *)_upb_msg_new(&envoy_config_core_v3_SocketOption_msginit, arena);
38 }
envoy_config_core_v3_SocketOption_parse(const char * buf,size_t size,upb_arena * arena)39 UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_parse(const char *buf, size_t size,
40 upb_arena *arena) {
41 envoy_config_core_v3_SocketOption *ret = envoy_config_core_v3_SocketOption_new(arena);
42 return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, arena)) ? ret : NULL;
43 }
envoy_config_core_v3_SocketOption_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)44 UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_parse_ex(const char *buf, size_t size,
45 upb_arena *arena, int options) {
46 envoy_config_core_v3_SocketOption *ret = envoy_config_core_v3_SocketOption_new(arena);
47 return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, arena, options))
48 ? ret : NULL;
49 }
envoy_config_core_v3_SocketOption_serialize(const envoy_config_core_v3_SocketOption * msg,upb_arena * arena,size_t * len)50 UPB_INLINE char *envoy_config_core_v3_SocketOption_serialize(const envoy_config_core_v3_SocketOption *msg, upb_arena *arena, size_t *len) {
51 return upb_encode(msg, &envoy_config_core_v3_SocketOption_msginit, arena, len);
52 }
53
54 typedef enum {
55 envoy_config_core_v3_SocketOption_value_int_value = 4,
56 envoy_config_core_v3_SocketOption_value_buf_value = 5,
57 envoy_config_core_v3_SocketOption_value_NOT_SET = 0
58 } envoy_config_core_v3_SocketOption_value_oneofcases;
envoy_config_core_v3_SocketOption_value_case(const envoy_config_core_v3_SocketOption * msg)59 UPB_INLINE envoy_config_core_v3_SocketOption_value_oneofcases envoy_config_core_v3_SocketOption_value_case(const envoy_config_core_v3_SocketOption* msg) { return (envoy_config_core_v3_SocketOption_value_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(40, 56), int32_t); }
60
envoy_config_core_v3_SocketOption_description(const envoy_config_core_v3_SocketOption * msg)61 UPB_INLINE upb_strview envoy_config_core_v3_SocketOption_description(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview); }
envoy_config_core_v3_SocketOption_level(const envoy_config_core_v3_SocketOption * msg)62 UPB_INLINE int64_t envoy_config_core_v3_SocketOption_level(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
envoy_config_core_v3_SocketOption_name(const envoy_config_core_v3_SocketOption * msg)63 UPB_INLINE int64_t envoy_config_core_v3_SocketOption_name(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
envoy_config_core_v3_SocketOption_has_int_value(const envoy_config_core_v3_SocketOption * msg)64 UPB_INLINE bool envoy_config_core_v3_SocketOption_has_int_value(const envoy_config_core_v3_SocketOption *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 56)) == 4; }
envoy_config_core_v3_SocketOption_int_value(const envoy_config_core_v3_SocketOption * msg)65 UPB_INLINE int64_t envoy_config_core_v3_SocketOption_int_value(const envoy_config_core_v3_SocketOption *msg) { return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(32, 40), UPB_SIZE(40, 56), 4, 0); }
envoy_config_core_v3_SocketOption_has_buf_value(const envoy_config_core_v3_SocketOption * msg)66 UPB_INLINE bool envoy_config_core_v3_SocketOption_has_buf_value(const envoy_config_core_v3_SocketOption *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 56)) == 5; }
envoy_config_core_v3_SocketOption_buf_value(const envoy_config_core_v3_SocketOption * msg)67 UPB_INLINE upb_strview envoy_config_core_v3_SocketOption_buf_value(const envoy_config_core_v3_SocketOption *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(32, 40), UPB_SIZE(40, 56), 5, upb_strview_make("", strlen(""))); }
envoy_config_core_v3_SocketOption_state(const envoy_config_core_v3_SocketOption * msg)68 UPB_INLINE int32_t envoy_config_core_v3_SocketOption_state(const envoy_config_core_v3_SocketOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
69
envoy_config_core_v3_SocketOption_set_description(envoy_config_core_v3_SocketOption * msg,upb_strview value)70 UPB_INLINE void envoy_config_core_v3_SocketOption_set_description(envoy_config_core_v3_SocketOption *msg, upb_strview value) {
71 *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview) = value;
72 }
envoy_config_core_v3_SocketOption_set_level(envoy_config_core_v3_SocketOption * msg,int64_t value)73 UPB_INLINE void envoy_config_core_v3_SocketOption_set_level(envoy_config_core_v3_SocketOption *msg, int64_t value) {
74 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
75 }
envoy_config_core_v3_SocketOption_set_name(envoy_config_core_v3_SocketOption * msg,int64_t value)76 UPB_INLINE void envoy_config_core_v3_SocketOption_set_name(envoy_config_core_v3_SocketOption *msg, int64_t value) {
77 *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
78 }
envoy_config_core_v3_SocketOption_set_int_value(envoy_config_core_v3_SocketOption * msg,int64_t value)79 UPB_INLINE void envoy_config_core_v3_SocketOption_set_int_value(envoy_config_core_v3_SocketOption *msg, int64_t value) {
80 UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(32, 40), value, UPB_SIZE(40, 56), 4);
81 }
envoy_config_core_v3_SocketOption_set_buf_value(envoy_config_core_v3_SocketOption * msg,upb_strview value)82 UPB_INLINE void envoy_config_core_v3_SocketOption_set_buf_value(envoy_config_core_v3_SocketOption *msg, upb_strview value) {
83 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(32, 40), value, UPB_SIZE(40, 56), 5);
84 }
envoy_config_core_v3_SocketOption_set_state(envoy_config_core_v3_SocketOption * msg,int32_t value)85 UPB_INLINE void envoy_config_core_v3_SocketOption_set_state(envoy_config_core_v3_SocketOption *msg, int32_t value) {
86 *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
87 }
88
89 #ifdef __cplusplus
90 } /* extern "C" */
91 #endif
92
93 #include "upb/port_undef.inc"
94
95 #endif /* ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_ */
96