Repository navigation
feat(registry): foundation.registry wrappers for IPX and SCTP sub-maps; record the convention (#2511) - #2521
Conversation
…convention (#2511) - add register_ipx for IPX.__proto__, and register_sctp_chunk, register_sctp_parameter and register_sctp_cause for SCTP's chunk, parameter and cause maps, each shaped like its siblings: _check_code, a parser-name or protocol check, the owning classmethod, a debug log, _register_name for the __proto__ map, schema= for the parser maps - export them from pcapkit.foundation.registry, pcapkit.foundation and pcapkit.all; document them on the registry page and in ext.rst, whose ICMP and SCTP extension-point rows now name the wrappers - record the two-part shape as "Registration Wrappers" on the registry-protocol conventions page - add test_registry_wrapper_coverage_2511_unit, which fails on a protocol class map no wrapper's "# NOTE:" tag names unless excused, and case the new wrappers in the code-check, symmetry and wrapper-route suites
|
Cross-review (Sonnet) at
Fix round dispatched. It is pushed once queued runs drop below 20. Loopback's int keys raise the open question posted on #2510. |
…r_loopback (#2511) - IPX and Loopback define their own register classmethod, since the inherited Internet.register and Link.register are typed for TransType and EtherType. - IPX declares __proto_key__ = (Packet, True), so a code= key is checked as register_ipx checks its own; register_ipx also takes a bare int now. - register_loopback joins the link-layer wrappers, exported and documented beside its siblings; _check_code takes kind=None for an int-only check. - The coverage test drops Loopback from EXCUSED and pins the classmethod half, listing TCP's and UDP's inherited Transport.register in INHERITED. - registry-protocol.rst states the inherited-classmethod exception and the __proto__ wrapper naming rule. Registry and protocol-code test modules pass; the new pins fail without the fix.
|
The fix round is done locally (
|
…PX's junk-code pin (#2511) - registry-protocol.rst names every __proto__ wrapper departing from the naming rule (register_pcap, register_pcapng, register_apptype) with its reason, and says Internet.register and Link.register are the parents' types. - The code-check suite again rejects None and a str code for every number registrar, register_ipx included; it fails if _check_code lets them through. - IPX's __proto_key__ doc-comment states the bare-int key without history.
|
|
Owner chose 1(c) and 2(a). IPX declares |
|
Fix rounds at
Non-blocking: the "tagged |
|
Coverage: 93.96% (unit tier, Python 3.15,
Per-file detail: the |
…de (#2510) - register_frad and register_netlink call _check_code(code, None, owner), the bare-int check #2521 added, in place of _check_number. - _check_number is deleted; it raised the same messages _check_code does with kind=None. Tests: test_int_only_registrars_reject_anything_but_an_int checks FRAD through _check_code, with the same expected messages.
#2490, #2575) #2541's exception table was built on a base without #2528 and #2542, so main fails the member-order guard: #2528 put DTLS back in order, and #2542 renamed the IGMP classes to IGMPv3. Drop DTLS and re-key the IGMP entries. #2509 merged before #2521 required a wrapper for every class-level map, so Radiotap.__proto__ has none. Nothing dispatches by it yet; excuse it until #2575 adds Radiotap.register and register_radiotap.
- Added: one's-complement checksum verification and computation (#2543), and the IPX and SCTP registration wrappers (#2521). - Folded into unreleased entries: LinuxSLL/FRAD/Netlink registries (#2527), the IGMP class names (#2542), TLS record chaining and the SSLv2 trial's warnings (#2537), DTLS reassembly via Extractor and toolkit (#2528), and IP_Pseudo's walk at any depth (#2543). ICMP drops its stale checksum line. - Breaking: make() checksums, DRARP's module (#2540), IPv6 overlapping fragments (#2569), TCP_GAP_LIMIT replacing TCP.__window__ (#2579), and Extractor/extract's positional dtls (#2528). - Changed: member order (#2490), conventions (#2542, #2521, #2570), CI -n logical (#2572). Fixed: AppType.get (#2568), trial warnings (#2519, #2577). - 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?
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseconst— regenerates constant or registry tables, members keeping their numeric valuesDescription of your pull request and other information
Part of #2511. The LinuxSLL, FRAD and NETLINK maps are covered by #2510.
register_ipx,register_sctp_chunk,register_sctp_parameterandregister_sctp_causeare added tofoundation.registry.protocols. Each follows the existing wrappers: a# NOTE: <map>tag,_check_codeand a target check, the classmethod call, and_register_namefor protocol maps. They are exported and documented alongside the others.registry-protocol.rsthas a new Registration Wrappers section. It states the two-part shape and the exception for inherited classmethods (owner's option 2 on refactor(registry): every class-level registry map gets its foundation.registry wrapper #2511).ext.rst: the SCTP and ICMP extension-point rows now name the wrappers.Loopback's wrapper is deferred to the link-layer section, which #2510 is editing. Its int keys raise a question that is posted here once the review lands.