8 releases (4 breaking)

0.5.9 Oct 16, 2023
0.5.2 Feb 24, 2024
0.5.1 Nov 30, 2023
0.4.1 Mar 30, 2023
0.1.0 Sep 17, 2017

#361 in Network programming

Download history 2835/week @ 2024-01-03 2891/week @ 2024-01-10 3009/week @ 2024-01-17 3143/week @ 2024-01-24 3534/week @ 2024-01-31 3344/week @ 2024-02-07 4630/week @ 2024-02-14 3470/week @ 2024-02-21 3272/week @ 2024-02-28 4171/week @ 2024-03-06 4092/week @ 2024-03-13 4135/week @ 2024-03-20 3396/week @ 2024-03-27 4581/week @ 2024-04-03 4092/week @ 2024-04-10 3530/week @ 2024-04-17

16,379 downloads per month
Used in 6 crates

MIT license

12KB
290 lines

rust ping

Crates.io MIT licensed Docs

Ping function implemented in rust.

dgram sock and raw sock

Sending an ICMP package should create a socket of type raw on most platforms. And most of these platforms require special privileges. Basically, it needs to run with sudo on Linux to create a raw socket.

These requirements introduce security risks, so on modern platforms, unprivileged ping has been introduced, with socket type dgram. So there are two mods in this crate, rawsock and dgramsock, which have the same function ping. And the global ping function is just an alias for the rawsock::ping. You can pick the one which is suitable for your use case.

For Linux users, although modern kernels support ping with dgram, in some distributions (like Arch), it's disabled by default. More details: https://wiki.archlinux.org/title/sysctl#Allow_unprivileged_users_to_create_IPPROTO_ICMP_sockets

License

This library contains codes from https://github.com/knsd/tokio-ping, which is licensed under either of

And other codes is licensed under

Dependencies

~0.8–1.6MB
~30K SLoC