GRPC C++
1.39.1
|
#include <grpc/support/port_platform.h>
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h"
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h"
Go to the source code of this file.
Data Structures | |
struct | alts_grpc_record_protocol_vtable |
this file contains alts_grpc_record_protocol internals and internal-only helper functions. More... | |
struct | alts_grpc_record_protocol |
Functions | |
void | alts_grpc_record_protocol_convert_slice_buffer_to_iovec (alts_grpc_record_protocol *rp, const grpc_slice_buffer *sb) |
Converts the slices of input sb into iovec_t's and puts the result into rp->iovec_buf. More... | |
void | alts_grpc_record_protocol_copy_slice_buffer (const grpc_slice_buffer *src, unsigned char *dst) |
Copies bytes from slice buffer to destination buffer. More... | |
iovec_t | alts_grpc_record_protocol_get_header_iovec (alts_grpc_record_protocol *rp) |
This method returns an iovec object pointing to the frame header stored in rp->header_sb. More... | |
tsi_result | alts_grpc_record_protocol_init (alts_grpc_record_protocol *rp, gsec_aead_crypter *crypter, size_t overflow_size, bool is_client, bool is_integrity_only, bool is_protect) |
Initializes an alts_grpc_record_protocol object, given a gsec_aead_crypter instance, the overflow size of the counter in bytes, a flag indicating if the object is used for client or server side, a flag indicating if it is used for integrity-only or privacy-integrity mode, and a flag indicating if it is for protect or unprotect. More... | |
void alts_grpc_record_protocol_convert_slice_buffer_to_iovec | ( | alts_grpc_record_protocol * | rp, |
const grpc_slice_buffer * | sb | ||
) |
Converts the slices of input sb into iovec_t's and puts the result into rp->iovec_buf.
Note that the actual data are not copied, only pointers and lengths are copied.
void alts_grpc_record_protocol_copy_slice_buffer | ( | const grpc_slice_buffer * | src, |
unsigned char * | dst | ||
) |
Copies bytes from slice buffer to destination buffer.
Caller is responsible for allocating enough memory of destination buffer. This method is used for copying frame header and tag in case they are stored in multiple slices.
iovec_t alts_grpc_record_protocol_get_header_iovec | ( | alts_grpc_record_protocol * | rp | ) |
This method returns an iovec object pointing to the frame header stored in rp->header_sb.
If the frame header is stored in multiple slices, this method will copy the bytes in rp->header_sb to rp->header_buf, and return an iovec object pointing to rp->header_buf.
tsi_result alts_grpc_record_protocol_init | ( | alts_grpc_record_protocol * | rp, |
gsec_aead_crypter * | crypter, | ||
size_t | overflow_size, | ||
bool | is_client, | ||
bool | is_integrity_only, | ||
bool | is_protect | ||
) |
Initializes an alts_grpc_record_protocol object, given a gsec_aead_crypter instance, the overflow size of the counter in bytes, a flag indicating if the object is used for client or server side, a flag indicating if it is used for integrity-only or privacy-integrity mode, and a flag indicating if it is for protect or unprotect.
The ownership of gsec_aead_crypter object is transferred to the alts_grpc_record_protocol object.