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::EthernetHeader * | get_ethernet_header (void) const |
Find the ethernet header. More... | |
const EPS::Ipv4Header * | get_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 |
Simple class to dissect a packet and look for a few key identifiers, such as is_ipv4() and is_ipv4_tcp().
EPS::Packet::Packet | ( | const uint8_t * | ptr, |
const size_t & | skip = 0 |
||
) |
Constructor.
void EPS::Packet::debug | ( | void | ) | const |
Log some information on this packet.
const EPS::EthernetHeader * EPS::Packet::get_ethernet_header | ( | void | ) | const |
Find the ethernet header.
const EPS::Ipv4Header * EPS::Packet::get_ipv4_header | ( | void | ) | const |
Find the ipv4 header.
bool EPS::Packet::is_ipv4 | ( | void | ) | const |
Determine if the packet is IPv4. (ethertype == ETHERTYPE_IP)
bool EPS::Packet::is_ipv4_tcp | ( | void | ) | const |
Determine if the packet is IPV4+TCP. (protocol == IPPROTO_TCP)
const uint8_t* EPS::Packet::data |
pointer to start of packet data
const size_t EPS::Packet::number_of_bytes_to_skip |