EPS Conduits  v0.0.2-2413
networking over networking
EPS::Packet Class Referencefinal

Simple class to dissect a packet and look for a few key identifiers, such as is_ipv4() and is_ipv4_tcp(). More...

#include "Packet.hpp"

Public Member Functions

 Packet (const uint8_t *ptr, const size_t &skip=0)
 Constructor. More...
 
const EPS::EthernetHeaderget_ethernet_header (void) const
 Find the ethernet header. More...
 
const EPS::Ipv4Headerget_ipv4_header (void) const
 Find the ipv4 header. More...
 
bool is_ipv4 (void) const
 Determine if the packet is IPv4. (ethertype == ETHERTYPE_IP) More...
 
bool is_ipv4_tcp (void) const
 Determine if the packet is IPV4+TCP. (protocol == IPPROTO_TCP) More...
 
void debug (void) const
 Log some information on this packet. More...
 

Public Attributes

const uint8_t * data
 pointer to start of packet data More...
 
const size_t number_of_bytes_to_skip
 

Detailed Description

Simple class to dissect a packet and look for a few key identifiers, such as is_ipv4() and is_ipv4_tcp().

Constructor & Destructor Documentation

◆ Packet()

EPS::Packet::Packet ( const uint8_t *  ptr,
const size_t &  skip = 0 
)

Constructor.

Member Function Documentation

◆ debug()

void EPS::Packet::debug ( void  ) const

Log some information on this packet.

Here is the call graph for this function:

◆ get_ethernet_header()

const EPS::EthernetHeader * EPS::Packet::get_ethernet_header ( void  ) const

Find the ethernet header.

Here is the caller graph for this function:

◆ get_ipv4_header()

const EPS::Ipv4Header * EPS::Packet::get_ipv4_header ( void  ) const

Find the ipv4 header.

Returns
nullptr if the packet is not ipv4
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_ipv4()

bool EPS::Packet::is_ipv4 ( void  ) const

Determine if the packet is IPv4. (ethertype == ETHERTYPE_IP)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_ipv4_tcp()

bool EPS::Packet::is_ipv4_tcp ( void  ) const

Determine if the packet is IPV4+TCP. (protocol == IPPROTO_TCP)

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ data

const uint8_t* EPS::Packet::data

pointer to start of packet data

◆ number_of_bytes_to_skip

const size_t EPS::Packet::number_of_bytes_to_skip
See also
IFF_NO_PI

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