#include <grpc/support/port_platform.h>
#include "src/core/tsi/alts/frame_protector/alts_counter.h"
#include <string.h>
#include <grpc/support/alloc.h>
Go to the source code of this file.
Functions | |
grpc_status_code | alts_counter_create (bool is_client, size_t counter_size, size_t overflow_size, alts_counter **crypter_counter, char **error_details) |
void | alts_counter_destroy (alts_counter *crypter_counter) |
unsigned char * | alts_counter_get_counter (alts_counter *crypter_counter) |
size_t | alts_counter_get_size (alts_counter *crypter_counter) |
grpc_status_code | alts_counter_increment (alts_counter *crypter_counter, bool *is_overflow, char **error_details) |
static void | maybe_copy_error_msg (const char *src, char **dst) |
grpc_status_code alts_counter_create | ( | bool | is_client, |
size_t | counter_size, | ||
size_t | overflow_size, | ||
alts_counter ** | crypter_counter, | ||
char ** | error_details | ||
) |
This method creates and initializes an alts_counter instance.
On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an error status code along with its details specified in error_details (if error_details is not nullptr).
Definition at line 34 of file alts_counter.cc.
void alts_counter_destroy | ( | alts_counter * | crypter_counter | ) |
This method de-allocates all memory allocated to an alts_coutner instance.
Definition at line 113 of file alts_counter.cc.
unsigned char* alts_counter_get_counter | ( | alts_counter * | crypter_counter | ) |
This method returns the counter buffer.
Definition at line 106 of file alts_counter.cc.
size_t alts_counter_get_size | ( | alts_counter * | crypter_counter | ) |
This method returns the size of counter buffer.
Definition at line 99 of file alts_counter.cc.
grpc_status_code alts_counter_increment | ( | alts_counter * | crypter_counter, |
bool * | is_overflow, | ||
char ** | error_details | ||
) |
This method increments the internal counter.
On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an error status code along with its details specified in error_details (if error_details is not nullptr).
If the lower overflow_size bytes are all zero, the counter has overflowed.
Definition at line 66 of file alts_counter.cc.
|
static |
Definition at line 27 of file alts_counter.cc.