Skip to content

Extend IGMP slice implementation - #160

Merged
JulianSchmid merged 2 commits into
masterfrom
igmp-slice-continue
Jul 21, 2026
Merged

Extend IGMP slice implementation#160
JulianSchmid merged 2 commits into
masterfrom
igmp-slice-continue

Conversation

@JulianSchmid

@JulianSchmid JulianSchmid commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added IGMP v1/v2/v3 support for parsing and building packets, including access to IGMP headers via transport handling.
    • Added zero-copy, typed IGMP message views (queries, membership reports, leave-group, and unknown IGMP) plus IGMPv3 source/group record iteration.
  • Documentation

    • Updated README, crate docs, changelog, and examples to reflect IGMP support and new serialization helpers.
  • Tests

    • Expanded slicing, checksum, transport decoding, and packet-composition test coverage for IGMP.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9dd9d248-0aa3-4247-a9fc-6db266f14259

📥 Commits

Reviewing files that changed from the base of the PR and between ea3f6d3 and 4459414.

📒 Files selected for processing (2)
  • etherparse/src/transport/igmp/membership_query_with_sources_slice.rs
  • etherparse/src/transport/igmp/membership_report_v2_slice.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • etherparse/src/transport/igmp/membership_report_v2_slice.rs
  • etherparse/src/transport/igmp/membership_query_with_sources_slice.rs

📝 Walkthrough

Walkthrough

IGMP support is extended across typed zero-copy message slices, transport parsing, packet building, payload representations, composition tests, examples, and documentation. IGMPv1/v2/v3 messages now have typed accessors, iterator support, checksum handling, and IPv4/IPv6 transport integration.

Changes

IGMP protocol integration

Layer / File(s) Summary
Typed IGMP slices and validation
etherparse/src/transport/igmp/*slice.rs, etherparse/src/transport/igmp_slice.rs, etherparse/src/transport/igmp/mod.rs
IgmpSlice is now a typed enum covering query, report, leave-group, and unknown messages, with zero-copy accessors and IGMPv3 source/group-record iteration.
Transport parsing and payload variants
etherparse/src/transport/transport_*.rs, etherparse/src/sliced_packet_cursor.rs, etherparse/src/lax_*.rs, etherparse/src/packet_headers.rs, etherparse/src/payload_slice.rs
IGMP is represented in transport and payload enums, parsed by packet cursors and header readers, and reported with IGMP-specific length errors.
Packet construction
etherparse/src/packet_builder.rs, etherparse/src/transport/igmp_header.rs
PacketBuilder adds IGMP transitions and serialization methods, maps IGMP into IPv4/IPv6 protocol fields, and includes IGMP header sizing and writing.
Composition and support coverage
etherparse/src/compositions_tests.rs, etherparse/src/test_gens/mod.rs, etherparse/src/test_packet.rs, etherparse/proptest-regressions/*, etherparse/src/*packet.rs
Composition tests, generators, regression data, and packet helpers now include IGMP transport headers, payloads, protocol values, and round trips.
Documentation and examples
README.md, changelog.md, etherparse/src/lib.rs, etherparse/examples/read_by_slicing.rs, etherparse/src/lax_packet_headers.rs
Protocol lists, API references, changelog entries, examples, and parsing documentation describe IGMP support.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: expanding the IGMP slice implementation and related support.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch igmp-slice-continue

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@etherparse/src/transport/igmp/membership_query_with_sources_slice.rs`:
- Around line 35-38: Update the # Safety documentation for from_slice_unchecked
to require that slice contains the complete declared payload: at least 12 +
num_of_sources * 4 bytes, where num_of_sources is read from the header. Retain
the existing minimum header-length requirement while explicitly covering all
source addresses used by source_addrs_bytes().

In `@etherparse/src/transport/igmp/membership_report_v2_slice.rs`:
- Line 9: Correct the ASCII diagram’s Type field in the IGMPv2 membership report
documentation to 0x16, matching the struct’s documented message type and the
IgmpSlice::from_slice dispatch constant.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 281c47a7-06e9-4b77-b005-a14e393985f6

📥 Commits

Reviewing files that changed from the base of the PR and between f56e12a and ea3f6d3.

📒 Files selected for processing (33)
  • README.md
  • changelog.md
  • etherparse/examples/read_by_slicing.rs
  • etherparse/proptest-regressions/compositions_tests.txt
  • etherparse/src/compositions_tests.rs
  • etherparse/src/lax_packet_headers.rs
  • etherparse/src/lax_payload_slice.rs
  • etherparse/src/lax_sliced_packet.rs
  • etherparse/src/lax_sliced_packet_cursor.rs
  • etherparse/src/lib.rs
  • etherparse/src/net/ipv6_fragment_header.rs
  • etherparse/src/packet_builder.rs
  • etherparse/src/packet_headers.rs
  • etherparse/src/payload_slice.rs
  • etherparse/src/sliced_packet.rs
  • etherparse/src/sliced_packet_cursor.rs
  • etherparse/src/test_gens/mod.rs
  • etherparse/src/test_packet.rs
  • etherparse/src/transport/igmp/igmp_unknown_slice.rs
  • etherparse/src/transport/igmp/leave_group_slice.rs
  • etherparse/src/transport/igmp/membership_query_slice.rs
  • etherparse/src/transport/igmp/membership_query_with_sources_slice.rs
  • etherparse/src/transport/igmp/membership_report_v1_slice.rs
  • etherparse/src/transport/igmp/membership_report_v2_slice.rs
  • etherparse/src/transport/igmp/membership_report_v3_slice.rs
  • etherparse/src/transport/igmp/mod.rs
  • etherparse/src/transport/igmp/report_group_record_v3_slice.rs
  • etherparse/src/transport/igmp_header.rs
  • etherparse/src/transport/igmp_slice.rs
  • etherparse/src/transport/transport_header.rs
  • etherparse/src/transport/transport_slice.rs
  • etherparse/tests/transport/icmpv4.rs
  • etherparse/tests/transport/icmpv6.rs

Comment thread etherparse/src/transport/igmp/membership_query_with_sources_slice.rs Outdated
Comment thread etherparse/src/transport/igmp/membership_report_v2_slice.rs Outdated
@JulianSchmid
JulianSchmid merged commit 1f111d3 into master Jul 21, 2026
12 checks passed
@JulianSchmid
JulianSchmid deleted the igmp-slice-continue branch July 21, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant