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/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 grpc_gcp_AltsContext;
24 struct grpc_gcp_AltsContext_PeerAttributesEntry;
25 typedef struct grpc_gcp_AltsContext grpc_gcp_AltsContext;
26 typedef struct grpc_gcp_AltsContext_PeerAttributesEntry grpc_gcp_AltsContext_PeerAttributesEntry;
27 extern const upb_msglayout grpc_gcp_AltsContext_msginit;
28 extern const upb_msglayout grpc_gcp_AltsContext_PeerAttributesEntry_msginit;
29 struct grpc_gcp_RpcProtocolVersions;
30 extern const upb_msglayout grpc_gcp_RpcProtocolVersions_msginit;
31 
32 
33 /* grpc.gcp.AltsContext */
34 
grpc_gcp_AltsContext_new(upb_arena * arena)35 UPB_INLINE grpc_gcp_AltsContext *grpc_gcp_AltsContext_new(upb_arena *arena) {
36   return (grpc_gcp_AltsContext *)_upb_msg_new(&grpc_gcp_AltsContext_msginit, arena);
37 }
grpc_gcp_AltsContext_parse(const char * buf,size_t size,upb_arena * arena)38 UPB_INLINE grpc_gcp_AltsContext *grpc_gcp_AltsContext_parse(const char *buf, size_t size,
39                         upb_arena *arena) {
40   grpc_gcp_AltsContext *ret = grpc_gcp_AltsContext_new(arena);
41   return (ret && upb_decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, arena)) ? ret : NULL;
42 }
grpc_gcp_AltsContext_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)43 UPB_INLINE grpc_gcp_AltsContext *grpc_gcp_AltsContext_parse_ex(const char *buf, size_t size,
44                            upb_arena *arena, int options) {
45   grpc_gcp_AltsContext *ret = grpc_gcp_AltsContext_new(arena);
46   return (ret && _upb_decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, arena, options))
47       ? ret : NULL;
48 }
grpc_gcp_AltsContext_serialize(const grpc_gcp_AltsContext * msg,upb_arena * arena,size_t * len)49 UPB_INLINE char *grpc_gcp_AltsContext_serialize(const grpc_gcp_AltsContext *msg, upb_arena *arena, size_t *len) {
50   return upb_encode(msg, &grpc_gcp_AltsContext_msginit, arena, len);
51 }
52 
grpc_gcp_AltsContext_application_protocol(const grpc_gcp_AltsContext * msg)53 UPB_INLINE upb_strview grpc_gcp_AltsContext_application_protocol(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
grpc_gcp_AltsContext_record_protocol(const grpc_gcp_AltsContext * msg)54 UPB_INLINE upb_strview grpc_gcp_AltsContext_record_protocol(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
grpc_gcp_AltsContext_security_level(const grpc_gcp_AltsContext * msg)55 UPB_INLINE int32_t grpc_gcp_AltsContext_security_level(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
grpc_gcp_AltsContext_peer_service_account(const grpc_gcp_AltsContext * msg)56 UPB_INLINE upb_strview grpc_gcp_AltsContext_peer_service_account(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview); }
grpc_gcp_AltsContext_local_service_account(const grpc_gcp_AltsContext * msg)57 UPB_INLINE upb_strview grpc_gcp_AltsContext_local_service_account(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_strview); }
grpc_gcp_AltsContext_has_peer_rpc_versions(const grpc_gcp_AltsContext * msg)58 UPB_INLINE bool grpc_gcp_AltsContext_has_peer_rpc_versions(const grpc_gcp_AltsContext *msg) { return _upb_hasbit(msg, 1); }
grpc_gcp_AltsContext_peer_rpc_versions(const grpc_gcp_AltsContext * msg)59 UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_AltsContext_peer_rpc_versions(const grpc_gcp_AltsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct grpc_gcp_RpcProtocolVersions*); }
grpc_gcp_AltsContext_has_peer_attributes(const grpc_gcp_AltsContext * msg)60 UPB_INLINE bool grpc_gcp_AltsContext_has_peer_attributes(const grpc_gcp_AltsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
grpc_gcp_AltsContext_peer_attributes_size(const grpc_gcp_AltsContext * msg)61 UPB_INLINE size_t grpc_gcp_AltsContext_peer_attributes_size(const grpc_gcp_AltsContext *msg) {return _upb_msg_map_size(msg, UPB_SIZE(44, 80)); }
grpc_gcp_AltsContext_peer_attributes_get(const grpc_gcp_AltsContext * msg,upb_strview key,upb_strview * val)62 UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_get(const grpc_gcp_AltsContext *msg, upb_strview key, upb_strview *val) { return _upb_msg_map_get(msg, UPB_SIZE(44, 80), &key, 0, val, 0); }
grpc_gcp_AltsContext_peer_attributes_next(const grpc_gcp_AltsContext * msg,size_t * iter)63 UPB_INLINE const grpc_gcp_AltsContext_PeerAttributesEntry* grpc_gcp_AltsContext_peer_attributes_next(const grpc_gcp_AltsContext *msg, size_t* iter) { return (const grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 80), iter); }
64 
grpc_gcp_AltsContext_set_application_protocol(grpc_gcp_AltsContext * msg,upb_strview value)65 UPB_INLINE void grpc_gcp_AltsContext_set_application_protocol(grpc_gcp_AltsContext *msg, upb_strview value) {
66   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
67 }
grpc_gcp_AltsContext_set_record_protocol(grpc_gcp_AltsContext * msg,upb_strview value)68 UPB_INLINE void grpc_gcp_AltsContext_set_record_protocol(grpc_gcp_AltsContext *msg, upb_strview value) {
69   *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
70 }
grpc_gcp_AltsContext_set_security_level(grpc_gcp_AltsContext * msg,int32_t value)71 UPB_INLINE void grpc_gcp_AltsContext_set_security_level(grpc_gcp_AltsContext *msg, int32_t value) {
72   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
73 }
grpc_gcp_AltsContext_set_peer_service_account(grpc_gcp_AltsContext * msg,upb_strview value)74 UPB_INLINE void grpc_gcp_AltsContext_set_peer_service_account(grpc_gcp_AltsContext *msg, upb_strview value) {
75   *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview) = value;
76 }
grpc_gcp_AltsContext_set_local_service_account(grpc_gcp_AltsContext * msg,upb_strview value)77 UPB_INLINE void grpc_gcp_AltsContext_set_local_service_account(grpc_gcp_AltsContext *msg, upb_strview value) {
78   *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_strview) = value;
79 }
grpc_gcp_AltsContext_set_peer_rpc_versions(grpc_gcp_AltsContext * msg,struct grpc_gcp_RpcProtocolVersions * value)80 UPB_INLINE void grpc_gcp_AltsContext_set_peer_rpc_versions(grpc_gcp_AltsContext *msg, struct grpc_gcp_RpcProtocolVersions* value) {
81   _upb_sethas(msg, 1);
82   *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct grpc_gcp_RpcProtocolVersions*) = value;
83 }
grpc_gcp_AltsContext_mutable_peer_rpc_versions(grpc_gcp_AltsContext * msg,upb_arena * arena)84 UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_AltsContext_mutable_peer_rpc_versions(grpc_gcp_AltsContext *msg, upb_arena *arena) {
85   struct grpc_gcp_RpcProtocolVersions* sub = (struct grpc_gcp_RpcProtocolVersions*)grpc_gcp_AltsContext_peer_rpc_versions(msg);
86   if (sub == NULL) {
87     sub = (struct grpc_gcp_RpcProtocolVersions*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
88     if (!sub) return NULL;
89     grpc_gcp_AltsContext_set_peer_rpc_versions(msg, sub);
90   }
91   return sub;
92 }
grpc_gcp_AltsContext_peer_attributes_clear(grpc_gcp_AltsContext * msg)93 UPB_INLINE void grpc_gcp_AltsContext_peer_attributes_clear(grpc_gcp_AltsContext *msg) { _upb_msg_map_clear(msg, UPB_SIZE(44, 80)); }
grpc_gcp_AltsContext_peer_attributes_set(grpc_gcp_AltsContext * msg,upb_strview key,upb_strview val,upb_arena * a)94 UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_set(grpc_gcp_AltsContext *msg, upb_strview key, upb_strview val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(44, 80), &key, 0, &val, 0, a); }
grpc_gcp_AltsContext_peer_attributes_delete(grpc_gcp_AltsContext * msg,upb_strview key)95 UPB_INLINE bool grpc_gcp_AltsContext_peer_attributes_delete(grpc_gcp_AltsContext *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(44, 80), &key, 0); }
grpc_gcp_AltsContext_peer_attributes_nextmutable(grpc_gcp_AltsContext * msg,size_t * iter)96 UPB_INLINE grpc_gcp_AltsContext_PeerAttributesEntry* grpc_gcp_AltsContext_peer_attributes_nextmutable(grpc_gcp_AltsContext *msg, size_t* iter) { return (grpc_gcp_AltsContext_PeerAttributesEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 80), iter); }
97 
98 /* grpc.gcp.AltsContext.PeerAttributesEntry */
99 
grpc_gcp_AltsContext_PeerAttributesEntry_key(const grpc_gcp_AltsContext_PeerAttributesEntry * msg)100 UPB_INLINE upb_strview grpc_gcp_AltsContext_PeerAttributesEntry_key(const grpc_gcp_AltsContext_PeerAttributesEntry *msg) {
101   upb_strview ret;
102   _upb_msg_map_key(msg, &ret, 0);
103   return ret;
104 }
grpc_gcp_AltsContext_PeerAttributesEntry_value(const grpc_gcp_AltsContext_PeerAttributesEntry * msg)105 UPB_INLINE upb_strview grpc_gcp_AltsContext_PeerAttributesEntry_value(const grpc_gcp_AltsContext_PeerAttributesEntry *msg) {
106   upb_strview ret;
107   _upb_msg_map_value(msg, &ret, 0);
108   return ret;
109 }
110 
grpc_gcp_AltsContext_PeerAttributesEntry_set_value(grpc_gcp_AltsContext_PeerAttributesEntry * msg,upb_strview value)111 UPB_INLINE void grpc_gcp_AltsContext_PeerAttributesEntry_set_value(grpc_gcp_AltsContext_PeerAttributesEntry *msg, upb_strview value) {
112   _upb_msg_map_set_value(msg, &value, 0);
113 }
114 
115 #ifdef __cplusplus
116 }  /* extern "C" */
117 #endif
118 
119 #include "upb/port_undef.inc"
120 
121 #endif  /* SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ */
122