NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
PSP_GatewayImpl Class Reference

Implementation of the PSP_Gateway service. More...

#include </opt/mellanox/doca/applications/psp_gateway/psp_gw_svc_impl.h>

Inheritance diagram for PSP_GatewayImpl:
Collaboration diagram for PSP_GatewayImpl:

Public Member Functions

 PSP_GatewayImpl (psp_gw_app_config *config, PSP_GatewayFlows *psp_flows)
 Constructs the object. This operation cannot fail. More...
 
::grpc::Status RequestMultipleTunnelParams (::grpc::ServerContext *context, const ::psp_gateway::MultiTunnelRequest *request, ::psp_gateway::MultiTunnelResponse *response) override
 Requests that the recipient allocate multiple SPIs and encryption keys so that the initiator can begin sending encrypted traffic. More...
 
::grpc::Status RequestKeyRotation (::grpc::ServerContext *context, const ::psp_gateway::KeyRotationRequest *request, ::psp_gateway::KeyRotationResponse *response) override
 Requests that the recipient rotate the PSP master key. More...
 
doca_error_t handle_miss_packet (struct rte_mbuf *packet)
 Handles any "miss" packets received by RSS which indicate a new tunnel connection is needed. More...
 
doca_error_t show_flow_counts (void)
 Displays the counters of all tunnel sessions that have changed since the previous invocation. More...
 
size_t try_connect (std::vector< psp_gw_peer > &peers)
 Attempt to establish tunnels to each of the passed peers. On success, a given peer is removed from the list so that this method can be called repeatedly with the same list. More...
 

Static Public Attributes

static constexpr uint16_t DEFAULT_HTTP_PORT_NUM = 3000
 

Detailed Description

Implementation of the PSP_Gateway service.

Manages the generation of PSP encryption keys, which are supplied to a remote service to establish a tunnel connection.

As a server, listens to requests for new tunnels, generates parameters for the requestor to send encrypted packets, and creates the flows required to send encrypted packets back to the requestor.

As a client, generates parameters for a remote service to send encrypted packets, and sends them as part of the request.

Definition at line 59 of file psp_gw_svc_impl.h.

Constructor & Destructor Documentation

◆ PSP_GatewayImpl()

PSP_GatewayImpl::PSP_GatewayImpl ( psp_gw_app_config config,
PSP_GatewayFlows psp_flows 
)

Constructs the object. This operation cannot fail.

Parameters
[in]psp_flowsThe object which manages the doca resources.

Definition at line 42 of file psp_gw_svc_impl.cpp.

Member Function Documentation

◆ handle_miss_packet()

doca_error_t PSP_GatewayImpl::handle_miss_packet ( struct rte_mbuf *  packet)

Handles any "miss" packets received by RSS which indicate a new tunnel connection is needed.

@packet [in]: The packet received from RSS

Returns
: DOCA_SUCCESS on success and DOCA_ERROR otherwise

Definition at line 50 of file psp_gw_svc_impl.cpp.

◆ RequestKeyRotation()

grpc::Status PSP_GatewayImpl::RequestKeyRotation ( ::grpc::ServerContext *  context,
const ::psp_gateway::KeyRotationRequest *  request,
::psp_gateway::KeyRotationResponse *  response 
)
override

Requests that the recipient rotate the PSP master key.

@context [in]: grpc context @request [in]: request parameters @response [out]: requested outputs

Returns
: Indicates success/failure of the request

Definition at line 548 of file psp_gw_svc_impl.cpp.

◆ RequestMultipleTunnelParams()

grpc::Status PSP_GatewayImpl::RequestMultipleTunnelParams ( ::grpc::ServerContext *  context,
const ::psp_gateway::MultiTunnelRequest *  request,
::psp_gateway::MultiTunnelResponse *  response 
)
override

Requests that the recipient allocate multiple SPIs and encryption keys so that the initiator can begin sending encrypted traffic.

@context [in]: grpc context @request [in]: request parameters @response [out]: requested outputs

Returns
: Indicates success/failure of the request

Definition at line 353 of file psp_gw_svc_impl.cpp.

◆ show_flow_counts()

doca_error_t PSP_GatewayImpl::show_flow_counts ( void  )

Displays the counters of all tunnel sessions that have changed since the previous invocation.

Returns
: DOCA_SUCCESS on success and DOCA_ERROR otherwise

Definition at line 589 of file psp_gw_svc_impl.cpp.

◆ try_connect()

size_t PSP_GatewayImpl::try_connect ( std::vector< psp_gw_peer > &  peers)

Attempt to establish tunnels to each of the passed peers. On success, a given peer is removed from the list so that this method can be called repeatedly with the same list.

@peers [in/out]: the list of tunnels to try to establish

Returns
: the number of peers successfully connected and removed from 'peers'

Definition at line 569 of file psp_gw_svc_impl.cpp.

Field Documentation

◆ DEFAULT_HTTP_PORT_NUM

constexpr uint16_t PSP_GatewayImpl::DEFAULT_HTTP_PORT_NUM = 3000
staticconstexpr

Definition at line 61 of file psp_gw_svc_impl.h.


The documentation for this class was generated from the following files: