dtlsClient.hpp File Reference
#include <array>
#include <cstdint>
#include <iostream>
#include <openssl/bio.h>
#include <openssl/conf.h>
#include <openssl/dh.h>
#include <openssl/engine.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
#include "IPv4_5TupleL2Ident.hpp"
#include "mbuf.hpp"
#include "stateMachine.hpp"
Include dependency graph for dtlsClient.hpp:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Classes | |
struct | DTLS_Client::dtlsClient |
struct | DTLS_Client::States |
The state of the DTLS client. More... | |
Namespaces | |
DTLS_Client | |
Functions | |
SSL_CTX * | DTLS_Client::createCTX () |
Use this to create the SSL context for creaeteStateData() More... | |
void | DTLS_Client::configStateMachine (StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf > &sm) |
Configure the state machine. More... | |
StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::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. More... | |
void | DTLS_Client::initHandshake (StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &state, mbuf *, StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &funIface) |
void | DTLS_Client::runHandshake (StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &state, mbuf *, StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &funIface) |
void | DTLS_Client::sendData (StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &state, mbuf *, StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &funIface) |
void | DTLS_Client::runTeardown (StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::State &state, mbuf *, StateMachine< IPv4_5TupleL2Ident< mbuf >, mbuf >::FunIface &funIface) |
void * | DtlsClient_init (uint32_t dstIP, uint16_t dstPort, uint8_t srcMac[6], uint8_t dstMac[6]) |
Initialize a DTLS client. More... | |
void * | DtlsClient_connect (void *obj, struct rte_mbuf **inPkts, unsigned int inCount, unsigned int *sendCount, unsigned int *freeCount, uint32_t srcIP, uint16_t srcPort) |
Add one connection to the State Machine. More... | |
void | DtlsClient_getPkts (void *obj, struct rte_mbuf **sendPkts, struct rte_mbuf **freePkts) |
Get the packets from an opaque structure. More... | |
void * | DtlsClient_process (void *obj, struct rte_mbuf **inPkts, unsigned int inCount, unsigned int *sendCount, unsigned int *freeCount) |
Process incoming packets. More... | |
void | DtlsClient_free (void *obj) |
Free recources used by the state machine. More... | |
Function Documentation
◆ DtlsClient_connect()
void* DtlsClient_connect | ( | void * | obj, |
struct rte_mbuf ** | inPkts, | ||
unsigned int | inCount, | ||
unsigned int * | sendCount, | ||
unsigned int * | freeCount, | ||
uint32_t | srcIP, | ||
uint16_t | srcPort | ||
) |
Add one connection to the State Machine.
- Parameters
-
obj The void* returned from DtlsClient_init() inPkts mbufs from MoonGen inCount Number of buffers in inPkts (should be 1) sendCount This will be set to the number of packets to be sent freeCount This will be set to the number of packets to be freed srcIP IP which should be used as the source srcPort Port which should be used as the source
- Returns
- Opaque object to be fed into DtlsClient_getPkts
Definition at line 320 of file dtlsClient.cpp.
Here is the call graph for this function:
◆ DtlsClient_free()
void DtlsClient_free | ( | void * | obj | ) |
Free recources used by the state machine.
- Parameters
-
obj object returned by DtlsClient_init()
Definition at line 369 of file dtlsClient.cpp.
◆ DtlsClient_getPkts()
void DtlsClient_getPkts | ( | void * | obj, |
struct rte_mbuf ** | sendPkts, | ||
struct rte_mbuf ** | freePkts | ||
) |
Get the packets from an opaque structure.
- Parameters
-
obj Return value of DtlsClient_connect() or DtlsClient_process() sendPkts Array of packet buffers to be sent freePkts Array of packet buffers to be freed
Definition at line 346 of file dtlsClient.cpp.
Here is the call graph for this function:
◆ DtlsClient_init()
void* DtlsClient_init | ( | uint32_t | dstIP, |
uint16_t | dstPort, | ||
uint8_t | srcMac[6], | ||
uint8_t | dstMac[6] | ||
) |
Initialize a DTLS client.
- Parameters
-
dstIP IP of the DTLS test server dstPort Port of the DTLS test server srcMac MAC address of the local NIC dstMac MAC address of the remote NIC
- Returns
- An opaque object which should be fed into DtlsClient_connect
Definition at line 303 of file dtlsClient.cpp.
Here is the call graph for this function:
◆ DtlsClient_process()
void* DtlsClient_process | ( | void * | obj, |
struct rte_mbuf ** | inPkts, | ||
unsigned int | inCount, | ||
unsigned int * | sendCount, | ||
unsigned int * | freeCount | ||
) |
Process incoming packets.
- Parameters
-
obj Structure returned from DtlsClient_init() inPkts The newly arrived packets inCount Number of incoming packets sendCount Will be set to the number of packets to be sent freeCount Will be set to the number of packets to be freed
Definition at line 355 of file dtlsClient.cpp.
Here is the call graph for this function: