TCP Datagram Analysis¶
pcapkit.foundation.analysis.tcp contains
tcp_datagram() only, which parses the
application-layer payload of a TCP datagram that
TCP reassembled.
- pcapkit.foundation.analysis.tcp.tcp_datagram(datagram)[source]¶
Parse the payload of a TCP datagram reassembled by
TCP.A reassembled datagram carries no protocol number, so its payload is dispatched on its
(source, destination)ports byTransport.analyzeofTCP. Each port is resolved to itsTCPmember byTransport._make_port, asTCP._make_portsresolves them for the reassembly.- Parameters:
datagram (
Datagram) – Reassembled datagram (reasm.tcp.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.