IPv4 header type and helper function definitions. More...
IPv4 header type and helper function definitions.
Definition in file hdr.h.
Include dependency graph for hdr.h:Go to the source code of this file.
Data Structures | |
| struct | ipv4_hdr_t |
| Data type to represent an IPv4 packet header. More... | |
Functions | |
| static void | ipv4_hdr_set_version (ipv4_hdr_t *hdr) |
Sets the version field of hdr to 4. | |
| static uint8_t | ipv4_hdr_get_version (ipv4_hdr_t *hdr) |
Gets the value of the version field of hdr. | |
| static void | ipv4_hdr_set_ihl (ipv4_hdr_t *hdr, uint16_t ihl) |
Sets the Internet Header Length field of hdr. | |
| static uint16_t | ipv4_hdr_get_ihl (ipv4_hdr_t *hdr) |
Gets the value of the Internet Header Length field of hdr. | |
| static void | ipv4_hdr_set_flags (ipv4_hdr_t *hdr, uint8_t flags) |
Sets the Version Control Flags field of hdr. | |
| static uint8_t | ipv4_hdr_get_flags (ipv4_hdr_t *hdr) |
Gets the value of the Version Control Flags field of hdr. | |
| static void | ipv4_hdr_set_fo (ipv4_hdr_t *hdr, uint16_t fo) |
Sets the Fragment Offset field of hdr. | |
| static uint16_t | ipv4_hdr_get_fo (ipv4_hdr_t *hdr) |
Gets the value of the Fragment Offset field of hdr. | |
IPv4 Header Flags | |
| |
| #define | IPV4_HDR_FLAGS_RESERVED (0x04) |
| reserved | |
| #define | IPV4_HDR_FLAGS_DF (0x02) |
| do not fragment | |
| #define | IPV4_HDR_FLAGS_MF (0x01) |
| more fragments | |