Classes | Functions
alts_grpc_record_protocol_common.h File Reference
#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"
Include dependency graph for alts_grpc_record_protocol_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  alts_grpc_record_protocol
 
struct  alts_grpc_record_protocol_vtable
 

Functions

void alts_grpc_record_protocol_convert_slice_buffer_to_iovec (alts_grpc_record_protocol *rp, const grpc_slice_buffer *sb)
 
void alts_grpc_record_protocol_copy_slice_buffer (const grpc_slice_buffer *src, unsigned char *dst)
 
iovec_t alts_grpc_record_protocol_get_header_iovec (alts_grpc_record_protocol *rp)
 
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)
 

Function Documentation

◆ alts_grpc_record_protocol_convert_slice_buffer_to_iovec()

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.

Definition at line 50 of file alts_grpc_record_protocol_common.cc.

◆ alts_grpc_record_protocol_copy_slice_buffer()

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.

Definition at line 60 of file alts_grpc_record_protocol_common.cc.

◆ alts_grpc_record_protocol_get_header_iovec()

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.

Definition at line 70 of file alts_grpc_record_protocol_common.cc.

◆ alts_grpc_record_protocol_init()

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.

Definition at line 88 of file alts_grpc_record_protocol_common.cc.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:02