rfc.ip
- IP packets ¶This module provides some basic utilities to parse raw IP packets.
The packet argument in the following functions must be any type of uniform vector (see Uniform vectors), containing a raw IP packet including its IP header. Those functions work for both IPv4 and IPv6 packets; however, reading from a raw IPv6 socket returns a packet without IPv6 header, so you usually don’t need to use these functions.
The offset argument specifies the beginning of the IP packet in packet. If packet contains only one IP packet you can pass 0. It is not an optional argument, since these routines may be used in speed-sensitive inner loop.
{rfc.ip
}
Returns the IP version number (either 4 or 6) of the given IP packet.
{rfc.ip
}
Returns the size of IP header of the given packet in octets,
including any IP header options.
{rfc.ip
}
Returns the IP protocol number of the given packet.