29static const size_t ETHERNET_HEADER_LEN = 14;
32static const size_t ETHERNET_PACKET_TYPE_OFFSET = 12;
40static const uint16_t ETHERNET_TYPE_IP = 0x0800;
43static const size_t MIN_IP_HEADER_LEN = 20;
45static const size_t IP_FLAGS_OFFSET = 6;
48static const size_t IP_PROTO_TYPE_OFFSET = 9;
50static const size_t IP_SRC_ADDR_OFFSET = 12;
52static const size_t IP_DEST_ADDR_OFFSET = 16;
55static const size_t UDP_HEADER_LEN = 8;
57static const size_t UDP_DEST_PORT = 2;
142uint16_t
calcChecksum(
const uint8_t* buf,
const uint32_t buf_size,
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
void decodeEthernetHeader(InputBuffer &buf, Pkt4Ptr &pkt)
Decode the Ethernet header.
void writeEthernetHeader(const Pkt4Ptr &pkt, OutputBuffer &out_buf)
Writes ethernet frame header into a buffer.
void decodeIpUdpHeader(InputBuffer &buf, Pkt4Ptr &pkt)
Decode IP and UDP header.
uint16_t calcChecksum(const uint8_t *buf, const uint32_t buf_size, uint32_t sum)
Calculates checksum for provided buffer.
void writeIpUdpHeader(const Pkt4Ptr &pkt, util::OutputBuffer &out_buf)
Writes both IP and UDP header into output buffer.
Defines the logger used by the top-level component of kea-lfc.