Repository navigation
refactor(analysis): give IP and TCP reassembly their own foundation.analysis modules - #2619
Conversation
…nalysis modules (#2581) - analysis/ip.py: ip_datagram parses an IPv4/IPv6 datagram's payload through IPv4.analyze or IPv6.analyze, by its addresses. - analysis/tcp.py: tcp_datagram parses a TCP datagram's payload through TCP.analyze by its ports. Both return None for strict=True's received runs. - IP.submit, TCP.submit: the Deferred packet runs each module's parse, bound to the engine's own __protocol_type__. Exported as dtls_handshake is. - docs: reassembly-integration point 3 holds for every engine; API pages; packet docs name the functions, with the __protocol_type__ exception. - tests: functions called directly; Extractor over PCAP and PCAP-NG, default and custom __protocol_type__; pickle round trips of an unread packet. Behaviour unchanged: a sample-capture differential matches main.
|
GOOD TO GO at
|
|
Owner request, given in session and paraphrased: now that Today If "the protocol itself" meant the reassembly classes' |
…nto 1.6.0 (#2449) - Added: IEEE802_11, the 802.11 MAC header behind radiotap, with the pcapkit.const.ieee802_11 type and subtype registries (#2607); the Radiotap entry drops its stale "no dissector yet" note and names its own registry and register_radiotap. - Added: ip_datagram and tcp_datagram beside dtls_handshake (#2619). - The conventions entry records #2607's ruling on a paywalled registry's pinned secondary source. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
refactor— changes neither behaviour nor performanceDescription of your pull request and other information
IP and TCP reassembly now have their own analysis modules, in the shape of DTLS's
dtls_handshake.pcapkit.foundation.analysis.ip.ip_datagramparses a reassembled datagram's payload by its payload protocol.pcapkit.foundation.analysis.tcp.tcp_datagramparses it by its port pair. Both returnNonefor a strict, incomplete datagram. The names follow the owner's choice on #2581.IP.submitandTCP.submitbuild theirDeferredfrom the same private helper, bound to the engine's own__protocol_type__, so a custom engine still parses with its own protocol. The docs note that exception wherever they say whatpacketholds.Behaviour is unchanged. The differential runs over every sample capture, on the default, dpkt and scapy engines, with strict on and off, and is byte-identical: 8,100 IPv4, 6 IPv6 and 1,458 TCP datagrams, including pickle round trips. A Sonnet cross-review reproduced it independently and returned GOOD TO GO. Its nits are folded in. The new tests fail without the change.
Closes #2581