GRPC Core  9.0.0
Data Structures | Namespaces | Typedefs | Functions
alts_tsi_handshaker.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd_id.h>
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/tsi/alts/frame_protector/alts_frame_protector.h"
#include "src/core/tsi/alts/handshaker/alts_handshaker_client.h"
#include "src/core/tsi/alts/handshaker/alts_shared_resource.h"
#include "src/core/tsi/alts/handshaker/alts_tsi_utils.h"
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h"

Data Structures

struct  alts_tsi_handshaker
 
struct  alts_tsi_handshaker_result
 
struct  alts_tsi_handshaker_continue_handshaker_next_args
 

Namespaces

 grpc_core
 Round Robin Policy.
 
 grpc_core::internal
 

Typedefs

typedef struct alts_tsi_handshaker_result alts_tsi_handshaker_result
 

Functions

tsi_result alts_tsi_handshaker_result_create (grpc_gcp_HandshakerResp *resp, bool is_client, tsi_handshaker_result **self)
 This method creates an ALTS TSI handshaker result instance. More...
 
bool alts_tsi_handshaker_has_shutdown (alts_tsi_handshaker *handshaker)
 This method returns a boolean value indicating if an ALTS TSI handshaker has been shutdown or not. More...
 
tsi_result alts_tsi_handshaker_create (const grpc_alts_credentials_options *options, const char *target_name, const char *handshaker_service_url, bool is_client, grpc_pollset_set *interested_parties, tsi_handshaker **self)
 This method creates a ALTS TSI handshaker instance. More...
 
void alts_tsi_handshaker_result_set_unused_bytes (tsi_handshaker_result *self, grpc_slice *recv_bytes, size_t bytes_consumed)
 This method sets unused bytes of ALTS TSI handshaker result instance. More...
 
bool grpc_core::internal::alts_tsi_handshaker_get_has_sent_start_message_for_testing (alts_tsi_handshaker *handshaker)
 
void grpc_core::internal::alts_tsi_handshaker_set_client_vtable_for_testing (alts_tsi_handshaker *handshaker, alts_handshaker_client_vtable *vtable)
 
bool grpc_core::internal::alts_tsi_handshaker_get_is_client_for_testing (alts_tsi_handshaker *handshaker)
 
alts_handshaker_clientgrpc_core::internal::alts_tsi_handshaker_get_client_for_testing (alts_tsi_handshaker *handshaker)
 Unsafe, use for testing only. More...
 

Typedef Documentation

◆ alts_tsi_handshaker_result

Function Documentation

◆ alts_tsi_handshaker_create()

tsi_result alts_tsi_handshaker_create ( const grpc_alts_credentials_options options,
const char *  target_name,
const char *  handshaker_service_url,
bool  is_client,
grpc_pollset_set interested_parties,
tsi_handshaker **  self 
)

This method creates a ALTS TSI handshaker instance.

  • options: ALTS credentials options containing information passed from TSI caller (e.g., rpc protocol versions).
  • target_name: the name of the endpoint that the channel is connecting to, and will be used for secure naming check.
  • handshaker_service_url: address of ALTS handshaker service in the format of "host:port".
  • is_client: boolean value indicating if the handshaker is used at the client (is_client = true) or server (is_client = false) side.
  • interested_parties: set of pollsets interested in this connection.
  • self: address of ALTS TSI handshaker instance to be returned from the method.

It returns TSI_OK on success and an error status code on failure. Note that if interested_parties is nullptr, a dedicated TSI thread will be created and used.

◆ alts_tsi_handshaker_has_shutdown()

bool alts_tsi_handshaker_has_shutdown ( alts_tsi_handshaker handshaker)

This method returns a boolean value indicating if an ALTS TSI handshaker has been shutdown or not.

◆ alts_tsi_handshaker_result_create()

tsi_result alts_tsi_handshaker_result_create ( grpc_gcp_HandshakerResp resp,
bool  is_client,
tsi_handshaker_result **  result 
)

This method creates an ALTS TSI handshaker result instance.

  • resp: data received from the handshaker service.
  • is_client: a boolean value indicating if the result belongs to a client or not.
  • result: address of ALTS TSI handshaker result instance.

◆ alts_tsi_handshaker_result_set_unused_bytes()

void alts_tsi_handshaker_result_set_unused_bytes ( tsi_handshaker_result result,
grpc_slice recv_bytes,
size_t  bytes_consumed 
)

This method sets unused bytes of ALTS TSI handshaker result instance.

  • result: an ALTS TSI handshaker result instance.
  • recv_bytes: data received from the handshaker service.
  • bytes_consumed: size of data consumed by the handshaker service.