30 #ifndef TINS_PDU_HELPERS_H 31 #define TINS_PDU_HELPERS_H 33 #include <tins/constants.h> 34 #include <tins/config.h> 44 PDU* pdu_from_flag(Constants::Ethernet::e flag,
const uint8_t* buffer,
45 uint32_t size,
bool rawpdu_on_no_match =
true);
46 PDU* pdu_from_flag(Constants::IP::e flag,
const uint8_t* buffer,
47 uint32_t size,
bool rawpdu_on_no_match =
true);
49 PDU* pdu_from_dlt_flag(
int flag,
const uint8_t* buffer,
50 uint32_t size,
bool rawpdu_on_no_match =
true);
51 #endif // TINS_HAVE_PCAP 52 PDU* pdu_from_flag(
PDU::PDUType type,
const uint8_t* buffer, uint32_t size);
54 Constants::Ethernet::e pdu_flag_to_ether_type(
PDU::PDUType flag);
55 PDU::PDUType ether_type_to_pdu_flag(Constants::Ethernet::e flag);
59 inline bool is_dot3(
const uint8_t* ptr,
size_t sz) {
60 return (sz >= 13 && ptr[12] < 8);
70 #endif // TINS_PDU_HELPERS_H PDUType
Enum which identifies each type of PDU.
Definition: pdu.h:127
The Tins namespace.
Definition: address_range.h:38