NetBurner 3.5.6
PDF Version
_IpHeaderIPv4 Struct Reference

IP Header Structure (IPv4) More...

#include <ip.h>

Public Attributes

uint8_t versionNLength
 Version (4 bits) and header length (4 bits). Version=4 for IPv4, length in 32-bit words IPPKT::bVerHdrLen.
 
uint8_t diffServNEcn
 Differentiated Services Code Point (6 bits) and Explicit Congestion Notification (2 bits) - used for QoS IPPKT::bTos.
 
beuint16_t totalLength
 Total datagram size in bytes including IP header and data payload IPPKT::wLength.
 
beuint16_t identification
 Fragment identification field - same for all fragments of a datagram IPPKT::wpktId.
 
beuint16_t flagsNFragmentOffset
 Flags (3 bits) and fragment offset (13 bits) - offset in 8-byte units IPPKT::wFlags_Frag.
 
uint8_t timeToLive
 Time To Live - typically used as hop count, decremented by each router IPPKT::bTTL.
 
uint8_t protocol
 IANA protocol number identifying next-level protocol (TCP=6, UDP=17, ICMP=1) IPPKT::proto.
 
beuint16_t headerChecksum
 Header checksum - 16-bit one's complement checksum of IP header only (not data) IPPKT::hCSum.
 
beuint32_t sourceAddress
 Source IP address as 4 octets in network byte order IPPKT::ipSrc.
 
beuint32_t destinationAddress
 Destination IP address as 4 octets in network byte order IPPKT::ipDst.
 

Detailed Description

IP Header Structure (IPv4)

Standard IPv4 packet header as defined in IETF RFC 791 (September 1981) and MIL-STD-1777. This structure represents the 20-byte minimum IP header. IP options, if present, follow this structure and are indicated by a header length value greater than 5.

All multi-byte fields are in network byte order (big-endian) and use the beuint types for automatic endianness handling.

Note
The structure is packed to ensure proper alignment with network packet data.
Standard header is 20 bytes when no options are present (header length = 5).
Maximum header size is 60 bytes (header length = 15) when options are included.
See also
IPPKT for the internal representation used within NetBurner stack

The documentation for this struct was generated from the following file: