Expand description
Helpers to ping an IPv4 or IPv6 address by sending ICMP echo requests and waiting for ICMP echo replies.
Functionality in this crate relies on ICMP sockets, a kind of socket where each payload read/written contains ICMP headers.
As a starting point, see new_unicast_sink_and_stream
, which is built
on top of the other facilities in the crate and models pinging as sending
an ICMP echo request whenever a value is sent to the sink, and a stream
which yields an item for every echo reply received.
Structs§
- Ping
Data - Parameters of a ping request/reply.
- Ping
Sink - Sink for sending ping requests.
- Ping
Stream - Stream of received ping replies.
Enums§
- Ping
Error - Ping error.
Constants§
- ICMP_
HEADER_ LEN - The number of bytes of an ICMP (v4 or v6) header.
Traits§
- Fuchsia
IpExt - Extension trait on
crate::IpExt
for Fuchsia-specific functionality. - Icmp
Socket - Async ICMP socket.
- IpExt
- Trait for IP protocol versions.
- TryFrom
Sock Addr - Addresses which can be converted from
socket2::SockAddr
.
Functions§
- new_
icmp_ socket - Create a new ICMP socket.
- new_
unicast_ sink_ and_ stream - Create a ping sink and stream for pinging a unicast destination with the same body for every packet.