You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5dacd83
Browse filesBrowse the repository at this point in the historyBrowse files
feat(link): implement LINUX_SLL and LINUX_SLL2 dissectors
Wave 2 of the roadmap. Neither `LINKTYPE_LINUX_SLL` (113) nor `LINKTYPE_LINUX_SLL2`
(276) -- the Linux "cooked capture" headers every `tcpdump -i any` capture uses --
had a dissector, despite both DLTs already being registered.
- Add `LinuxSLL`/`LinuxSLL2` (schema/data/protocol split per discussion #251),
registered onto `Link`, `Frame.__proto__` and `PCAPNG.__proto__`.
- Next-layer dispatch is an EXCLUSION list: per tcpdump.org's own docs,
`protocol_type` is an EtherType for every `arphrd_type` except five
(`NETLINK`, `IPGRE`, `IP6GRE`, `IEEE80211_RADIOTAP`, `FRAD`, named constants
in `linux_sll.py`), not an inclusion list of `Hardware.Ethernet` alone. An
unregistered `protocol_type` falls back to `Raw` at the payload level
instead of raising and losing the whole header.
- `make()` allows `link_addr_length` up to each format's own field width
(0xFFFF for v1, 0xFF for v2), not capped at 8, so a round trip survives a
hardware address (e.g. InfiniBand) longer than the 8 octets kept inline.
- The two headers disagree on field order and two fields narrow in v2, so
they don't share a base class; the two routines they do share (the
`arphrd_type`-gated dispatch, and link-layer address validation) live once
in `linux_sll.py` rather than twice.
- Export the new classes from every aggregator and document them under
`docs/source/pcapkit/protocols/link/`; sync `pep.rst`'s roadmap and record
why the pair didn't want the shared-base treatment.
- `NOT_A_COPY`/`UNRELATED` entries in `test_rfc_constants_one_home_1739_unit.py`
for the headers' fixed lengths and `link_addr_length`'s own 0xFFFF bound.
Tests: the real five-value exclusion list staying Raw, non-excluded
non-Ethernet hardware types (loopback, PPP, SLIP/CSLIP) dispatching by
EtherType, an unregistered EtherType not breaking the header,
`link_addr_length > 8` round trips, padding/reserved round trip, make()
validation against each format's real field width, registry wiring, and
full-capture extraction. 100% coverage on every new file;
`tests/protocols/link/` (136 tests/868 subtests) and `tests/project/` (2107
tests) pass with these changes in place.
Closes#2438
0 commit comments