Skip to content

feat(vendor): add the ARPHRD crawler, DATA-attribute shape (#2495) - #2497

Merged
JarryShaw merged 1 commit into
mainfrom
feat/2495-arphrd-vendor-crawler
Oct 31, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
feat/2495-arphrd-vendor-crawler

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Closes #2495 in part (ARPHRD side; TLS crawler is separate).

Every pcapkit.const module needs a matching pcapkit.vendor crawler, with no exception (owner ruling). A hand-maintained registry uses the existing DATA-attribute pattern (pcapkit.vendor.ipx.packet/socket), not a live-URL scrape.

  • New pcapkit.vendor.linux.arphrd.ARPHRD crawler; regenerating pcapkit.const.linux.arphrd from it is a no-op against the tree (only docstrings change to the standard templated wording).
  • Rewrite const-vendor-pairing.rst to drop the exception section and document the DATA pattern against its real precedent.

Tests: 124 passed, 1 pre-existing skip, 1373 subtests.

@JarryShaw JarryShaw added feat Pull requests that add a new capability (feat: subject prefix) review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 31, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO (Sonnet, 9423c1abf). Shape matches vendor.ipx.packet's precedent exactly (DATA dict, no-arg request(), same process()/count()/FLAG). Regenerating offline (no network needed) reproduces the const module byte-identically except docstrings. 143 passed, 1408 subtests across six suites. Caveat the reviewer flagged and I did not close: the DATA dict was checked against the committed const file, not against the real <linux/if_arp.h> -- that's circular, since the const file was itself hand-transcribed from the header originally. Worth a one-time check against the actual kernel header before merge. Merge is yours.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 31, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 31, 2026
Every pcapkit.const module needs a matching pcapkit.vendor crawler, with no
exception (owner ruling on #2495) -- a hand-maintained registry uses the
existing DATA-attribute pattern (pcapkit.vendor.ipx.packet/socket) instead of
a live-URL scrape.

- New pcapkit.vendor.linux.arphrd.ARPHRD crawler, DATA transcribed from
  <linux/if_arp.h>, same member/value/FLAG/_missing_ shape as the committed
  const module -- regenerating is a no-op against the tree.
- Regenerate pcapkit.const.linux.arphrd from it; only the docstrings change
  to the standard templated wording.
- Rewrite const-vendor-pairing.rst: drop the exception section, document the
  DATA-attribute pattern against its real precedent.
- Bump test_vendor_missing_body_unit.py's crawler-with-miss-line count.

Tests: 124 passed, 1 pre-existing skip, 1373 subtests, across the convention,
vendor-miss-body, public-api and registry-protocol suites.
@JarryShaw JarryShaw added review: pending No verdict for the current head - never reviewed, or the head moved since the last one and removed review: good-to-go Cross-review at the current head says ready; CI state is separate labels Oct 31, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebased onto main after the epilog-link fix (2f6c33383) that main's own CI caught -- this branch inherited that failure through the shared tree, unrelated to this PR's content. Fast-forward, new head 2198c1130. Re-review needed.

@JarryShaw
JarryShaw force-pushed the feat/2495-arphrd-vendor-crawler branch from 9423c1a to 2198c11 Compare October 31, 2026 16:34
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO (Sonnet, 2198c1130). The ARPHRD crawler patch is byte-identical to the previous review (range-diff shows =); the only diff from the new base is the two unrelated doc commits already on main. 60 passed, 1 skipped, 1028 subtests across the four relevant suites. Merge is yours.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 94.50% (unit tier, Python 3.15, 2198c1130, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19700 133 2632 120 98.85%
pcapkit/corekit 2605 74 818 37 96.52%
pcapkit/dumpkit 281 3 100 3 98.43%
pcapkit/foundation 3070 24 1072 26 98.79%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 18303 195 4818 181 98.37%
pcapkit/toolkit 924 36 334 10 95.55%
pcapkit/utilities 502 7 144 5 98.14%
pcapkit/vendor 4474 1864 1024 168 55.11%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw merged commit 57ff1c8 into main Oct 31, 2026
63 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 31, 2026
@JarryShaw
JarryShaw deleted the feat/2495-arphrd-vendor-crawler branch October 31, 2026 18:22
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 31, 2026
JarryShaw added a commit that referenced this pull request Oct 31, 2026
pcapkit.const.sslv2's two modules were hand-curated with no
pcapkit.vendor.sslv2 crawler, violating the const-vendor-pairing rule
(#2495: "ALL const MUST have its own vendor crawler... use the DATA
attribute... no exception").

- Add pcapkit.vendor.sslv2 (handshake_type, version), mirroring the
  ARPHRD precedent (#2497): each Vendor subclass's request() returns a
  DATA dict transcribed from the expired SSLv2 draft
  (draft-hickman-netscape-ssl-00) instead of fetching a URL.
- Wire SSLv2_HandshakeType and SSLv2_Version into
  pcapkit.vendor.__all__.
- Regenerate both const modules from the crawlers. Only drift: the
  docstring (moved to the crawler) and Version.SSLv2's literal
  (0x0002 -> 2, the crawler's decimal rendering). A second run is a
  byte-for-byte no-op.
- Bump EXPECTED_CRAWLERS_WITH_CONSTANT_MISS_LINES 35->37 for the two
  new crawlers.
- Update docs/source/pcapkit/const/sslv2.rst and the now-stale
  "hand-curated, no crawler" comments in two tests.

Verified: tests/vendor/, tests/const/, the sslv2-specific tests, and
tests/project/test_public_api.py all green.
JarryShaw added a commit that referenced this pull request Oct 31, 2026
pcapkit.const.sslv2's two modules were hand-curated with no
pcapkit.vendor.sslv2 crawler, violating the const-vendor-pairing rule
(#2495: "ALL const MUST have its own vendor crawler... use the DATA
attribute... no exception").

- Add pcapkit.vendor.sslv2 (handshake_type, version), mirroring the
  ARPHRD precedent (#2497): each Vendor subclass's request() returns a
  DATA dict transcribed from the expired SSLv2 draft
  (draft-hickman-netscape-ssl-00) instead of fetching a URL.
- Wire SSLv2_HandshakeType and SSLv2_Version into
  pcapkit.vendor.__all__.
- Regenerate both const modules from the crawlers. Only drift: the
  docstring (moved to the crawler) and Version.SSLv2's literal
  (0x0002 -> 2, the crawler's decimal rendering). A second run is a
  byte-for-byte no-op.
- Bump EXPECTED_CRAWLERS_WITH_CONSTANT_MISS_LINES 35->37 for the two
  new crawlers.
- Update docs/source/pcapkit/const/sslv2.rst and the now-stale
  "hand-curated, no crawler" comments in two tests.

Verified: tests/vendor/, tests/const/, the sslv2-specific tests, and
tests/project/test_public_api.py all green.
JarryShaw added a commit that referenced this pull request Nov 1, 2026
* feat(application): add an SSLv2 dissector

- SSLv2 (draft-hickman-netscape-ssl-00) subclasses SSL and joins
  SSL.id(). Its module and class are named SSLv2.
- TLS.read tries TLS first. SSLv2 is taken only when TLS rejects the
  record and the payload is a complete CLIENT-HELLO or SERVER-HELLO that
  passes the hello length probe; anything else stays Raw.
- The TLS object that adopts an SSLv2 parse reports its 2- or 3-octet
  header as length, so packet splits as a direct SSLv2 parse does.
- TLS.from_data rebuilds an adopted SSLv2 record as SSLv2, so a port-443
  hello round-trips byte-exact through TCP.from_data.
- Add pcapkit.const.sslv2 (HandshakeType, Version) and bump the const
  census pins by +2 over #2441's.

Part of #2457.

* fix(tests): bump the census pins by the full +2 sslv2 adds

sslv2.HandshakeType and sslv2.Version are 2 new const modules, but
the branch's pin bumps were all +1. Each pinned count needed the
second +1:

- test_const_enum_builtin_parity: ints 118->119, enums 134->135,
  distinct modules 128->129
- test_const_enum_get: enums 124->125, covered 121->122
- test_const_enum_lookup: enums 118->119
- test_const_registry_protocol: all_files 128->129, generated 111->112

Verified: all four files pass clean (128 tests, 1522 subtests).

* fix(vendor): add the SSLv2 crawler, DATA-attribute shape

pcapkit.const.sslv2's two modules were hand-curated with no
pcapkit.vendor.sslv2 crawler, violating the const-vendor-pairing rule
(#2495: "ALL const MUST have its own vendor crawler... use the DATA
attribute... no exception").

- Add pcapkit.vendor.sslv2 (handshake_type, version), mirroring the
  ARPHRD precedent (#2497): each Vendor subclass's request() returns a
  DATA dict transcribed from the expired SSLv2 draft
  (draft-hickman-netscape-ssl-00) instead of fetching a URL.
- Wire SSLv2_HandshakeType and SSLv2_Version into
  pcapkit.vendor.__all__.
- Regenerate both const modules from the crawlers. Only drift: the
  docstring (moved to the crawler) and Version.SSLv2's literal
  (0x0002 -> 2, the crawler's decimal rendering). A second run is a
  byte-for-byte no-op.
- Bump EXPECTED_CRAWLERS_WITH_CONSTANT_MISS_LINES 35->37 for the two
  new crawlers.
- Update docs/source/pcapkit/const/sslv2.rst and the now-stale
  "hand-curated, no crawler" comments in two tests.

Verified: tests/vendor/, tests/const/, the sslv2-specific tests, and
tests/project/test_public_api.py all green.

* Merge remote-tracking branch 'origin/main' into feat/2457-sslv2-dissector

Co-authored-by: JarryShaw <15666417+JarryShaw@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JarryShaw <15666417+JarryShaw@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Pull requests that add a new capability (feat: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Write a pcapkit/vendor/tls crawler for ContentType and HandshakeType

1 participant