IP Datagram Analysis¶
pcapkit.foundation.analysis.ip contains
ip_datagram() only, which parses the
payload of an IPv4 or IPv6 datagram that
IPv4 or
IPv6 reassembled.
- pcapkit.foundation.analysis.ip.ip_datagram(datagram)[source]¶
Parse the payload of an IP datagram reassembled by
IPv4orIPv6.The payload is dispatched on the datagram’s payload protocol type – the Protocol field for IPv4, the Fragment header’s Next Header for IPv6 – by
Protocol.analyzeofIPv4orIPv6, whichever the datagram’s addresses belong to.- Parameters:
datagram (
Datagram) – Reassembled datagram (reasm.ipv4.datagram or reasm.ipv6.datagram).- Return type:
- Returns:
The parsed payload. A payload reported as one contiguous run is parsed whether or not
datagramis complete, asstrict=Falsereports an incomplete one.Noneif the payload is the tuple of runs received, asstrict=Truereports an incomplete one.
Note
Datagram.packetholds the same result, parsed on its first read, unless the reassembly’s__protocol_type__names another protocol, which then parses it instead.