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
Commit d1e4b4e
Browse filesBrowse the repository at this point in the historyBrowse files
feat(internet): implement IGMP v1/v2 as an Internet subclass
Closes#2439
- Add pcapkit/protocols/internet/igmp.py, with its data and schema modules,
covering IGMPv1 (RFC 1112 appendix I) and IGMPv2 (RFC 2236 sec. 2) from one
8-octet schema/data/protocol triple, per discussion #251. Type codes
cross-checked against RFC 1112 appendix I, RFC 2236 sec. 2.1, and IANA's
IGMP Type Numbers registry: Membership Query 0x11, v1 Report 0x12, v2
Report 0x16, Leave Group 0x17. A type outside those four -- an IGMPv3
Membership Report, DVMRP, and so on -- raises ProtocolError in read() so
the dispatch machinery's beholder falls back to Raw instead of mis-decoding
it through the v1/v2 layout.
- Add pcapkit/const/igmp/type.py and pcapkit/vendor/igmp/type.py, a new
const registry/vendor crawler pair generated from IANA's IGMP Type
Numbers CSV, formalising the raw hex values pcapkit/protocols/internet/mh.py
already referenced opaquely.
- Register IGMP onto Internet.__proto__ at TransType.IGMP (protocol number
2), and wire it into every protocols/const/vendor aggregator's __all__.
IGMPv3 (RFC 3376)'s group-record-list body is out of scope, left to a
follow-up.
- Update tests/protocols/test_dispatch_registry_unit.py and four
tests/const sweep tests for the new dispatch entry and const enum; add a
dispatch-probe builder for TransType.IGMP in examples/generators/dispatch.py.
- Add tests/protocols/internet/test_igmp_unit.py: byte fixtures for every
v1/v2 message type, a checksum-validation test, parse/make round trips,
and a regression pair proving an IGMPv3 Membership Report raises
ProtocolError directly and falls back to Raw under IPv4 dispatch.
- Open docs/source/changelog/1.6.0.rst with this PR's bullet, add the
wave-2 index entry to docs/source/changelog.rst, and regenerate
CHANGELOG.md to match.
Build: mypy and isort clean on every changed pcapkit/ file (pylint's
redefined-builtin/unused-argument noise matches AH/IPX precedent).
tests/protocols/internet/test_igmp_unit.py,
tests/project/test_issue_refs_in_comments.py,
tests/project/test_changelog_md.py and
tests/protocols/test_dispatch_registry_unit.py all pass.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,12 @@
2
2
3
3
Wave 2 of the roadmap, per the contributing docs' enhancement-proposal page: the protocol pairs that wanted a shared abstract base, and the two that simply had no dissector at all.
4
4
5
+
### pcapkit.protocols
6
+
7
+
#### Added
8
+
9
+
- IGMPv1 [[RFC 1112](https://datatracker.ietf.org/doc/html/rfc1112)] and IGMPv2 [[RFC 2236](https://datatracker.ietf.org/doc/html/rfc2236)] as an `Internet` subclass (`pcapkit.protocols.internet.igmp`), one schema/data/protocol triple covering both versions since they share the same 8-octet message shape ([#251](https://github.com/JarryShaw/PyPCAPKit/discussions/251), [#2439](https://github.com/JarryShaw/PyPCAPKit/issues/2439), [#2444](https://github.com/JarryShaw/PyPCAPKit/pull/2444)). A new `Type` registry, generated from IANA's *IGMP Type Numbers*, formalises the raw type octets `pcapkit.protocols.internet.mh` already referenced opaquely. A message whose type is not one of the four IGMPv1/v2 types falls back to `Raw` rather than being mis-decoded through the v1/v2 layout. IGMPv3 [[RFC 3376](https://datatracker.ietf.org/doc/html/rfc3376)]'s group-record-list body is a materially different shape and is left to a follow-up.
10
+
5
11
---
6
12
7
13
Full changelog: <https://jarryshaw.github.io/PyPCAPKit/changelog.html>
0 commit comments