Typedefs | Functions
alts_grpc_record_protocol.h File Reference
#include <grpc/support/port_platform.h>
#include <grpc/slice_buffer.h>
#include "src/core/tsi/transport_security_interface.h"
Include dependency graph for alts_grpc_record_protocol.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct alts_grpc_record_protocol alts_grpc_record_protocol
 

Functions

void alts_grpc_record_protocol_destroy (alts_grpc_record_protocol *self)
 
size_t alts_grpc_record_protocol_max_unprotected_data_size (const alts_grpc_record_protocol *self, size_t max_protected_frame_size)
 
tsi_result alts_grpc_record_protocol_protect (alts_grpc_record_protocol *self, grpc_slice_buffer *unprotected_slices, grpc_slice_buffer *protected_slices)
 
tsi_result alts_grpc_record_protocol_unprotect (alts_grpc_record_protocol *self, grpc_slice_buffer *protected_slices, grpc_slice_buffer *unprotected_slices)
 

Typedef Documentation

◆ 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.

Definition at line 33 of file alts_grpc_record_protocol.h.

Function Documentation

◆ alts_grpc_record_protocol_destroy()

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.

Definition at line 151 of file alts_grpc_record_protocol_common.cc.

◆ alts_grpc_record_protocol_max_unprotected_data_size()

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.

Definition at line 167 of file alts_grpc_record_protocol_common.cc.

◆ alts_grpc_record_protocol_protect()

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.

  • self: an alts_grpc_record_protocol instance.
  • unprotected_slices: the unprotected data to be protected.
  • protected_slices: slice buffer where the protected frame is appended.

This method returns TSI_OK in case of success or a specific error code in case of failure.

Definition at line 123 of file alts_grpc_record_protocol_common.cc.

◆ alts_grpc_record_protocol_unprotect()

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.

  • self: an alts_grpc_record_protocol instance.
  • protected_slices: a full frame of protected data in grpc slices.
  • unprotected_slices: slice buffer where unprotected data is appended.

This method returns TSI_OK in case of success or a specific error code in case of failure.

Definition at line 137 of file alts_grpc_record_protocol_common.cc.



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