transport_security_grpc.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2017 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_TRANSPORT_SECURITY_GRPC_H
20 #define GRPC_CORE_TSI_TRANSPORT_SECURITY_GRPC_H
21 
23 
24 #include <grpc/slice_buffer.h>
25 
27 
28 /* This method creates a tsi_zero_copy_grpc_protector object. It return TSI_OK
29  assuming there is no fatal error.
30  The caller is responsible for destroying the protector. */
32  const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
33  tsi_zero_copy_grpc_protector** protector);
34 
35 /* -- tsi_zero_copy_grpc_protector object -- */
36 
37 /* Outputs protected frames.
38  - unprotected_slices is the unprotected data to be protected.
39  - protected_slices is the protected output frames. One or more frames
40  may be produced in this protect function.
41  - This method returns TSI_OK in case of success or a specific error code in
42  case of failure. */
44  tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* unprotected_slices,
45  grpc_slice_buffer* protected_slices);
46 
47 /* Outputs unprotected bytes.
48  - protected_slices is the bytes of protected frames.
49  - unprotected_slices is the unprotected output data.
50  - if min_progress_size is not null, it returns the size of the last
51  incomplete frame which could not be fully unprotected.
52  - This method returns TSI_OK in case of success. Success includes cases where
53  there is not enough data to output in which case unprotected_slices has 0
54  bytes. */
56  tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* protected_slices,
57  grpc_slice_buffer* unprotected_slices, int* min_progress_size);
58 
59 /* Destroys the tsi_zero_copy_grpc_protector object. */
61 
62 /* Returns value of max protected frame size. Useful for testing. */
64  tsi_zero_copy_grpc_protector* self, size_t* max_frame_size);
65 
66 /* Base for tsi_zero_copy_grpc_protector implementations. */
69  grpc_slice_buffer* unprotected_slices,
70  grpc_slice_buffer* protected_slices);
72  grpc_slice_buffer* protected_slices,
73  grpc_slice_buffer* unprotected_slices,
74  int* min_progress_size);
77  size_t* max_frame_size);
78 };
81 };
82 
83 #endif /* GRPC_CORE_TSI_TRANSPORT_SECURITY_GRPC_H */
tsi_zero_copy_grpc_protector::vtable
const tsi_zero_copy_grpc_protector_vtable * vtable
Definition: transport_security_grpc.h:80
tsi_zero_copy_grpc_protector_vtable::unprotect
tsi_result(* unprotect)(tsi_zero_copy_grpc_protector *self, grpc_slice_buffer *protected_slices, grpc_slice_buffer *unprotected_slices, int *min_progress_size)
Definition: transport_security_grpc.h:71
tsi_zero_copy_grpc_protector_protect
tsi_result tsi_zero_copy_grpc_protector_protect(tsi_zero_copy_grpc_protector *self, grpc_slice_buffer *unprotected_slices, grpc_slice_buffer *protected_slices)
Definition: transport_security_grpc.cc:41
tsi_zero_copy_grpc_protector_max_frame_size
tsi_result tsi_zero_copy_grpc_protector_max_frame_size(tsi_zero_copy_grpc_protector *self, size_t *max_frame_size)
Definition: transport_security_grpc.cc:69
tsi_handshaker_result_create_zero_copy_grpc_protector
tsi_result tsi_handshaker_result_create_zero_copy_grpc_protector(const tsi_handshaker_result *self, size_t *max_output_protected_frame_size, tsi_zero_copy_grpc_protector **protector)
Definition: transport_security_grpc.cc:24
tsi_result
tsi_result
Definition: transport_security_interface.h:31
slice_buffer.h
tsi_zero_copy_grpc_protector_vtable::destroy
void(* destroy)(tsi_zero_copy_grpc_protector *self)
Definition: transport_security_grpc.h:75
transport_security.h
tsi_zero_copy_grpc_protector_unprotect
tsi_result tsi_zero_copy_grpc_protector_unprotect(tsi_zero_copy_grpc_protector *self, grpc_slice_buffer *protected_slices, grpc_slice_buffer *unprotected_slices, int *min_progress_size)
Definition: transport_security_grpc.cc:52
tsi_zero_copy_grpc_protector_vtable
Definition: transport_security_grpc.h:67
tsi_handshaker_result
Definition: transport_security.h:121
tsi_zero_copy_grpc_protector_destroy
void tsi_zero_copy_grpc_protector_destroy(tsi_zero_copy_grpc_protector *self)
Definition: transport_security_grpc.cc:64
grpc_slice_buffer
Definition: include/grpc/impl/codegen/slice.h:83
tsi_zero_copy_grpc_protector
Definition: transport_security_grpc.h:79
tsi_zero_copy_grpc_protector_vtable::max_frame_size
tsi_result(* max_frame_size)(tsi_zero_copy_grpc_protector *self, size_t *max_frame_size)
Definition: transport_security_grpc.h:76
tsi_zero_copy_grpc_protector_vtable::protect
tsi_result(* protect)(tsi_zero_copy_grpc_protector *self, grpc_slice_buffer *unprotected_slices, grpc_slice_buffer *protected_slices)
Definition: transport_security_grpc.h:68
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:40