1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * xds/annotations/v3/security.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPB_H_
10 #define XDS_ANNOTATIONS_V3_SECURITY_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 xds_annotations_v3_FieldSecurityAnnotation xds_annotations_v3_FieldSecurityAnnotation;
29 extern const upb_MiniTable xds_annotations_v3_FieldSecurityAnnotation_msg_init;
30 extern const upb_MiniTableExtension xds_annotations_v3_security_ext;
31 struct google_protobuf_FieldOptions;
32 extern const upb_MiniTable google_protobuf_FieldOptions_msg_init;
33
34
35
36 /* xds.annotations.v3.FieldSecurityAnnotation */
37
xds_annotations_v3_FieldSecurityAnnotation_new(upb_Arena * arena)38 UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldSecurityAnnotation_new(upb_Arena* arena) {
39 return (xds_annotations_v3_FieldSecurityAnnotation*)_upb_Message_New(&xds_annotations_v3_FieldSecurityAnnotation_msg_init, arena);
40 }
xds_annotations_v3_FieldSecurityAnnotation_parse(const char * buf,size_t size,upb_Arena * arena)41 UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldSecurityAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
42 xds_annotations_v3_FieldSecurityAnnotation* ret = xds_annotations_v3_FieldSecurityAnnotation_new(arena);
43 if (!ret) return NULL;
44 if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldSecurityAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
45 return NULL;
46 }
47 return ret;
48 }
xds_annotations_v3_FieldSecurityAnnotation_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)49 UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldSecurityAnnotation_parse_ex(const char* buf, size_t size,
50 const upb_ExtensionRegistry* extreg,
51 int options, upb_Arena* arena) {
52 xds_annotations_v3_FieldSecurityAnnotation* ret = xds_annotations_v3_FieldSecurityAnnotation_new(arena);
53 if (!ret) return NULL;
54 if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldSecurityAnnotation_msg_init, extreg, options, arena) !=
55 kUpb_DecodeStatus_Ok) {
56 return NULL;
57 }
58 return ret;
59 }
xds_annotations_v3_FieldSecurityAnnotation_serialize(const xds_annotations_v3_FieldSecurityAnnotation * msg,upb_Arena * arena,size_t * len)60 UPB_INLINE char* xds_annotations_v3_FieldSecurityAnnotation_serialize(const xds_annotations_v3_FieldSecurityAnnotation* msg, upb_Arena* arena, size_t* len) {
61 char* ptr;
62 (void)upb_Encode(msg, &xds_annotations_v3_FieldSecurityAnnotation_msg_init, 0, arena, &ptr, len);
63 return ptr;
64 }
xds_annotations_v3_FieldSecurityAnnotation_serialize_ex(const xds_annotations_v3_FieldSecurityAnnotation * msg,int options,upb_Arena * arena,size_t * len)65 UPB_INLINE char* xds_annotations_v3_FieldSecurityAnnotation_serialize_ex(const xds_annotations_v3_FieldSecurityAnnotation* msg, int options,
66 upb_Arena* arena, size_t* len) {
67 char* ptr;
68 (void)upb_Encode(msg, &xds_annotations_v3_FieldSecurityAnnotation_msg_init, options, arena, &ptr, len);
69 return ptr;
70 }
xds_annotations_v3_FieldSecurityAnnotation_clear_configure_for_untrusted_downstream(xds_annotations_v3_FieldSecurityAnnotation * msg)71 UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_clear_configure_for_untrusted_downstream(xds_annotations_v3_FieldSecurityAnnotation* msg) {
72 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
73 _upb_Message_ClearNonExtensionField(msg, &field);
74 }
xds_annotations_v3_FieldSecurityAnnotation_configure_for_untrusted_downstream(const xds_annotations_v3_FieldSecurityAnnotation * msg)75 UPB_INLINE bool xds_annotations_v3_FieldSecurityAnnotation_configure_for_untrusted_downstream(const xds_annotations_v3_FieldSecurityAnnotation* msg) {
76 bool default_val = false;
77 bool ret;
78 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
79 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
80 return ret;
81 }
xds_annotations_v3_FieldSecurityAnnotation_clear_configure_for_untrusted_upstream(xds_annotations_v3_FieldSecurityAnnotation * msg)82 UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_clear_configure_for_untrusted_upstream(xds_annotations_v3_FieldSecurityAnnotation* msg) {
83 const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
84 _upb_Message_ClearNonExtensionField(msg, &field);
85 }
xds_annotations_v3_FieldSecurityAnnotation_configure_for_untrusted_upstream(const xds_annotations_v3_FieldSecurityAnnotation * msg)86 UPB_INLINE bool xds_annotations_v3_FieldSecurityAnnotation_configure_for_untrusted_upstream(const xds_annotations_v3_FieldSecurityAnnotation* msg) {
87 bool default_val = false;
88 bool ret;
89 const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
90 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
91 return ret;
92 }
93
xds_annotations_v3_FieldSecurityAnnotation_set_configure_for_untrusted_downstream(xds_annotations_v3_FieldSecurityAnnotation * msg,bool value)94 UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_set_configure_for_untrusted_downstream(xds_annotations_v3_FieldSecurityAnnotation *msg, bool value) {
95 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
96 _upb_Message_SetNonExtensionField(msg, &field, &value);
97 }
xds_annotations_v3_FieldSecurityAnnotation_set_configure_for_untrusted_upstream(xds_annotations_v3_FieldSecurityAnnotation * msg,bool value)98 UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_set_configure_for_untrusted_upstream(xds_annotations_v3_FieldSecurityAnnotation *msg, bool value) {
99 const upb_MiniTableField field = {2, 1, 0, kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
100 _upb_Message_SetNonExtensionField(msg, &field, &value);
101 }
102
xds_annotations_v3_has_security(const struct google_protobuf_FieldOptions * msg)103 UPB_INLINE bool xds_annotations_v3_has_security(const struct google_protobuf_FieldOptions* msg) {
104 return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_security_ext);
105 }
xds_annotations_v3_clear_security(struct google_protobuf_FieldOptions * msg)106 UPB_INLINE void xds_annotations_v3_clear_security(struct google_protobuf_FieldOptions* msg) {
107 _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_security_ext);
108 }
xds_annotations_v3_security(const struct google_protobuf_FieldOptions * msg)109 UPB_INLINE const xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_security(const struct google_protobuf_FieldOptions* msg) {
110 const upb_MiniTableExtension* ext = &xds_annotations_v3_security_ext;
111 UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field));
112 UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte);
113 const xds_annotations_v3_FieldSecurityAnnotation* default_val = NULL;
114 const xds_annotations_v3_FieldSecurityAnnotation* ret;
115 _upb_Message_GetExtensionField(msg, ext, &default_val, &ret);
116 return ret;
117 }
xds_annotations_v3_set_security(struct google_protobuf_FieldOptions * msg,const xds_annotations_v3_FieldSecurityAnnotation * val,upb_Arena * arena)118 UPB_INLINE void xds_annotations_v3_set_security(struct google_protobuf_FieldOptions* msg, const xds_annotations_v3_FieldSecurityAnnotation* val, upb_Arena* arena) {
119 const upb_MiniTableExtension* ext = &xds_annotations_v3_security_ext;
120 UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field));
121 UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte);
122 bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena);
123 UPB_ASSERT(ok);
124 }
125 extern const upb_MiniTableFile xds_annotations_v3_security_proto_upb_file_layout;
126
127 #ifdef __cplusplus
128 } /* extern "C" */
129 #endif
130
131 #include "upb/port/undef.inc"
132
133 #endif /* XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPB_H_ */
134