GRPC Core  9.0.0
transport_security_common_api.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_CORE_TSI_ALTS_HANDSHAKER_TRANSPORT_SECURITY_COMMON_API_H
20 #define GRPC_CORE_TSI_ALTS_HANDSHAKER_TRANSPORT_SECURITY_COMMON_API_H
21 
23 
24 #include <grpc/slice.h>
25 #include <grpc/slice_buffer.h>
26 #include <grpc/support/alloc.h>
27 #include <grpc/support/log.h>
28 
30 
31 // C struct coresponding to protobuf message RpcProtocolVersions.Version
33  uint32_t major;
34  uint32_t minor;
36 
37 // C struct coresponding to protobuf message RpcProtocolVersions
42 
54  grpc_gcp_rpc_protocol_versions* versions, uint32_t max_major,
55  uint32_t max_minor);
56 
68  grpc_gcp_rpc_protocol_versions* versions, uint32_t min_major,
69  uint32_t min_minor);
70 
81  const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice);
82 
94  const grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena,
95  grpc_slice* slice);
96 
108  const grpc_slice& slice, grpc_gcp_rpc_protocol_versions* versions);
109 
115  const grpc_gcp_RpcProtocolVersions* value);
116 
122  grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena,
123  const grpc_gcp_rpc_protocol_versions* value);
124 
137 
151  const grpc_gcp_rpc_protocol_versions* local_versions,
152  const grpc_gcp_rpc_protocol_versions* peer_versions,
153  grpc_gcp_rpc_protocol_versions_version* highest_common_version);
154 
155 namespace grpc_core {
156 namespace internal {
157 
167 
168 } // namespace internal
169 } // namespace grpc_core
170 
171 #endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_TRANSPORT_SECURITY_COMMON_API_H */
int grpc_gcp_rpc_protocol_version_compare(const grpc_gcp_rpc_protocol_versions_version *v1, const grpc_gcp_rpc_protocol_versions_version *v2)
Exposed for testing only.
Definition: transport_security_common_api.cc:175
Round Robin Policy.
Definition: backend_metric.cc:24
Definition: transport_security_common_api.h:32
uint32_t major
Definition: transport_security_common_api.h:33
uint32_t minor
Definition: transport_security_common_api.h:34
Definition: transport_security_common_api.h:38
grpc_gcp_rpc_protocol_versions_version max_rpc_version
Definition: transport_security_common_api.h:39
grpc_gcp_rpc_protocol_versions_version min_rpc_version
Definition: transport_security_common_api.h:40
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice.h:60
struct grpc_gcp_RpcProtocolVersions grpc_gcp_RpcProtocolVersions
Definition: transport_security_common.upb.h:25
bool grpc_gcp_rpc_protocol_versions_set_max(grpc_gcp_rpc_protocol_versions *versions, uint32_t max_major, uint32_t max_minor)
This method sets the value for max_rpc_versions field of rpc protocol versions.
Definition: transport_security_common_api.cc:23
void grpc_gcp_RpcProtocolVersions_assign_from_struct(grpc_gcp_RpcProtocolVersions *versions, upb_arena *arena, const grpc_gcp_rpc_protocol_versions *value)
Assigns value of struct grpc_gcp_rpc_protocol_versions to RpcProtocolVersions.
Definition: transport_security_common_api.cc:135
bool grpc_gcp_rpc_protocol_versions_decode(const grpc_slice &slice, grpc_gcp_rpc_protocol_versions *versions)
This method de-serializes input in grpc slice form and stores the result in rpc protocol versions.
Definition: transport_security_common_api.cc:87
struct _grpc_gcp_RpcProtocolVersions_Version grpc_gcp_rpc_protocol_versions_version
bool grpc_gcp_rpc_protocol_versions_encode(const grpc_gcp_rpc_protocol_versions *versions, grpc_slice *slice)
This method serializes an rpc protocol version and returns serialized rpc versions in grpc slice.
Definition: transport_security_common_api.cc:51
bool grpc_gcp_rpc_protocol_versions_check(const grpc_gcp_rpc_protocol_versions *local_versions, const grpc_gcp_rpc_protocol_versions *peer_versions, grpc_gcp_rpc_protocol_versions_version *highest_common_version)
This method performs a version check between local and peer rpc protocol versions.
Definition: transport_security_common_api.cc:192
bool grpc_gcp_rpc_protocol_versions_copy(const grpc_gcp_rpc_protocol_versions *src, grpc_gcp_rpc_protocol_versions *dst)
This method performs a deep copy operation on rpc protocol versions instance.
Definition: transport_security_common_api.cc:152
struct _grpc_gcp_RpcProtocolVersions grpc_gcp_rpc_protocol_versions
bool grpc_gcp_rpc_protocol_versions_set_min(grpc_gcp_rpc_protocol_versions *versions, uint32_t min_major, uint32_t min_minor)
This method sets the value for min_rpc_versions field of rpc protocol versions.
Definition: transport_security_common_api.cc:37
void grpc_gcp_rpc_protocol_versions_assign_from_upb(grpc_gcp_rpc_protocol_versions *versions, const grpc_gcp_RpcProtocolVersions *value)
Assigns value of upb RpcProtocolVersions to grpc_gcp_rpc_protocol_versions.
Definition: transport_security_common_api.cc:108