GRPC Core
18.0.0
|
#include <grpc/support/port_platform.h>
#include <grpc/slice_buffer.h>
#include "src/core/tsi/transport_security_interface.h"
Go to the source code of this file.
Typedefs | |
typedef struct alts_grpc_record_protocol | alts_grpc_record_protocol |
This alts_grpc_record_protocol object protects and unprotects a single frame stored in grpc slice buffer with zero or minimized memory copy. More... | |
Functions | |
tsi_result | alts_grpc_record_protocol_protect (alts_grpc_record_protocol *self, grpc_slice_buffer *unprotected_slices, grpc_slice_buffer *protected_slices) |
This methods performs protect operation on unprotected data and appends the protected frame to protected_slices. More... | |
tsi_result | alts_grpc_record_protocol_unprotect (alts_grpc_record_protocol *self, grpc_slice_buffer *protected_slices, grpc_slice_buffer *unprotected_slices) |
This methods performs unprotect operation on a full frame of protected data and appends unprotected data to unprotected_slices. More... | |
size_t | alts_grpc_record_protocol_max_unprotected_data_size (const alts_grpc_record_protocol *self, size_t max_protected_frame_size) |
This method returns maximum allowed unprotected data size, given maximum protected frame size. More... | |
void | alts_grpc_record_protocol_destroy (alts_grpc_record_protocol *self) |
This method destroys an alts_grpc_record_protocol instance by de-allocating all of its occupied memory. More... | |
typedef struct alts_grpc_record_protocol alts_grpc_record_protocol |
This alts_grpc_record_protocol object protects and unprotects a single frame stored in grpc slice buffer with zero or minimized memory copy.
Implementations of this object must be thread compatible.
void alts_grpc_record_protocol_destroy | ( | alts_grpc_record_protocol * | self | ) |
This method destroys an alts_grpc_record_protocol instance by de-allocating all of its occupied memory.
size_t alts_grpc_record_protocol_max_unprotected_data_size | ( | const alts_grpc_record_protocol * | self, |
size_t | max_protected_frame_size | ||
) |
This method returns maximum allowed unprotected data size, given maximum protected frame size.
On success, the method returns the maximum allowed unprotected data size. Otherwise, it returns zero.
tsi_result alts_grpc_record_protocol_protect | ( | alts_grpc_record_protocol * | self, |
grpc_slice_buffer * | unprotected_slices, | ||
grpc_slice_buffer * | protected_slices | ||
) |
This methods performs protect operation on unprotected data and appends the protected frame to protected_slices.
The caller needs to ensure the length of unprotected data plus the frame overhead is less than or equal to the maximum frame length. The input unprotected data slice buffer will be cleared, although the actual unprotected data bytes are not modified.
This method returns TSI_OK in case of success or a specific error code in case of failure.
tsi_result alts_grpc_record_protocol_unprotect | ( | alts_grpc_record_protocol * | self, |
grpc_slice_buffer * | protected_slices, | ||
grpc_slice_buffer * | unprotected_slices | ||
) |
This methods performs unprotect operation on a full frame of protected data and appends unprotected data to unprotected_slices.
It is the caller's responsibility to prepare a full frame of data before calling this method. The input protected frame slice buffer will be cleared, although the actual protected data bytes are not modified.
This method returns TSI_OK in case of success or a specific error code in case of failure.