Skip to content

docs(protocols): repair the protocol pages and cut their restatement (#719) - #1044

Merged
JarryShaw merged 2 commits into
mainfrom
docs/719-autodoc-protocols
Oct 5, 2026
Merged

JarryShaw merged 2 commits into
mainfrom
docs/719-autodoc-protocols

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • docs — documentation only

Description

Part of #719 (does not close it): the docs/source/pcapkit/protocols/ autodoc pages, 17 of 46 touched; the other 29 had nothing to fix or cut.

  • Header tables corrected against the code: Ethernet, VLAN and OSPF octet/bit columns, the IPv4/IPv6/Ethernet/AH field prefixes, IHL's expansion.
  • NGAP: an unknown IE or procedure code resolves to a non-registering Unassigned member (the page said a self-extending Unassigned_<n>).
  • Unresolved references fixed (AH, PCAP Header, NGAP next-layer hook) and the mermaid click anchors for IPv4, IPv6, TCP, UDP and the four layer bases.
  • Prose tightened on L2TP, VLAN, C-Tag, S-Tag, IPv6-Ext, ESP and PCAP-NG, keeping the rationale.

Sphinx -n warnings for these pages, fresh build each side: 4 on main, 1 after (the remaining AppType reference is not in scope), none new.

…719)

- Fix header tables whose offsets or field names disagreed with the code:
  Ethernet, VLAN and OSPF octet/bit columns, the IPv4/IPv6 info-key prefix,
  the AH field prefix, and IHL's expansion.
- NGAP: an unknown IE or procedure code resolves to a non-registering
  'Unassigned' member, not 'Unassigned_<n>' on a self-extending enum.
- Repair unresolved references (AH, PCAP Header, NGAP next-layer hook) and
  the mermaid click anchors for IPv4, IPv6, TCP, UDP and the four layer bases.
- Tighten the L2TP, VLAN, C-Tag, S-Tag, IPv6-Ext, ESP and PCAP-NG prose,
  keeping the rationale; drop a duplicated index rule and timed wording.

Sphinx -n warnings on these pages: 4 before, 1 after. tests/project passes.
@JarryShaw JarryShaw added docs Pull requests that change documentation only (docs: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on 4352cce1b: NEEDS CHANGES (ran on Opus).

One blocking item:

  • docs/source/pcapkit/protocols/link/l2tp.rst:59-60 says _guess_version recognises the HTTP/2 preface, "else trial-parsing each candidate". That skips a step. pcapkit/protocols/application/http.py:356 checks for an HTTP/1 request-line or status-line (_test_start_line) before any trial parse, and commits to HTTPv1 on a match. Suggested: "recognising the HTTP/2 preface or an HTTP/1 start line, else trial-parsing each candidate".

Confirmed: the octet and bit columns (Ethernet, VLAN, OSPF, by parse), the ethernet./ah./frag./hopopt. prefixes, the NGAP unknown-code wording (by probe), the Mermaid anchors (8 of 45 missing on main, 0 on the branch), and Sphinx -n (−3 warnings, none new). tests/project: 271 passed, 5 skipped.

Non-blocking, outside this PR's files: internet/ipv6_opts.rst uses opt. where the parsed key is opts, and the ngap.py module docstring still has the old Unassigned_<n> wording.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
)

- l2tp.rst: HTTP._guess_version tests for an HTTP/1 request-line or
  status-line (_test_start_line) after the HTTP/2 preface and before any
  trial parse; the parenthetical now names both identification steps.
- ipv6_opts.rst: the field table's prefix is now ``opts.``, the key
  IPv6-Opts nests under inside ``ipv6`` (alias 'IPv6-Opts' lstripped and
  lowered in IPv6._decode_next_layer); it read ``opt.``.
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 5, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on af35550cf: GOOD TO GO (ran on Sonnet).

  • l2tp.rst now lists HTTP._guess_version's steps in their real order: the HTTP/2 preface (http.py:288-329), then the HTTP/1 start line (:356-357), then the trial parse (:430-435).
  • ipv6_opts.rst: opts. is the parsed key. It comes from ipv6.py:397, alias.lstrip('IPv6-').lower(), applied to 'IPv6-Opts'. A parse of IPv6 with next header 60 gives info['opts'] = IPv6_Opts(next=17, length=8, …) and no opt key. The octet and bit columns match the schema.
  • Sphinx -n: no new warnings; main has 1303 and the branch 1300. tests/project: 275 passed, 1 skipped.

The ngap.py module docstring still has the old Unassigned_<n> wording. It goes to the #719 docstring pass.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
@JarryShaw
JarryShaw merged commit ed3c492 into main Oct 5, 2026
11 of 12 checks passed
@JarryShaw
JarryShaw deleted the docs/719-autodoc-protocols branch October 5, 2026 20:08
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 5, 2026
@JarryShaw JarryShaw added this to the 1.5 milestone Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Pull requests that change documentation only (docs: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant