Skip to content

feat(net): Implement Display for ICMP Error messages inner packet#1569

Open
qmonnet wants to merge 1 commit into
mainfrom
pr/qmonnet/display-embedded
Open

feat(net): Implement Display for ICMP Error messages inner packet#1569
qmonnet wants to merge 1 commit into
mainfrom
pr/qmonnet/display-embedded

Conversation

@qmonnet
Copy link
Copy Markdown
Member

@qmonnet qmonnet commented May 29, 2026

While working on ICMP Error tests, I noticed I couldn't easily observe the headers for the inner packets embedded within the error messages. Implement trait Display for the types involved in inner packets embedded within ICMP Error messages, so that we can observe the inner headers as well with the packet dumper.

@qmonnet qmonnet self-assigned this May 29, 2026
@qmonnet qmonnet requested a review from a team as a code owner May 29, 2026 17:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends packet dumping so ICMP error messages can display embedded inner packet headers, including newly exposed accessors needed by the display code.

Changes:

  • Adds Display implementations for embedded/truncated ICMP, TCP, UDP, and embedded header containers.
  • Implements ICMPv6 display formatting.
  • Widens selected constants/accessors to pub(crate) for display support.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
net/src/packet/display.rs Adds display formatting for ICMPv6 and embedded/truncated inner headers.
net/src/headers/embedded_view.rs Makes embedded header accessors crate-private for reuse.
net/src/icmp4/truncated.rs Exposes truncated ICMPv4 type for display formatting.
net/src/icmp6/truncated.rs Exposes truncated ICMPv6 type for display formatting.
net/src/tcp/truncated.rs Exposes TCP truncated minimum header length for display formatting.
net/src/udp/truncated.rs Exposes UDP truncated minimum header length for display formatting.

Comment thread net/src/packet/display.rs Outdated
Comment thread net/src/packet/display.rs Outdated
Comment thread net/src/packet/display.rs
Implement trait Display for the types involved in inner packets embedded
within ICMP Error messages, so that we can observe the inner headers as
well with the packet dumper.

Signed-off-by: Quentin Monnet <qmo@qmon.net>
@qmonnet qmonnet force-pushed the pr/qmonnet/display-embedded branch from d197bd7 to adc435b Compare May 29, 2026 17:12
@qmonnet qmonnet enabled auto-merge May 29, 2026 17:13
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.

2 participants