Representation of the etherner header. More...

#include <headers.hpp>

Public Member Functions

void * getPayload ()
 Get the SDU. More...
 
std::string getSrcAddr ()
 
std::string getDstAddr ()
 
uint16_t getEthertype ()
 Get the ethertype. More...
 
void setEthertype (uint16_t type)
 Set the ethertype. More...
 
void setSrcAddr (const std::array< uint8_t, 6 > addr)
 
void setDstAddr (std::array< uint8_t, 6 > addr)
 

Static Public Member Functions

static std::string addrToStr (std::array< uint8_t, 6 > addr)
 

Public Attributes

std::array< uint8_t, 6 > destMac
 Destination MAC. More...
 
std::array< uint8_t, 6 > srcMac
 Source MAC. More...
 
uint16_t ethertype
 Ethertype. More...
 

Static Public Attributes

static constexpr uint16_t ETHERTYPE_IPv4 = 0x0800
 
static constexpr uint16_t ETHERTYPE_IPv6 = 0x86dd
 

Detailed Description

Representation of the etherner header.

Definition at line 15 of file headers.hpp.

Member Function Documentation

◆ addrToStr()

static std::string Headers::Ethernet::addrToStr ( std::array< uint8_t, 6 >  addr)
inlinestatic

Definition at line 28 of file headers.hpp.

◆ getDstAddr()

std::string Headers::Ethernet::getDstAddr ( )
inline

Definition at line 39 of file headers.hpp.

Here is the call graph for this function:

◆ getEthertype()

uint16_t Headers::Ethernet::getEthertype ( )
inline

Get the ethertype.

Returns
Ethertype in host byte order

Definition at line 44 of file headers.hpp.

◆ getPayload()

void* Headers::Ethernet::getPayload ( )
inline

Get the SDU.

Returns
Pointer to the payload

Definition at line 23 of file headers.hpp.

◆ getSrcAddr()

std::string Headers::Ethernet::getSrcAddr ( )
inline

Definition at line 37 of file headers.hpp.

Here is the call graph for this function:

◆ setDstAddr()

void Headers::Ethernet::setDstAddr ( std::array< uint8_t, 6 >  addr)
inline

Definition at line 58 of file headers.hpp.

◆ setEthertype()

void Headers::Ethernet::setEthertype ( uint16_t  type)
inline

Set the ethertype.

Parameters
typeEthertype in host byte order

Definition at line 52 of file headers.hpp.

◆ setSrcAddr()

void Headers::Ethernet::setSrcAddr ( const std::array< uint8_t, 6 >  addr)
inline

Definition at line 54 of file headers.hpp.

Member Data Documentation

◆ destMac

std::array<uint8_t, 6> Headers::Ethernet::destMac

Destination MAC.

Definition at line 16 of file headers.hpp.

◆ ethertype

uint16_t Headers::Ethernet::ethertype

Ethertype.

Definition at line 18 of file headers.hpp.

◆ ETHERTYPE_IPv4

constexpr uint16_t Headers::Ethernet::ETHERTYPE_IPv4 = 0x0800
static

Definition at line 46 of file headers.hpp.

◆ ETHERTYPE_IPv6

constexpr uint16_t Headers::Ethernet::ETHERTYPE_IPv6 = 0x86dd
static

Definition at line 47 of file headers.hpp.

◆ srcMac

std::array<uint8_t, 6> Headers::Ethernet::srcMac

Source MAC.

Definition at line 17 of file headers.hpp.


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