-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for sending/receiving ICMP packets (and more generally raw IP packets)? #2659
Comments
Does the various OSes even provide an async API for this? |
You might want to check out something like As @Darksonn said, I'm not sure if there is a cross-platform way for Tokio to abstract over raw IP packets? |
The next step would be to make a concrete proposal on how to do this.
I don't believe any of the core maintainers have a need for this functionality, so it would need to be user contributed. |
FWIW: This is a library implement ICMP ping using And this is a library implement ICMP ping using Based on these two libraries, let me try to answer these questions:
If we want to add an
It should be fine for basic pinging functionality, but once you want to implement more complex features, there will be some privilege issues:
I think the answer is Yes. |
Using raw sockets and/or advanced features would assume that the binary is run as |
Hi. Are there any active plans in regards to supporting this? Was planning to write it myself, but can't imagine it's going to help anyone if we have yet another packet. What would it take to start adding such support directly to tokio, or is this deemed out of scope? |
There are no active plans at this time. In general, I would start by figuring out the minimal support needed by Tokio to make this implementable in external crates. E.g., what does it take to hook up the raw IP packets to the Tokio event loop? Can |
Any progress? |
No. See my previous comment. |
OK, Thanks :) |
This is not an issue, the program only uses it at runtime, if it fails it fails, the user will restart it with privilege. |
Is your feature request related to a problem? Please describe.
tokio::net
currently supports networking over TCP, UDP and Unix domain sockets. This doesn't include other protocols such as ICMP (ping). It would be interesting to have the ability to send/receive ICMP packets via Tokio's asynchronous interface.Describe the solution you'd like
Adding the ability to handle ICMP packets in
tokio::net
. I assume the API would be somewhat similar totokio::net::UdpSocket
. Maybe the API should support handling all IP packets at a low level - not only ICMP? I'm not sure whether it would be feasible to implement on all OSes, maybe Linux or Unix should be supported first?Describe alternatives you've considered
It seems that
std::net
doesn't support ICMP either. I've found the following projects to handle ICMP in Rust. However, none of them seem to support anasync
interface.pnet
).Additional context
N/A
The text was updated successfully, but these errors were encountered: