1 /* This file was generated by upbc (the upb compiler) from the input
2  * file:
3  *
4  *     src/proto/grpc/gcp/transport_security_common.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_
10 #define SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_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_RpcProtocolVersions;
24 struct grpc_gcp_RpcProtocolVersions_Version;
25 typedef struct grpc_gcp_RpcProtocolVersions grpc_gcp_RpcProtocolVersions;
26 typedef struct grpc_gcp_RpcProtocolVersions_Version grpc_gcp_RpcProtocolVersions_Version;
27 extern const upb_msglayout grpc_gcp_RpcProtocolVersions_msginit;
28 extern const upb_msglayout grpc_gcp_RpcProtocolVersions_Version_msginit;
29 
30 typedef enum {
31   grpc_gcp_SECURITY_NONE = 0,
32   grpc_gcp_INTEGRITY_ONLY = 1,
33   grpc_gcp_INTEGRITY_AND_PRIVACY = 2
34 } grpc_gcp_SecurityLevel;
35 
36 
37 /* grpc.gcp.RpcProtocolVersions */
38 
grpc_gcp_RpcProtocolVersions_new(upb_arena * arena)39 UPB_INLINE grpc_gcp_RpcProtocolVersions *grpc_gcp_RpcProtocolVersions_new(upb_arena *arena) {
40   return (grpc_gcp_RpcProtocolVersions *)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_msginit, arena);
41 }
grpc_gcp_RpcProtocolVersions_parse(const char * buf,size_t size,upb_arena * arena)42 UPB_INLINE grpc_gcp_RpcProtocolVersions *grpc_gcp_RpcProtocolVersions_parse(const char *buf, size_t size,
43                         upb_arena *arena) {
44   grpc_gcp_RpcProtocolVersions *ret = grpc_gcp_RpcProtocolVersions_new(arena);
45   return (ret && upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, arena)) ? ret : NULL;
46 }
grpc_gcp_RpcProtocolVersions_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)47 UPB_INLINE grpc_gcp_RpcProtocolVersions *grpc_gcp_RpcProtocolVersions_parse_ex(const char *buf, size_t size,
48                            upb_arena *arena, int options) {
49   grpc_gcp_RpcProtocolVersions *ret = grpc_gcp_RpcProtocolVersions_new(arena);
50   return (ret && _upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, arena, options))
51       ? ret : NULL;
52 }
grpc_gcp_RpcProtocolVersions_serialize(const grpc_gcp_RpcProtocolVersions * msg,upb_arena * arena,size_t * len)53 UPB_INLINE char *grpc_gcp_RpcProtocolVersions_serialize(const grpc_gcp_RpcProtocolVersions *msg, upb_arena *arena, size_t *len) {
54   return upb_encode(msg, &grpc_gcp_RpcProtocolVersions_msginit, arena, len);
55 }
56 
grpc_gcp_RpcProtocolVersions_has_max_rpc_version(const grpc_gcp_RpcProtocolVersions * msg)57 UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_max_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return _upb_hasbit(msg, 1); }
grpc_gcp_RpcProtocolVersions_max_rpc_version(const grpc_gcp_RpcProtocolVersions * msg)58 UPB_INLINE const grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_max_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const grpc_gcp_RpcProtocolVersions_Version*); }
grpc_gcp_RpcProtocolVersions_has_min_rpc_version(const grpc_gcp_RpcProtocolVersions * msg)59 UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_min_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return _upb_hasbit(msg, 2); }
grpc_gcp_RpcProtocolVersions_min_rpc_version(const grpc_gcp_RpcProtocolVersions * msg)60 UPB_INLINE const grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_min_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const grpc_gcp_RpcProtocolVersions_Version*); }
61 
grpc_gcp_RpcProtocolVersions_set_max_rpc_version(grpc_gcp_RpcProtocolVersions * msg,grpc_gcp_RpcProtocolVersions_Version * value)62 UPB_INLINE void grpc_gcp_RpcProtocolVersions_set_max_rpc_version(grpc_gcp_RpcProtocolVersions *msg, grpc_gcp_RpcProtocolVersions_Version* value) {
63   _upb_sethas(msg, 1);
64   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), grpc_gcp_RpcProtocolVersions_Version*) = value;
65 }
grpc_gcp_RpcProtocolVersions_mutable_max_rpc_version(grpc_gcp_RpcProtocolVersions * msg,upb_arena * arena)66 UPB_INLINE struct grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_mutable_max_rpc_version(grpc_gcp_RpcProtocolVersions *msg, upb_arena *arena) {
67   struct grpc_gcp_RpcProtocolVersions_Version* sub = (struct grpc_gcp_RpcProtocolVersions_Version*)grpc_gcp_RpcProtocolVersions_max_rpc_version(msg);
68   if (sub == NULL) {
69     sub = (struct grpc_gcp_RpcProtocolVersions_Version*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
70     if (!sub) return NULL;
71     grpc_gcp_RpcProtocolVersions_set_max_rpc_version(msg, sub);
72   }
73   return sub;
74 }
grpc_gcp_RpcProtocolVersions_set_min_rpc_version(grpc_gcp_RpcProtocolVersions * msg,grpc_gcp_RpcProtocolVersions_Version * value)75 UPB_INLINE void grpc_gcp_RpcProtocolVersions_set_min_rpc_version(grpc_gcp_RpcProtocolVersions *msg, grpc_gcp_RpcProtocolVersions_Version* value) {
76   _upb_sethas(msg, 2);
77   *UPB_PTR_AT(msg, UPB_SIZE(8, 16), grpc_gcp_RpcProtocolVersions_Version*) = value;
78 }
grpc_gcp_RpcProtocolVersions_mutable_min_rpc_version(grpc_gcp_RpcProtocolVersions * msg,upb_arena * arena)79 UPB_INLINE struct grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_mutable_min_rpc_version(grpc_gcp_RpcProtocolVersions *msg, upb_arena *arena) {
80   struct grpc_gcp_RpcProtocolVersions_Version* sub = (struct grpc_gcp_RpcProtocolVersions_Version*)grpc_gcp_RpcProtocolVersions_min_rpc_version(msg);
81   if (sub == NULL) {
82     sub = (struct grpc_gcp_RpcProtocolVersions_Version*)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
83     if (!sub) return NULL;
84     grpc_gcp_RpcProtocolVersions_set_min_rpc_version(msg, sub);
85   }
86   return sub;
87 }
88 
89 /* grpc.gcp.RpcProtocolVersions.Version */
90 
grpc_gcp_RpcProtocolVersions_Version_new(upb_arena * arena)91 UPB_INLINE grpc_gcp_RpcProtocolVersions_Version *grpc_gcp_RpcProtocolVersions_Version_new(upb_arena *arena) {
92   return (grpc_gcp_RpcProtocolVersions_Version *)_upb_msg_new(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
93 }
grpc_gcp_RpcProtocolVersions_Version_parse(const char * buf,size_t size,upb_arena * arena)94 UPB_INLINE grpc_gcp_RpcProtocolVersions_Version *grpc_gcp_RpcProtocolVersions_Version_parse(const char *buf, size_t size,
95                         upb_arena *arena) {
96   grpc_gcp_RpcProtocolVersions_Version *ret = grpc_gcp_RpcProtocolVersions_Version_new(arena);
97   return (ret && upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena)) ? ret : NULL;
98 }
grpc_gcp_RpcProtocolVersions_Version_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)99 UPB_INLINE grpc_gcp_RpcProtocolVersions_Version *grpc_gcp_RpcProtocolVersions_Version_parse_ex(const char *buf, size_t size,
100                            upb_arena *arena, int options) {
101   grpc_gcp_RpcProtocolVersions_Version *ret = grpc_gcp_RpcProtocolVersions_Version_new(arena);
102   return (ret && _upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena, options))
103       ? ret : NULL;
104 }
grpc_gcp_RpcProtocolVersions_Version_serialize(const grpc_gcp_RpcProtocolVersions_Version * msg,upb_arena * arena,size_t * len)105 UPB_INLINE char *grpc_gcp_RpcProtocolVersions_Version_serialize(const grpc_gcp_RpcProtocolVersions_Version *msg, upb_arena *arena, size_t *len) {
106   return upb_encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena, len);
107 }
108 
grpc_gcp_RpcProtocolVersions_Version_major(const grpc_gcp_RpcProtocolVersions_Version * msg)109 UPB_INLINE uint32_t grpc_gcp_RpcProtocolVersions_Version_major(const grpc_gcp_RpcProtocolVersions_Version *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
grpc_gcp_RpcProtocolVersions_Version_minor(const grpc_gcp_RpcProtocolVersions_Version * msg)110 UPB_INLINE uint32_t grpc_gcp_RpcProtocolVersions_Version_minor(const grpc_gcp_RpcProtocolVersions_Version *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
111 
grpc_gcp_RpcProtocolVersions_Version_set_major(grpc_gcp_RpcProtocolVersions_Version * msg,uint32_t value)112 UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_set_major(grpc_gcp_RpcProtocolVersions_Version *msg, uint32_t value) {
113   *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
114 }
grpc_gcp_RpcProtocolVersions_Version_set_minor(grpc_gcp_RpcProtocolVersions_Version * msg,uint32_t value)115 UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_set_minor(grpc_gcp_RpcProtocolVersions_Version *msg, uint32_t value) {
116   *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
117 }
118 
119 #ifdef __cplusplus
120 }  /* extern "C" */
121 #endif
122 
123 #include "upb/port_undef.inc"
124 
125 #endif  /* SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_ */
126