GRPC Core
9.0.0
|
#include <grpc/support/port_platform.h>
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h"
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/tsi/alts/crypt/gsec.h"
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h"
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.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 "src/core/tsi/transport_security_grpc.h"
Data Structures | |
struct | alts_zero_copy_grpc_protector |
Main struct for alts_zero_copy_grpc_protector. More... | |
Typedefs | |
typedef struct alts_zero_copy_grpc_protector | alts_zero_copy_grpc_protector |
Main struct for alts_zero_copy_grpc_protector. More... | |
Functions | |
tsi_result | alts_zero_copy_grpc_protector_create (const uint8_t *key, size_t key_size, bool is_rekey, bool is_client, bool is_integrity_only, bool enable_extra_copy, size_t *max_protected_frame_size, tsi_zero_copy_grpc_protector **protector) |
This method creates an ALTS zero-copy grpc protector. More... | |
Variables | |
constexpr size_t | kMinFrameLength = 1024 |
constexpr size_t | kDefaultFrameLength = 16 * 1024 |
constexpr size_t | kMaxFrameLength = 16 * 1024 * 1024 |
typedef struct alts_zero_copy_grpc_protector alts_zero_copy_grpc_protector |
Main struct for alts_zero_copy_grpc_protector.
We choose to have two alts_grpc_record_protocol objects and two sets of slice buffers: one for protect and the other for unprotect, so that protect and unprotect can be executed in parallel. Implementations of this object must be thread compatible.
tsi_result alts_zero_copy_grpc_protector_create | ( | const uint8_t * | key, |
size_t | key_size, | ||
bool | is_rekey, | ||
bool | is_client, | ||
bool | is_integrity_only, | ||
bool | enable_extra_copy, | ||
size_t * | max_protected_frame_size, | ||
tsi_zero_copy_grpc_protector ** | protector | ||
) |
This method creates an ALTS zero-copy grpc protector.
This method returns TSI_OK on success or a specific error code otherwise.
constexpr size_t kDefaultFrameLength = 16 * 1024 |
constexpr size_t kMaxFrameLength = 16 * 1024 * 1024 |
constexpr size_t kMinFrameLength = 1024 |