Add packet sniffer feature #144
Open
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.
Hello,
Please note that I am not fluent in English, so I used a translation tool to write this pull request. I apologize in advance for any awkward wording.
This contribution introduces a sniffer feature, inspired by the functionality provided in
mavlink-router. The purpose is to enable a similar capability directly inmavp2p, allowing users to conveniently inspect MAVLink traffic without relying on external tools.To use the sniffer feature, specify the desired system ID with the
--sniffer-sysidstartup option. This system ID will then be treated as a "sniffer." When enabled,mavp2pwill attempt to forward all incoming packets to the designated sniffer. The default value is0(zero), which disables the feature. If forwarding is attempted back to the same sender (self-forwarding) or if the node with the specified sniffer system ID is not present on the network, a warning will be displayed and the forwarding will not be performed.mavp2p --sniffer-sysid=30 udps:0.0.0.0:14550 # System ID 30 is treated as a 'sniffer'I am not very familiar with the Go language, so some parts of my implementation may not fully follow common practices or might look unusual. I would greatly appreciate any feedback or suggestions for improvement.
Thank you for your consideration.