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
refactor(registry): every class-level registry map gets its foundation.registry wrapper #2511
Owner ruling (this session, 2026-11-01), paraphrased: every registry map gets a matching registration wrapper in pcapkit.foundation.registry that does the same validation as the existing ones. Write that down as a convention, then audit main and the open PRs for gaps and fix them.
The established shape, read from main: a class-level map (Link.__proto__, IPv4.__option__, ICMPv4.__type__, ...) has two parts:
a register / register_<kind> classmethod that is the owning class's own. An inherited one counts only when it is typed and validated for exactly that map's keys (owner, 2026-11-01, option 2 below): TCP/UDP keep Transport.register, while Link.register (EtherType) and Internet.register (TransType) do not cover FRAD, NETLINK, Loopback or IPX;
a public register_<name> function in pcapkit.foundation.registry.protocols, tagged # NOTE: <map path>. It checks the code against its enum with _check_code, checks the target (a protocol class or descriptor, or an existing _read_* parser name), calls the classmethod, logs, and for protocol maps records the name with _register_name.
Candidate gaps on main (to verify):IPX.__proto__, Loopback.__proto__, and SCTP's chunk/parameter/cause maps. The LinuxSLL/FRAD/NETLINK maps are #2510's.
Deliverables: the convention written into docs/source/contributing/conventions/registry-protocol.rst, the missing wrappers on main, and a list of any gaps in open PRs.
Owner clarification (2026-11-01), paraphrased: each map's register* classmethod is the owning class's own. On main, five map-owning classes define none and rely on an inherited one:
Owner chose option 2: an inherited register* classmethod counts when it is typed and validated for exactly that map's keys. So TCP and UDP keep Transport.register. IPX (inherits the TransType-typed Internet.register) and Loopback (inherits the EtherType-typed Link.register) each get their own here, and FRAD/NETLINK get theirs in #2510. The convention text in registry-protocol.rst will state that exception.
#2521 merged: it wrote the convention onto registry-protocol.rst and added main's missing wrappers (IPX, Loopback, SCTP's maps). The LinuxSLL, FRAD and NETLINK maps remain, and they are #2510's, landing in #2527. Blocked: this closes when #2527 merges.
Would like to consider splitting the registry/protocol.py into per layer or per protocol smaller files/submodules. And if splitting, should name the module registry.protocols. to follow protocols module's convention.
Paraphrased: you are considering splitting registry/protocols.py into per-layer or per-protocol submodules named registry.protocols.<submodule>, after pcapkit.protocols. That is a separate deliverable from this issue, so it is #2578, with options and a recommendation: per layer, with the package __init__ aggregating so public paths stay, done after #2527 and #2544. This issue still closes when #2527 merges.
#2527 merged, so the LinuxSLL, FRAD and NETLINK maps have their own register and wrappers (register_arphrd, register_frad, register_netlink). With #2521, that completes this issue.
Activity
JarryShaw commentedon Nov 1, 2026
Owner clarification (2026-11-01), paraphrased: each map's
register*classmethod is the owning class's own. On main, five map-owning classes define none and rely on an inherited one:FRADandNETLINKinheritLink.register(EtherType-typed): refactor(link): dispatch LinuxSLL's non-EtherType ARPHRD values through its own registry map #2510's scope.IPXinheritsInternet.register(TransType-typed), andLoopbackinheritsLink.register: this issue.TCPandUDPinheritTransport.register, which is typed for ports, the key both of their maps use.Sub-question for the owner: do
TCP/UDPneed their own override?Recommendation: 2.
Transport.registeralready matches both maps, and an override would only repeat it. The other four change either way.JarryShaw commentedon Nov 1, 2026
take 2.
JarryShaw commentedon Nov 1, 2026
Owner chose option 2: an inherited
register*classmethod counts when it is typed and validated for exactly that map's keys. SoTCPandUDPkeepTransport.register.IPX(inherits the TransType-typedInternet.register) andLoopback(inherits the EtherType-typedLink.register) each get their own here, andFRAD/NETLINKget theirs in #2510. The convention text inregistry-protocol.rstwill state that exception.feat(registry): give IPX and Loopback their own register, add registe…
docs(registry): state the wrapper naming rule's exceptions, restore I…
feat(registry): foundation.registry wrappers for IPX and SCTP sub-map…
JarryShaw commentedon Nov 1, 2026
#2521 merged: it wrote the convention onto registry-protocol.rst and added main's missing wrappers (IPX, Loopback, SCTP's maps). The LinuxSLL, FRAD and NETLINK maps remain, and they are #2510's, landing in #2527. Blocked: this closes when #2527 merges.
JarryShaw commentedon Nov 1, 2026
Would like to consider splitting the registry/protocol.py into per layer or per protocol smaller files/submodules. And if splitting, should name the module registry.protocols. to follow protocols module's convention.
JarryShaw commentedon Nov 1, 2026
Paraphrased: you are considering splitting
registry/protocols.pyinto per-layer or per-protocol submodules namedregistry.protocols.<submodule>, afterpcapkit.protocols. That is a separate deliverable from this issue, so it is #2578, with options and a recommendation: per layer, with the package__init__aggregating so public paths stay, done after #2527 and #2544. This issue still closes when #2527 merges.JarryShaw commentedon Nov 1, 2026
#2527 merged, so the LinuxSLL, FRAD and NETLINK maps have their own
registerand wrappers (register_arphrd,register_frad,register_netlink). With #2521, that completes this issue.