ishbosamiya b30dfb48bd socket: fix: socket timeout handling
rcv_from() would always overwrite the timeout parameter set by the
user.

Instead of setting the timeout within the socket when set_timeout() is
called, store the timeout information within the options (along with
hops) and read that data when the sockets timeout is actually set in
rcv_from().
2022-02-08 13:06:35 +05:30
2022-02-08 13:06:35 +05:30
2021-01-08 16:01:53 -05:00
2021-01-31 09:18:38 -05:00
2022-02-02 22:48:32 -05:00

ICMP Sockets for both IPv4 and IPv6

An implementation of ICMP Sockets for both IPv4 and IPv6.

Sockets can be created from IP addresses. IPv4 addresses will construct ICMP4 sockets. IPv6 will construct ICMP6 sockets.

let parsed_addr = "127.0.0.1".parse::<Ipv4Addr>().unwrap();
let socket = IcmpSocket4::try_from(parsed_addr).unwrap();

It can construct and parse the common ICMP packets for both ICMP4 and ICMP6.

let packet4 = Icmpv4Packet::with_echo_request(42, 1, "payload".to_bytes());
let packet6 = Icmpv6Packet::with_echo_request(42, 1, "payload".to_bytes());
)

API Documentation

https://docs.rs/icmp-socket/0.1.1

Description
Rust ICMP sockets
Readme Apache-2.0 79 KiB
Languages
Rust 100%