IPv4Codec – a layer 3 codec
IPv4Codec is invoked when the packet uses IP version 4 (IPv4) as the network protocol. IP is more detailed and involved than the Ethernet protocol, and hence the codec also does more validations and checks on the IP header.
The IP header structure is defined in the src/protocols/ipv4.h
header file, and the structure is as follows:
struct IP4Hdr { uint8_t ip_verhl; /* version & header length */ uint8_t ip_tos; /* type of service */ uint16_t ip_len; /* datagram length */ uint16_t ip_id; /* identification */ uint16_t ip_off; /* fragment offset */ uint8_t ip_ttl; &...