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