pub trait IcmpSocket {
    type AddrType;
    type PacketType;
    fn set_timeout(&mut self, timeout: Option<Duration>);
fn set_max_hops(&mut self, hops: u32);
fn bind<A: Into<Self::AddrType>>(&mut self, addr: A) -> Result<()>;
fn send_to(
        &mut self,
        dest: Self::AddrType,
        packet: Self::PacketType
    ) -> Result<()>;
fn rcv_from(&mut self) -> Result<(Self::PacketType, SockAddr)>; }
Expand description

Trait for an IcmpSocket implemented by Icmpv4Socket and Icmpv6Socket.

Associated Types

The type of address this socket operates on.

The type of packet this socket handles.

Required methods

Sets the timeout on the socket for rcv_from. A value of None will cause rcv_from to block.

Sets the ttl for packets sent on this socket. Controls the number of hops the packet will be allowed to traverse.

Binds this socket to an address.

Sends the packet to the given destination.

Receive a packet on this socket.

Implementors