7 #ifndef PROTOCOL_UTIL_H 
    8 #define PROTOCOL_UTIL_H 
   29 static const size_t ETHERNET_HEADER_LEN = 14;
 
   32 static const size_t ETHERNET_PACKET_TYPE_OFFSET = 12;
 
   40 static const uint16_t ETHERNET_TYPE_IP = 0x0800;
 
   43 static const size_t MIN_IP_HEADER_LEN = 20;
 
   45 static const size_t IP_FLAGS_OFFSET = 6;
 
   48 static const size_t IP_PROTO_TYPE_OFFSET = 9;
 
   50 static const size_t IP_SRC_ADDR_OFFSET = 12;
 
   52 static const size_t IP_DEST_ADDR_OFFSET = 16;
 
   55 static const size_t UDP_HEADER_LEN = 8;
 
   57 static const size_t UDP_DEST_PORT = 2;
 
  142 uint16_t 
calcChecksum(
const uint8_t* buf, 
const uint32_t buf_size,
 
  147 #endif // PROTOCOL_UTIL_H 
void writeEthernetHeader(const Pkt4Ptr &pkt, OutputBuffer &out_buf)
Writes ethernet frame header into a buffer. 
 
uint16_t calcChecksum(const uint8_t *buf, const uint32_t buf_size, uint32_t sum)
Calculates checksum for provided buffer. 
 
void decodeEthernetHeader(InputBuffer &buf, Pkt4Ptr &pkt)
Decode the Ethernet header. 
 
void writeIpUdpHeader(const Pkt4Ptr &pkt, util::OutputBuffer &out_buf)
Writes both IP and UDP header into output buffer. 
 
boost::shared_ptr< Pkt4 > Pkt4Ptr
A pointer to Pkt4 object. 
 
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. 
 
This is a base class for exceptions thrown from the DNS library module. 
 
Defines the logger used by the top-level component of kea-dhcp-ddns. 
 
void decodeIpUdpHeader(InputBuffer &buf, Pkt4Ptr &pkt)
Decode IP and UDP header.