1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * xds/core/v3/resource_locator.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_
10 #define XDS_CORE_V3_RESOURCE_LOCATOR_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 xds_core_v3_ResourceLocator;
24 struct xds_core_v3_ResourceLocator_Directive;
25 typedef struct xds_core_v3_ResourceLocator xds_core_v3_ResourceLocator;
26 typedef struct xds_core_v3_ResourceLocator_Directive xds_core_v3_ResourceLocator_Directive;
27 extern const upb_msglayout xds_core_v3_ResourceLocator_msginit;
28 extern const upb_msglayout xds_core_v3_ResourceLocator_Directive_msginit;
29 struct xds_core_v3_ContextParams;
30 extern const upb_msglayout xds_core_v3_ContextParams_msginit;
31
32 typedef enum {
33 xds_core_v3_ResourceLocator_XDSTP = 0,
34 xds_core_v3_ResourceLocator_HTTP = 1,
35 xds_core_v3_ResourceLocator_FILE = 2
36 } xds_core_v3_ResourceLocator_Scheme;
37
38
39 /* xds.core.v3.ResourceLocator */
40
xds_core_v3_ResourceLocator_new(upb_arena * arena)41 UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_new(upb_arena *arena) {
42 return (xds_core_v3_ResourceLocator *)_upb_msg_new(&xds_core_v3_ResourceLocator_msginit, arena);
43 }
xds_core_v3_ResourceLocator_parse(const char * buf,size_t size,upb_arena * arena)44 UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_parse(const char *buf, size_t size,
45 upb_arena *arena) {
46 xds_core_v3_ResourceLocator *ret = xds_core_v3_ResourceLocator_new(arena);
47 return (ret && upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, arena)) ? ret : NULL;
48 }
xds_core_v3_ResourceLocator_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)49 UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_parse_ex(const char *buf, size_t size,
50 upb_arena *arena, int options) {
51 xds_core_v3_ResourceLocator *ret = xds_core_v3_ResourceLocator_new(arena);
52 return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, arena, options))
53 ? ret : NULL;
54 }
xds_core_v3_ResourceLocator_serialize(const xds_core_v3_ResourceLocator * msg,upb_arena * arena,size_t * len)55 UPB_INLINE char *xds_core_v3_ResourceLocator_serialize(const xds_core_v3_ResourceLocator *msg, upb_arena *arena, size_t *len) {
56 return upb_encode(msg, &xds_core_v3_ResourceLocator_msginit, arena, len);
57 }
58
59 typedef enum {
60 xds_core_v3_ResourceLocator_context_param_specifier_exact_context = 5,
61 xds_core_v3_ResourceLocator_context_param_specifier_NOT_SET = 0
62 } xds_core_v3_ResourceLocator_context_param_specifier_oneofcases;
xds_core_v3_ResourceLocator_context_param_specifier_case(const xds_core_v3_ResourceLocator * msg)63 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(36, 72), int32_t); }
64
xds_core_v3_ResourceLocator_scheme(const xds_core_v3_ResourceLocator * msg)65 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); }
xds_core_v3_ResourceLocator_id(const xds_core_v3_ResourceLocator * msg)66 UPB_INLINE upb_strview xds_core_v3_ResourceLocator_id(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
xds_core_v3_ResourceLocator_authority(const xds_core_v3_ResourceLocator * msg)67 UPB_INLINE upb_strview xds_core_v3_ResourceLocator_authority(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
xds_core_v3_ResourceLocator_resource_type(const xds_core_v3_ResourceLocator * msg)68 UPB_INLINE upb_strview xds_core_v3_ResourceLocator_resource_type(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
xds_core_v3_ResourceLocator_has_exact_context(const xds_core_v3_ResourceLocator * msg)69 UPB_INLINE bool xds_core_v3_ResourceLocator_has_exact_context(const xds_core_v3_ResourceLocator *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 5; }
xds_core_v3_ResourceLocator_exact_context(const xds_core_v3_ResourceLocator * msg)70 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(32, 64), UPB_SIZE(36, 72), 5, NULL); }
xds_core_v3_ResourceLocator_has_directives(const xds_core_v3_ResourceLocator * msg)71 UPB_INLINE bool xds_core_v3_ResourceLocator_has_directives(const xds_core_v3_ResourceLocator *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
xds_core_v3_ResourceLocator_directives(const xds_core_v3_ResourceLocator * msg,size_t * len)72 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(28, 56), len); }
73
xds_core_v3_ResourceLocator_set_scheme(xds_core_v3_ResourceLocator * msg,int32_t value)74 UPB_INLINE void xds_core_v3_ResourceLocator_set_scheme(xds_core_v3_ResourceLocator *msg, int32_t value) {
75 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
76 }
xds_core_v3_ResourceLocator_set_id(xds_core_v3_ResourceLocator * msg,upb_strview value)77 UPB_INLINE void xds_core_v3_ResourceLocator_set_id(xds_core_v3_ResourceLocator *msg, upb_strview value) {
78 *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
79 }
xds_core_v3_ResourceLocator_set_authority(xds_core_v3_ResourceLocator * msg,upb_strview value)80 UPB_INLINE void xds_core_v3_ResourceLocator_set_authority(xds_core_v3_ResourceLocator *msg, upb_strview value) {
81 *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
82 }
xds_core_v3_ResourceLocator_set_resource_type(xds_core_v3_ResourceLocator * msg,upb_strview value)83 UPB_INLINE void xds_core_v3_ResourceLocator_set_resource_type(xds_core_v3_ResourceLocator *msg, upb_strview value) {
84 *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
85 }
xds_core_v3_ResourceLocator_set_exact_context(xds_core_v3_ResourceLocator * msg,struct xds_core_v3_ContextParams * value)86 UPB_INLINE void xds_core_v3_ResourceLocator_set_exact_context(xds_core_v3_ResourceLocator *msg, struct xds_core_v3_ContextParams* value) {
87 UPB_WRITE_ONEOF(msg, struct xds_core_v3_ContextParams*, UPB_SIZE(32, 64), value, UPB_SIZE(36, 72), 5);
88 }
xds_core_v3_ResourceLocator_mutable_exact_context(xds_core_v3_ResourceLocator * msg,upb_arena * arena)89 UPB_INLINE struct xds_core_v3_ContextParams* xds_core_v3_ResourceLocator_mutable_exact_context(xds_core_v3_ResourceLocator *msg, upb_arena *arena) {
90 struct xds_core_v3_ContextParams* sub = (struct xds_core_v3_ContextParams*)xds_core_v3_ResourceLocator_exact_context(msg);
91 if (sub == NULL) {
92 sub = (struct xds_core_v3_ContextParams*)_upb_msg_new(&xds_core_v3_ContextParams_msginit, arena);
93 if (!sub) return NULL;
94 xds_core_v3_ResourceLocator_set_exact_context(msg, sub);
95 }
96 return sub;
97 }
xds_core_v3_ResourceLocator_mutable_directives(xds_core_v3_ResourceLocator * msg,size_t * len)98 UPB_INLINE xds_core_v3_ResourceLocator_Directive** xds_core_v3_ResourceLocator_mutable_directives(xds_core_v3_ResourceLocator *msg, size_t *len) {
99 return (xds_core_v3_ResourceLocator_Directive**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
100 }
xds_core_v3_ResourceLocator_resize_directives(xds_core_v3_ResourceLocator * msg,size_t len,upb_arena * arena)101 UPB_INLINE xds_core_v3_ResourceLocator_Directive** xds_core_v3_ResourceLocator_resize_directives(xds_core_v3_ResourceLocator *msg, size_t len, upb_arena *arena) {
102 return (xds_core_v3_ResourceLocator_Directive**)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
103 }
xds_core_v3_ResourceLocator_add_directives(xds_core_v3_ResourceLocator * msg,upb_arena * arena)104 UPB_INLINE struct xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_add_directives(xds_core_v3_ResourceLocator *msg, upb_arena *arena) {
105 struct xds_core_v3_ResourceLocator_Directive* sub = (struct xds_core_v3_ResourceLocator_Directive*)_upb_msg_new(&xds_core_v3_ResourceLocator_Directive_msginit, arena);
106 bool ok = _upb_array_append_accessor2(
107 msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
108 if (!ok) return NULL;
109 return sub;
110 }
111
112 /* xds.core.v3.ResourceLocator.Directive */
113
xds_core_v3_ResourceLocator_Directive_new(upb_arena * arena)114 UPB_INLINE xds_core_v3_ResourceLocator_Directive *xds_core_v3_ResourceLocator_Directive_new(upb_arena *arena) {
115 return (xds_core_v3_ResourceLocator_Directive *)_upb_msg_new(&xds_core_v3_ResourceLocator_Directive_msginit, arena);
116 }
xds_core_v3_ResourceLocator_Directive_parse(const char * buf,size_t size,upb_arena * arena)117 UPB_INLINE xds_core_v3_ResourceLocator_Directive *xds_core_v3_ResourceLocator_Directive_parse(const char *buf, size_t size,
118 upb_arena *arena) {
119 xds_core_v3_ResourceLocator_Directive *ret = xds_core_v3_ResourceLocator_Directive_new(arena);
120 return (ret && upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, arena)) ? ret : NULL;
121 }
xds_core_v3_ResourceLocator_Directive_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)122 UPB_INLINE xds_core_v3_ResourceLocator_Directive *xds_core_v3_ResourceLocator_Directive_parse_ex(const char *buf, size_t size,
123 upb_arena *arena, int options) {
124 xds_core_v3_ResourceLocator_Directive *ret = xds_core_v3_ResourceLocator_Directive_new(arena);
125 return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, arena, options))
126 ? ret : NULL;
127 }
xds_core_v3_ResourceLocator_Directive_serialize(const xds_core_v3_ResourceLocator_Directive * msg,upb_arena * arena,size_t * len)128 UPB_INLINE char *xds_core_v3_ResourceLocator_Directive_serialize(const xds_core_v3_ResourceLocator_Directive *msg, upb_arena *arena, size_t *len) {
129 return upb_encode(msg, &xds_core_v3_ResourceLocator_Directive_msginit, arena, len);
130 }
131
132 typedef enum {
133 xds_core_v3_ResourceLocator_Directive_directive_alt = 1,
134 xds_core_v3_ResourceLocator_Directive_directive_entry = 2,
135 xds_core_v3_ResourceLocator_Directive_directive_NOT_SET = 0
136 } xds_core_v3_ResourceLocator_Directive_directive_oneofcases;
xds_core_v3_ResourceLocator_Directive_directive_case(const xds_core_v3_ResourceLocator_Directive * msg)137 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(8, 16), int32_t); }
138
xds_core_v3_ResourceLocator_Directive_has_alt(const xds_core_v3_ResourceLocator_Directive * msg)139 UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_alt(const xds_core_v3_ResourceLocator_Directive *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
xds_core_v3_ResourceLocator_Directive_alt(const xds_core_v3_ResourceLocator_Directive * msg)140 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(0, 0), UPB_SIZE(8, 16), 1, NULL); }
xds_core_v3_ResourceLocator_Directive_has_entry(const xds_core_v3_ResourceLocator_Directive * msg)141 UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_entry(const xds_core_v3_ResourceLocator_Directive *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
xds_core_v3_ResourceLocator_Directive_entry(const xds_core_v3_ResourceLocator_Directive * msg)142 UPB_INLINE upb_strview xds_core_v3_ResourceLocator_Directive_entry(const xds_core_v3_ResourceLocator_Directive *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, upb_strview_make("", strlen(""))); }
143
xds_core_v3_ResourceLocator_Directive_set_alt(xds_core_v3_ResourceLocator_Directive * msg,xds_core_v3_ResourceLocator * value)144 UPB_INLINE void xds_core_v3_ResourceLocator_Directive_set_alt(xds_core_v3_ResourceLocator_Directive *msg, xds_core_v3_ResourceLocator* value) {
145 UPB_WRITE_ONEOF(msg, xds_core_v3_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
146 }
xds_core_v3_ResourceLocator_Directive_mutable_alt(xds_core_v3_ResourceLocator_Directive * msg,upb_arena * arena)147 UPB_INLINE struct xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_Directive_mutable_alt(xds_core_v3_ResourceLocator_Directive *msg, upb_arena *arena) {
148 struct xds_core_v3_ResourceLocator* sub = (struct xds_core_v3_ResourceLocator*)xds_core_v3_ResourceLocator_Directive_alt(msg);
149 if (sub == NULL) {
150 sub = (struct xds_core_v3_ResourceLocator*)_upb_msg_new(&xds_core_v3_ResourceLocator_msginit, arena);
151 if (!sub) return NULL;
152 xds_core_v3_ResourceLocator_Directive_set_alt(msg, sub);
153 }
154 return sub;
155 }
xds_core_v3_ResourceLocator_Directive_set_entry(xds_core_v3_ResourceLocator_Directive * msg,upb_strview value)156 UPB_INLINE void xds_core_v3_ResourceLocator_Directive_set_entry(xds_core_v3_ResourceLocator_Directive *msg, upb_strview value) {
157 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
158 }
159
160 #ifdef __cplusplus
161 } /* extern "C" */
162 #endif
163
164 #include "upb/port_undef.inc"
165
166 #endif /* XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_ */
167