Trait icmp_socket::socket::IcmpSocket [−][src]
Trait for an IcmpSocket implemented by Icmpv4Socket and Icmpv6Socket.
Associated Types
type AddrType
[src]
The type of address this socket operates on.
type PacketType
[src]
The type of packet this socket handles.
Required methods
fn set_timeout(&mut self, timeout: Duration) -> Result<()>
[src]
Sets the timeout on the socket for rcv_from. A value of 0 will cause rcv_from to block.
fn set_max_hops(&mut self, hops: u32)
[src]
Sets the ttl for packets sent on this socket. Controls the number of hops the packet will be allowed to traverse.
fn bind<A: Into<Self::AddrType>>(&mut self, addr: A) -> Result<()>
[src]
Binds this socket to an address.
fn send_to(
&mut self,
dest: Self::AddrType,
packet: Self::PacketType
) -> Result<()>
[src]
&mut self,
dest: Self::AddrType,
packet: Self::PacketType
) -> Result<()>
Sends the packet to the given destination.
fn rcv_from(&mut self) -> Result<(Self::PacketType, SockAddr)>
[src]
Receive a packet on this socket.
Implementors
impl IcmpSocket for IcmpSocket4
[src]
type AddrType = Ipv4Addr
type PacketType = Icmpv4Packet
fn set_max_hops(&mut self, hops: u32)
[src]
fn bind<A: Into<Self::AddrType>>(&mut self, addr: A) -> Result<()>
[src]
fn send_to(
&mut self,
dest: Self::AddrType,
packet: Self::PacketType
) -> Result<()>
[src]
&mut self,
dest: Self::AddrType,
packet: Self::PacketType
) -> Result<()>
fn rcv_from(&mut self) -> Result<(Self::PacketType, SockAddr)>
[src]
fn set_timeout(&mut self, timeout: Duration) -> Result<()>
[src]
impl IcmpSocket for IcmpSocket6
[src]
type AddrType = Ipv6Addr
type PacketType = Icmpv6Packet
fn set_max_hops(&mut self, hops: u32)
[src]
fn bind<A: Into<Self::AddrType>>(&mut self, addr: A) -> Result<()>
[src]
fn send_to(
&mut self,
dest: Self::AddrType,
mut packet: Self::PacketType
) -> Result<()>
[src]
&mut self,
dest: Self::AddrType,
mut packet: Self::PacketType
) -> Result<()>