Repository navigation
Conversation
|
Review: NEEDS CHANGES at Must fix:
Confirmed correct, no change needed: both wire layouts byte-exact against spec (v1: 16 bytes, v2: 20 bytes, verified field-by-field); the dispatch mechanism itself works as described (only the rule it applies is wrong, above); Minor, non-blocking: |
|
Coverage: 94.46% (unit tier, Python 3.15,
Per-file detail: the |
4767730 to
986e42f
Compare
|
All three required fixes applied and verified directly (new head |
|
NEEDS CHANGES (cross-review round 2, different model from the author). All three round-1 fixes independently re-derived as correct against the real spec (tcpdump.org, Linux kernel One blocker, trivial: Should-fix (not blocking): the Also flagging for awareness (not a defect in this PR): a predicted conflict with #2441 in |
986e42f to
3fb62f7
Compare
|
isort fix applied and verified directly (new head |
|
Confirmed CI's red X at this head is the same inherited |
3fb62f7 to
6df2526
Compare
|
Changelog bullet removed per #2449's new standing practice (centralized changelog, not per-PR). Verified directly: diff at new head |
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
6df2526 to
5dacd83
Compare
|
Rebased onto |
|
NEEDS CHANGES (Sonnet,
|
#2438) - An unassigned EtherType now stores Ethernet's <unassigned> pseudo-member, via the same EnumField post-processing, so the chain reads LINUX_SLL1:<unassigned> like Ethernet:<unassigned>. - The excluded hardware types keep forcing Raw from LINUX_SLL's _import_next_layer, recording the real protocol_type instead of -1. - Tests compare the stored value's repr against Ethernet's; review-history wording dropped; LinuxSLL/LinuxSLL2 roles qualified. - List the LINUX_SLL family in the ext.rst and protocols index tables. Link tests, dispatch registry and edge round trips pass; a sweep of all 65,536 protocol_type values matches Ethernet on value, class, chain and JSON.
|
Verified ( |
|
NEEDS CHANGES (Sonnet,
|
- Reword the packet_type comments so Sphinx no longer reads a type. - Qualify the id/alias roles in the three LINUX_SLL pages. - Move the excluded-arphrd rule, its constants and the shared helpers into linux_sll_base, so both versions read one set and v2 no longer imports private names from v1. - State the narrow-label rule once, as linux-sll-labels, and reference it. - Cut narration from the class docstrings, the NOTE, pep.rst and the tests.
|
Pushed |
|
NEEDS CHANGES (Sonnet,
|
) - Selector test points at the linux-sll-labels section instead of restating it. - Keep the InfiniBand note in _validate_link_addr only; make() docs shrink to two lines per link_addr_length. - Drop the SLL status line and base-class paragraph from pep.rst. - Document that string == compares against (cls, *id()); add a test.
|
Verified ( |
|
GOOD TO GO (Sonnet, |
- id() criterion: members-only and own-name-first tuples; ARP alone. - Drop the Shim6 narration and the SSL/TLS/DTLS grouping. - Versioned class names "may"; add #2443's selector ruling. - ProtoChain also matches aliases; ARP row names RARP/DRARP on 0x8035. - Cite pull requests with :pr:; no count.
Please follow the guide below
make pylint,make mypy,make isort)make testpasses, and a test case covers the changedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A, centralised in chore(docs): centralize 1.6.0 changelog updates in one place, not per-feature-PR #2449What is the purpose of your pull request?
feat— adds a featureDescription of your pull request and other information
Implements #2438:
LinuxSLL/LinuxSLL2dissectors forLINKTYPE_LINUX_SLL(113) andLINKTYPE_LINUX_SLL2(276), the Linux "cooked capture" header thattcpdump -i anycaptures use. Schema/data/protocol split per discussion #251, registered ontoFrame.__proto__andPCAPNG.__proto__.Shared base and selectors. Both classes subclass a plain
LINUX_SLLbase (linux_sll_base.py).LINUX_SLL.id()is('LINUX_SLL',),LinuxSLL.id()is('LINUX_SLL1', 'LINUX_SLL')andLinuxSLL2.id()is('LINUX_SLL2', 'LINUX_SLL'), so'LINUX_SLL'selects either version.'LINUX_SLL1'/'LINUX_SLL2'select only their own version, but only because they are not protocol-registry keys; the registry names'LinuxSLL'/'LinuxSLL2', like any class, select both.Next-layer dispatch matches
Ethernet.protocol_typeis an EtherType for everyarphrd_typeexcept the hardware types tcpdump.org names (NETLINK,IPGRE,IP6GRE,IEEE80211_RADIOTAP,FRAD), which are forced toRawwith the rawprotocol_typerecorded. Otherwiseprotocol_typegoes through the sameEnumFieldas Ethernet'stype, so the dispatch value, next layer and protochain match Ethernet for all 65,536 values (<unassigned>included); the header's ownprotocol_typefield stays a plainint, andLink.register()overrides apply.Round trips.
link_addr_lengthmay exceed the 8 octets kept inline (e.g. InfiniBand's 20-octet addresses), somake()allows each format's own field width.Tests.
tests/protocols/link/(incl.test_linux_sll_unit.py,test_linux_sll2_unit.py,test_linux_sll_selector_unit.py) and the dispatch-registry test: 157 passed, 992 subtests. Also adds the SLL payload builders and pinned targets toexamples/generators/dispatch.pyfor the dispatch-registry test.Closes #2438