EPS Conduits  v0.0.2-2413
networking over networking
EPS::CommHeader1 Struct Referencefinal

Communication header: common fields to all communication commands. More...

#include "comm.hpp"

Public Member Functions

 CommHeader1 (void)
 Constructor. More...
 
void set (const EPS::ECommType type, const size_t bytes)
 Initialize the header. More...
 
size_t size_of_packet (void) const
 A safe way to get number_of_bytes, automatically converting it to host order and resizing it as a size_t. More...
 
EPS::ECommType type (void) const
 A safe way to get comm_type as a EPS::ECommType value. More...
 

Public Attributes

uint8_t protocol_version
 protocol version identifier More...
 
uint16_t number_of_bytes
 number of bytes in the comm structure including every byte in the header structure (stored in network byte order) More...
 
uint8_t comm_type
 structure type More...
 
uint8_t reserved_5
 Reserved for future use. More...
 
uint32_t reserved_1
 reserved for future use, and to ensure the common header is exactly 16 bytes in length More...
 
uint32_t reserved_2
 reserved for future use, and to ensure the common header is exactly 16 bytes in length More...
 
uint16_t reserved_3
 reserved for future use, and to ensure the common header is exactly 16 bytes in length More...
 
uint8_t reserved_4
 reserved for future use, and to ensure the common header is exactly 16 bytes in length More...
 

Detailed Description

Communication header: common fields to all communication commands.

It is padded out to 16 bytes so it is exactly 1 block once we AES-encrypt it. This makes it easier when it comes time to read packets off the wire if we know the common header is exactly 1 AES cipher block.

Constructor & Destructor Documentation

◆ CommHeader1()

EPS::CommHeader1::CommHeader1 ( void  )

Constructor.

Member Function Documentation

◆ set()

void EPS::CommHeader1::set ( const EPS::ECommType  type,
const size_t  bytes 
)

Initialize the header.

Here is the call graph for this function:

◆ size_of_packet()

size_t EPS::CommHeader1::size_of_packet ( void  ) const

A safe way to get number_of_bytes, automatically converting it to host order and resizing it as a size_t.

Here is the caller graph for this function:

◆ type()

EPS::ECommType EPS::CommHeader1::type ( void  ) const

A safe way to get comm_type as a EPS::ECommType value.

Here is the caller graph for this function:

Member Data Documentation

◆ comm_type

uint8_t EPS::CommHeader1::comm_type

◆ number_of_bytes

uint16_t EPS::CommHeader1::number_of_bytes

number of bytes in the comm structure including every byte in the header structure (stored in network byte order)

◆ protocol_version

uint8_t EPS::CommHeader1::protocol_version

protocol version identifier

◆ reserved_1

uint32_t EPS::CommHeader1::reserved_1

reserved for future use, and to ensure the common header is exactly 16 bytes in length

◆ reserved_2

uint32_t EPS::CommHeader1::reserved_2

reserved for future use, and to ensure the common header is exactly 16 bytes in length

◆ reserved_3

uint16_t EPS::CommHeader1::reserved_3

reserved for future use, and to ensure the common header is exactly 16 bytes in length

◆ reserved_4

uint8_t EPS::CommHeader1::reserved_4

reserved for future use, and to ensure the common header is exactly 16 bytes in length

◆ reserved_5

uint8_t EPS::CommHeader1::reserved_5

Reserved for future use.

Try and leave this last reserved value at zero, so that when we decrypt the header bytes (the first 16 bytes of the message) we don't mistake this 16th byte as a PKCS #5 / PKCS #7 padding value and accidentally truncate the header.

See also
EPS::Cipher::decrypt()

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