DTLS_Client Namespace Reference

Classes

struct  dtlsClient
 
struct  States
 The state of the DTLS client. More...
 

Functions

SSL_CTX * createCTX ()
 Use this to create the SSL context for creaeteStateData() More...
 
void configStateMachine (StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf > &sm)
 Configure the state machine. More...
 
StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State createStateData (SSL_CTX *ctx, uint32_t localIP, uint32_t remoteIP, uint16_t localPort, uint16_t remotePort, std::array< uint8_t, 6 > localMac, std::array< uint8_t, 6 > remoteMac)
 Create the state of the client. More...
 
void initHandshake (StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &state, mbuf *, StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &funIface)
 
void runHandshake (StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &state, mbuf *, StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &funIface)
 
void sendData (StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &state, mbuf *, StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &funIface)
 
void runTeardown (StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &state, mbuf *, StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &funIface)
 
void configStateMachine (SM &sm)
 
void initHandshake (SM::State &state, mbuf *pkt, SM::FunIface &funIface)
 
void runHandshake (SM::State &state, mbuf *pkt, SM::FunIface &funIface)
 
void sendData (SM::State &state, mbuf *pkt, SM::FunIface &funIface)
 
void runTeardown (SM::State &state, mbuf *pkt, SM::FunIface &funIface)
 

Function Documentation

◆ configStateMachine() [1/2]

void DTLS_Client::configStateMachine ( SM sm)

Definition at line 46 of file dtlsClient.cpp.

Here is the call graph for this function:

◆ configStateMachine() [2/2]

void DTLS_Client::configStateMachine ( StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf > &  sm)

Configure the state machine.

This functon takes the state machine and configures it according to this implementation of a DTLS client. In pratice, this means, that it will set the functions to be executed within each state.

Parameters
smThe state machine to be configured

◆ createCTX()

SSL_CTX * DTLS_Client::createCTX ( )

Use this to create the SSL context for creaeteStateData()

Returns
SSL context suitable to create a DTLS client

Definition at line 11 of file dtlsClient.cpp.

◆ createStateData()

SM::State DTLS_Client::createStateData ( SSL_CTX *  ctx,
uint32_t  localIP,
uint32_t  remoteIP,
uint16_t  localPort,
uint16_t  remotePort,
std::array< uint8_t, 6 >  localMac,
std::array< uint8_t, 6 >  remoteMac 
)

Create the state of the client.

Parameters
ctxSSL context, get this from createCTX()
localIPIP of this host (client)
remoteIPIP of the peer (server)
localPortSource port of this client
remotePortDestination port of the server
localMacMAC address of the client NIC
remoteMacMAC address of the next hop
Returns
The complete state to kick of a client connection

Definition at line 55 of file dtlsClient.cpp.

◆ initHandshake() [1/2]

void DTLS_Client::initHandshake ( StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &  state,
mbuf ,
StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &  funIface 
)

◆ initHandshake() [2/2]

void DTLS_Client::initHandshake ( SM::State &  state,
mbuf pkt,
SM::FunIface &  funIface 
)

Definition at line 173 of file dtlsClient.cpp.

◆ runHandshake() [1/2]

void DTLS_Client::runHandshake ( StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &  state,
mbuf ,
StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &  funIface 
)

◆ runHandshake() [2/2]

void DTLS_Client::runHandshake ( SM::State &  state,
mbuf pkt,
SM::FunIface &  funIface 
)

Definition at line 183 of file dtlsClient.cpp.

Here is the call graph for this function:

◆ runTeardown() [1/2]

void DTLS_Client::runTeardown ( StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &  state,
mbuf ,
StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &  funIface 
)

◆ runTeardown() [2/2]

void DTLS_Client::runTeardown ( SM::State &  state,
mbuf pkt,
SM::FunIface &  funIface 
)

Definition at line 266 of file dtlsClient.cpp.

Here is the call graph for this function:

◆ sendData() [1/2]

void DTLS_Client::sendData ( StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &  state,
mbuf ,
StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &  funIface 
)

◆ sendData() [2/2]

void DTLS_Client::sendData ( SM::State &  state,
mbuf pkt,
SM::FunIface &  funIface 
)

Definition at line 239 of file dtlsClient.cpp.

Here is the call graph for this function: