Skip to content

refactor(link): dispatch LinuxSLL's non-EtherType ARPHRD values through its own registry map #2510

Open

Description

@JarryShaw

Owner ruling (this session, 2026-11-01), paraphrased: the link dissectors LinuxSLL dispatches by arphrd_type should index by their ARPHRD value, and LinuxSLL should hold those values in a registry map of its own instead of a hard-coded branch chain.

Scope

  • FRAD, GRE and NETLINK: __index__ returns the matching pcapkit.const.linux.arphrd.ARPHRD member (each currently raises).
  • LinuxSLL overrides __proto__ with its own map keyed by the non-EtherType ARPHRD values, as FRAD already does for NLPID. _import_next_layer dispatches through that map first, then hands every other value to super()._import_next_layer for the EtherType path. The _ARPHRD_NOT_ETHERTYPE branch chain goes.
  • LinuxSLL, FRAD and NETLINK each define their own register classmethod. Today FRAD and NETLINK inherit Link.register, which is EtherType-typed.
  • The new map gets its register classmethod and a register_* wrapper in pcapkit.foundation.registry.protocols, shaped like register_ethertype. The same applies to the FRAD.__proto__ and NETLINK.__proto__ maps (see refactor(registry): every class-level registry map gets its foundation.registry wrapper #2511).
  • IEEE80211_RADIOTAP joins the map alongside feat(link): add a radiotap dissector for IEEE80211_RADIOTAP on LinuxSLL #2509; whichever of the two lands second adopts the other.

Open detail: GRE covers two ARPHRD values, but __index__ can return only one. Recommendation: ARPHRD.IPGRE, with both keys registered.

Activity

  1. added
    refactorRestructuring for its own sake — neither a fix nor a new capability (refactor: prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Nov 1, 2026
  2. moved this to Pending in PyPCAPKiton Nov 1, 2026
  3. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Nov 1, 2026
  4. moved this from Pending to WIP in PyPCAPKiton Nov 1, 2026
  5. JarryShaw commented on Nov 1, 2026

    @JarryShaw
    OwnerAuthor

    Handed over from #2509's merge: once Radiotap lands, every _ARPHRD_NOT_ETHERTYPE member has a dissector. That makes LinuxSLL._import_next_layer's final Raw fallback unreachable, and leaves test_the_non_ethertype_arphrds_are_kept_raw (SLL1/SLL2) looping over (). The registry map here decides whether the fallback stays (tested with a patched entry) or goes, along with that test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorRestructuring for its own sake — neither a fix nor a new capability (refactor: prefix)wipWork in flight - a covering PR is open or an agent is actively on it

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions