1 /* This file was generated by upbc (the upb compiler) from the input
2  * file:
3  *
4  *     src/proto/grpc/gcp/altscontext.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_
10 #define SRC_PROTO_GRPC_GCP_ALTSCONTEXT_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 grpc_gcp_AltsContext grpc_gcp_AltsContext;
29 typedef struct grpc_gcp_AltsContext_PeerAttributesEntry grpc_gcp_AltsContext_PeerAttributesEntry;
30 extern const upb_MiniTable grpc_gcp_AltsContext_msg_init;
31 extern const upb_MiniTable grpc_gcp_AltsContext_PeerAttributesEntry_msg_init;
32 struct grpc_gcp_RpcProtocolVersions;
33 extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_msg_init;
34 
35 
36 
37 /* grpc.gcp.AltsContext */
38 
grpc_gcp_AltsContext_new(upb_Arena * arena)39 UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_new(upb_Arena* arena) {
40   return (grpc_gcp_AltsContext*)_upb_Message_New(&grpc_gcp_AltsContext_msg_init, arena);
41 }
grpc_gcp_AltsContext_parse(const char * buf,size_t size,upb_Arena * arena)42 UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_parse(const char* buf, size_t size, upb_Arena* arena) {
43   grpc_gcp_AltsContext* ret = grpc_gcp_AltsContext_new(arena);
44   if (!ret) return NULL;
45   if (upb_Decode(buf, size, ret, &grpc_gcp_AltsContext_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
46     return NULL;
47   }
48   return ret;
49 }
grpc_gcp_AltsContext_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)50 UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_parse_ex(const char* buf, size_t size,
51                            const upb_ExtensionRegistry* extreg,
52                            int options, upb_Arena* arena) {
53   grpc_gcp_AltsContext* ret = grpc_gcp_AltsContext_new(arena);
54   if (!ret) return NULL;
55   if (upb_Decode(buf, size, ret, &grpc_gcp_AltsContext_msg_init, extreg, options, arena) !=
56       kUpb_DecodeStatus_Ok) {
57     return NULL;
58   }
59   return ret;
60 }
grpc_gcp_AltsContext_serialize(const grpc_gcp_AltsContext * msg,upb_Arena * arena,size_t * len)61 UPB_INLINE char* grpc_gcp_AltsContext_serialize(const grpc_gcp_AltsContext* msg, upb_Arena* arena, size_t* len) {
62   char* ptr;
63   (void)upb_Encode(msg, &grpc_gcp_AltsContext_msg_init, 0, arena, &ptr, len);
64   return ptr;
65 }
grpc_gcp_AltsContext_serialize_ex(const grpc_gcp_AltsContext * msg,int options,upb_Arena * arena,size_t * len)66 UPB_INLINE char* grpc_gcp_AltsContext_serialize_ex(const grpc_gcp_AltsContext* msg, int options,
67                                  upb_Arena* arena, size_t* len) {
68   char* ptr;
69   (void)upb_Encode(msg, &grpc_gcp_AltsContext_msg_init, options, arena, &ptr, len);
70   return ptr;
71 }
grpc_gcp_AltsContext_clear_application_protocol(grpc_gcp_AltsContext * msg)72 UPB_INLINE void grpc_gcp_AltsContext_clear_application_protocol(grpc_gcp_AltsContext* msg) {
73   const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
74   _upb_Message_ClearNonExtensionField(msg, &field);
75 }
grpc_gcp_AltsContext_application_protocol(const grpc_gcp_AltsContext * msg)76 UPB_INLINE upb_StringView grpc_gcp_AltsContext_application_protocol(const grpc_gcp_AltsContext* msg) {
77   upb_StringView default_val = upb_StringView_FromString("");
78   upb_StringView ret;
79   const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
80   _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
81   return ret;
82 }
grpc_gcp_AltsContext_clear_record_protocol(grpc_gcp_AltsContext * msg)83 UPB_INLINE void grpc_gcp_AltsContext_clear_record_protocol(grpc_gcp_AltsContext* msg) {
84   const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
85   _upb_Message_ClearNonExtensionField(msg, &field);
86 }
grpc_gcp_AltsContext_record_protocol(const grpc_gcp_AltsContext * msg)87 UPB_INLINE upb_StringView grpc_gcp_AltsContext_record_protocol(const grpc_gcp_AltsContext* msg) {
88   upb_StringView default_val = upb_StringView_FromString("");
89   upb_StringView ret;
90   const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
91   _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
92   return ret;
93 }
grpc_gcp_AltsContext_clear_security_level(grpc_gcp_AltsContext * msg)94 UPB_INLINE void grpc_gcp_AltsContext_clear_security_level(grpc_gcp_AltsContext* msg) {
95   const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
96   _upb_Message_ClearNonExtensionField(msg, &field);
97 }
grpc_gcp_AltsContext_security_level(const grpc_gcp_AltsContext * msg)98 UPB_INLINE int32_t grpc_gcp_AltsContext_security_level(const grpc_gcp_AltsContext* msg) {
99   int32_t default_val = 0;
100   int32_t ret;
101   const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
102   _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
103   return ret;
104 }
grpc_gcp_AltsContext_clear_peer_service_account(grpc_gcp_AltsContext * msg)105 UPB_INLINE void grpc_gcp_AltsContext_clear_peer_service_account(grpc_gcp_AltsContext* msg) {
106   const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
107   _upb_Message_ClearNonExtensionField(msg, &field);
108 }
grpc_gcp_AltsContext_peer_service_account(const grpc_gcp_AltsContext * msg)109 UPB_INLINE upb_StringView grpc_gcp_AltsContext_peer_service_account(const grpc_gcp_AltsContext* msg) {
110   upb_StringView default_val = upb_StringView_FromString("");
111   upb_StringView ret;
112   const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
113   _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
114   return ret;
115 }
grpc_gcp_AltsContext_clear_local_service_account(grpc_gcp_AltsContext * msg)116 UPB_INLINE void grpc_gcp_AltsContext_clear_local_service_account(grpc_gcp_AltsContext* msg) {
117   const upb_MiniTableField field = {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
118   _upb_Message_ClearNonExtensionField(msg, &field);
119 }
grpc_gcp_AltsContext_local_service_account(const grpc_gcp_AltsContext * msg)120 UPB_INLINE upb_StringView grpc_gcp_AltsContext_local_service_account(const grpc_gcp_AltsContext* msg) {
121   upb_StringView default_val = upb_StringView_FromString("");
122   upb_StringView ret;
123   const upb_MiniTableField field = {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
124   _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
125   return ret;
126 }
grpc_gcp_AltsContext_clear_peer_rpc_versions(grpc_gcp_AltsContext * msg)127 UPB_INLINE void grpc_gcp_AltsContext_clear_peer_rpc_versions(grpc_gcp_AltsContext* msg) {
128   const upb_MiniTableField field = {6, UPB_SIZE(8, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
129   _upb_Message_ClearNonExtensionField(msg, &field);
130 }
grpc_gcp_AltsContext_peer_rpc_versions(const grpc_gcp_AltsContext * msg)131 UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_AltsContext_peer_rpc_versions(const grpc_gcp_AltsContext* msg) {
132   const struct grpc_gcp_RpcProtocolVersions* default_val = NULL;
133   const struct grpc_gcp_RpcProtocolVersions* ret;
134   const upb_MiniTableField field = {6, UPB_SIZE(8, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
135   _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
136   return ret;
137 }
grpc_gcp_AltsContext_has_peer_rpc_versions(const grpc_gcp_AltsContext * msg)138 UPB_INLINE bool grpc_gcp_AltsContext_has_peer_rpc_versions(const grpc_gcp_AltsContext* msg) {
139   const upb_MiniTableField field = {6, UPB_SIZE(8, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
140   return _upb_Message_HasNonExtensionField(msg, &field);
141 }
grpc_gcp_AltsContext_clear_peer_attributes(grpc_gcp_AltsContext * msg)142 UPB_INLINE void grpc_gcp_AltsContext_clear_peer_attributes(grpc_gcp_AltsContext* msg) {
143   const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
144   _upb_Message_ClearNonExtensionField(msg, &field);
145 }
grpc_gcp_AltsContext_peer_attributes_size(const grpc_gcp_AltsContext * msg)146 UPB_INLINE size_t grpc_gcp_AltsContext_peer_attributes_size(const grpc_gcp_AltsContext* msg) {
147   const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
148   const upb_Map* map = upb_Message_GetMap(msg, &field);
149   return map ? _upb_Map_Size(map) : 0;
150 }
grpc_gcp_AltsContext_peer_attributes_get(const grpc_gcp_AltsContext * msg,upb_StringView key,upb_StringView * val)151 UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_get(const grpc_gcp_AltsContext* msg, upb_StringView key, upb_StringView* val) {
152   const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
153   const upb_Map* map = upb_Message_GetMap(msg, &field);
154   if (!map) return false;
155   return _upb_Map_Get(map, &key, 0, val, 0);
156 }
grpc_gcp_AltsContext_peer_attributes_next(const grpc_gcp_AltsContext * msg,size_t * iter)157 UPB_INLINE const grpc_gcp_AltsContext_PeerAttributesEntry* grpc_gcp_AltsContext_peer_attributes_next(const grpc_gcp_AltsContext* msg, size_t* iter) {
158   const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
159   const upb_Map* map = upb_Message_GetMap(msg, &field);
160   if (!map) return NULL;
161   return (const grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_map_next(map, iter);
162 }
163 
grpc_gcp_AltsContext_set_application_protocol(grpc_gcp_AltsContext * msg,upb_StringView value)164 UPB_INLINE void grpc_gcp_AltsContext_set_application_protocol(grpc_gcp_AltsContext *msg, upb_StringView value) {
165   const upb_MiniTableField field = {1, UPB_SIZE(16, 8), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
166   _upb_Message_SetNonExtensionField(msg, &field, &value);
167 }
grpc_gcp_AltsContext_set_record_protocol(grpc_gcp_AltsContext * msg,upb_StringView value)168 UPB_INLINE void grpc_gcp_AltsContext_set_record_protocol(grpc_gcp_AltsContext *msg, upb_StringView value) {
169   const upb_MiniTableField field = {2, 24, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
170   _upb_Message_SetNonExtensionField(msg, &field, &value);
171 }
grpc_gcp_AltsContext_set_security_level(grpc_gcp_AltsContext * msg,int32_t value)172 UPB_INLINE void grpc_gcp_AltsContext_set_security_level(grpc_gcp_AltsContext *msg, int32_t value) {
173   const upb_MiniTableField field = {3, 4, 0, kUpb_NoSub, 5, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsAlternate | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
174   _upb_Message_SetNonExtensionField(msg, &field, &value);
175 }
grpc_gcp_AltsContext_set_peer_service_account(grpc_gcp_AltsContext * msg,upb_StringView value)176 UPB_INLINE void grpc_gcp_AltsContext_set_peer_service_account(grpc_gcp_AltsContext *msg, upb_StringView value) {
177   const upb_MiniTableField field = {4, UPB_SIZE(32, 40), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
178   _upb_Message_SetNonExtensionField(msg, &field, &value);
179 }
grpc_gcp_AltsContext_set_local_service_account(grpc_gcp_AltsContext * msg,upb_StringView value)180 UPB_INLINE void grpc_gcp_AltsContext_set_local_service_account(grpc_gcp_AltsContext *msg, upb_StringView value) {
181   const upb_MiniTableField field = {5, UPB_SIZE(40, 56), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
182   _upb_Message_SetNonExtensionField(msg, &field, &value);
183 }
grpc_gcp_AltsContext_set_peer_rpc_versions(grpc_gcp_AltsContext * msg,struct grpc_gcp_RpcProtocolVersions * value)184 UPB_INLINE void grpc_gcp_AltsContext_set_peer_rpc_versions(grpc_gcp_AltsContext *msg, struct grpc_gcp_RpcProtocolVersions* value) {
185   const upb_MiniTableField field = {6, UPB_SIZE(8, 72), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
186   _upb_Message_SetNonExtensionField(msg, &field, &value);
187 }
grpc_gcp_AltsContext_mutable_peer_rpc_versions(grpc_gcp_AltsContext * msg,upb_Arena * arena)188 UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_AltsContext_mutable_peer_rpc_versions(grpc_gcp_AltsContext* msg, upb_Arena* arena) {
189   struct grpc_gcp_RpcProtocolVersions* sub = (struct grpc_gcp_RpcProtocolVersions*)grpc_gcp_AltsContext_peer_rpc_versions(msg);
190   if (sub == NULL) {
191     sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msg_init, arena);
192     if (sub) grpc_gcp_AltsContext_set_peer_rpc_versions(msg, sub);
193   }
194   return sub;
195 }
grpc_gcp_AltsContext_peer_attributes_clear(grpc_gcp_AltsContext * msg)196 UPB_INLINE void grpc_gcp_AltsContext_peer_attributes_clear(grpc_gcp_AltsContext* msg) {
197   const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
198   upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field);
199   if (!map) return;
200   _upb_Map_Clear(map);
201 }
grpc_gcp_AltsContext_peer_attributes_set(grpc_gcp_AltsContext * msg,upb_StringView key,upb_StringView val,upb_Arena * a)202 UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_set(grpc_gcp_AltsContext* msg, upb_StringView key, upb_StringView val, upb_Arena* a) {
203   const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
204   upb_Map* map = _upb_Message_GetOrCreateMutableMap(msg, &field, 0, 0, a);
205   return _upb_Map_Insert(map, &key, 0, &val, 0, a) !=
206          kUpb_MapInsertStatus_OutOfMemory;
207 }
grpc_gcp_AltsContext_peer_attributes_delete(grpc_gcp_AltsContext * msg,upb_StringView key)208 UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_delete(grpc_gcp_AltsContext* msg, upb_StringView key) {
209   const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
210   upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field);
211   if (!map) return false;
212   return _upb_Map_Delete(map, &key, 0, NULL);
213 }
grpc_gcp_AltsContext_peer_attributes_nextmutable(grpc_gcp_AltsContext * msg,size_t * iter)214 UPB_INLINE grpc_gcp_AltsContext_PeerAttributesEntry* grpc_gcp_AltsContext_peer_attributes_nextmutable(grpc_gcp_AltsContext* msg, size_t* iter) {
215   const upb_MiniTableField field = {7, UPB_SIZE(12, 80), 0, 1, 11, kUpb_FieldMode_Map | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
216   upb_Map* map = (upb_Map*)upb_Message_GetMap(msg, &field);
217   if (!map) return NULL;
218   return (grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_map_next(map, iter);
219 }
220 
221 /* grpc.gcp.AltsContext.PeerAttributesEntry */
222 
grpc_gcp_AltsContext_PeerAttributesEntry_key(const grpc_gcp_AltsContext_PeerAttributesEntry * msg)223 UPB_INLINE upb_StringView grpc_gcp_AltsContext_PeerAttributesEntry_key(const grpc_gcp_AltsContext_PeerAttributesEntry* msg) {
224   upb_StringView ret;
225   _upb_msg_map_key(msg, &ret, 0);
226   return ret;
227 }
grpc_gcp_AltsContext_PeerAttributesEntry_value(const grpc_gcp_AltsContext_PeerAttributesEntry * msg)228 UPB_INLINE upb_StringView grpc_gcp_AltsContext_PeerAttributesEntry_value(const grpc_gcp_AltsContext_PeerAttributesEntry* msg) {
229   upb_StringView ret;
230   _upb_msg_map_value(msg, &ret, 0);
231   return ret;
232 }
233 
grpc_gcp_AltsContext_PeerAttributesEntry_set_value(grpc_gcp_AltsContext_PeerAttributesEntry * msg,upb_StringView value)234 UPB_INLINE void grpc_gcp_AltsContext_PeerAttributesEntry_set_value(grpc_gcp_AltsContext_PeerAttributesEntry *msg, upb_StringView value) {
235   _upb_msg_map_set_value(msg, &value, 0);
236 }
237 
238 extern const upb_MiniTableFile src_proto_grpc_gcp_altscontext_proto_upb_file_layout;
239 
240 #ifdef __cplusplus
241 }  /* extern "C" */
242 #endif
243 
244 #include "upb/port/undef.inc"
245 
246 #endif  /* SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ */
247