feat(net): Implement Display for ICMP Error messages inner packet#1569
Open
qmonnet wants to merge 1 commit into
Open
feat(net): Implement Display for ICMP Error messages inner packet#1569qmonnet wants to merge 1 commit into
qmonnet wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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
Displayimplementations 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. |
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>
d197bd7 to
adc435b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.