Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::jikev2 Class Reference

Public Member Functions

 jikev2 (std::shared_ptr< InterfacePP::jlogger > &logger)
 
 jikev2 (const char *config, std::shared_ptr< InterfacePP::jlogger > &logger)
 
 ~jikev2 ()=default
 Standard deconstructor.
 
void run ()
 Run IKEv2.
 
void teardown ()
 Teardown IKEv2.
 
 jikev2 (jikev2 &jikev2)=delete
 
 jikev2 (const jikev2 &jikev2)=delete
 

Protected Member Functions

bool reload (const char *config)
 
bool propose (std::shared_ptr< jikeparse::jikepolicy > &policy, bool connect)
 
uint32_t add_sa (std::shared_ptr< jipsecsa > &sa)
 
uint32_t delete_sa (uint64_t spi, uint32_t spisize)
 
uint32_t findsa (uint64_t spi, std::shared_ptr< jikev2sa > &sa)
 
bool comms (std::shared_ptr< jarray< uint8_t >> &input, std::shared_ptr< jarray< uint8_t >> &output, bool wait=true)
 
bool get_fields (uint8_t *input, std::shared_ptr< jikev2sa > &sa1)
 
bool get_fields (uint8_t *input, std::shared_ptr< jipsecsa > &sa1, std::shared_ptr< jipsecsa > &sa2)
 

Constructor & Destructor Documentation

◆ jikev2() [1/2]

ProtocolPP::jikev2::jikev2 ( std::shared_ptr< InterfacePP::jlogger > &  logger)
explicit

Standard constructor

Parameters
logger- Logger object to write to

◆ jikev2() [2/2]

ProtocolPP::jikev2::jikev2 ( const char *  config,
std::shared_ptr< InterfacePP::jlogger > &  logger 
)

Constructor with configuration file

Parameters
config- Configuration(s) to initiate connection with
logger- Logger object to write to

Member Function Documentation

◆ add_sa()

uint32_t ProtocolPP::jikev2::add_sa ( std::shared_ptr< jipsecsa > &  sa)
protected

Add a new security association to the key ring, Updates the security association if it already exists

Parameters
sa- Security Association to add to the ring
Returns
status for adding the key

◆ comms()

bool ProtocolPP::jikev2::comms ( std::shared_ptr< jarray< uint8_t >> &  input,
std::shared_ptr< jarray< uint8_t >> &  output,
bool  wait = true 
)
protected

Create a Security Association with the negotiated parameters

Parameters
input- input packet
output- output packet
wait- use blocking socket

◆ delete_sa()

uint32_t ProtocolPP::jikev2::delete_sa ( uint64_t  spi,
uint32_t  spisize 
)
protected

Delete a security association in the key ring

Parameters
spi- security protocol index for the IKE connection
spisize- size of the SPI in bytes (4 or 8)
Returns
- status of the lookup

◆ findsa()

uint32_t ProtocolPP::jikev2::findsa ( uint64_t  spi,
std::shared_ptr< jikev2sa > &  sa 
)
protected

Find a security association in the key ring

Parameters
spi- security protocol index for the IKE connection
sa- Security Association to return from the ring
Returns
- status of the lookup

◆ get_fields() [1/2]

bool ProtocolPP::jikev2::get_fields ( uint8_t *  input,
std::shared_ptr< jikev2sa > &  sa1 
)
protected

Parse the input and fill the Security Association(s)

Parameters
input- input packet
sa1- Security Association (IKE)

◆ get_fields() [2/2]

bool ProtocolPP::jikev2::get_fields ( uint8_t *  input,
std::shared_ptr< jipsecsa > &  sa1,
std::shared_ptr< jipsecsa > &  sa2 
)
protected

Parse the input and fill the Security Association(s)

Parameters
input- input packet
sa1- Security Association (ESP_IN)
sa2- Security Association (ESP_OUT)

◆ propose()

bool ProtocolPP::jikev2::propose ( std::shared_ptr< jikeparse::jikepolicy > &  policy,
bool  connect 
)
protected

Propose a new connection

Parameters
policy- New policy to add to database
connect- Create the connection as initiator
Returns
True for success, False for connection failure

◆ reload()

bool ProtocolPP::jikev2::reload ( const char *  config)
protected

reload the configuration for IKEv2 with new configuration

Parameters
config- New configuration file
Returns
True for success, False for connection failure

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