4 releases

0.2.0 Feb 9, 2022
0.1.2 Feb 3, 2022
0.1.1 Feb 4, 2021
0.1.0 Jan 31, 2021

#9 in #construct

Download history 1/week @ 2023-12-11 1/week @ 2023-12-18 3/week @ 2024-02-19 21/week @ 2024-02-26 14/week @ 2024-03-04 22/week @ 2024-03-11 10/week @ 2024-03-18 12/week @ 2024-03-25

61 downloads per month
Used in 2 crates

Apache-2.0

44KB
1K SLoC

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.2.0


lib.rs:

An ICMP socket library that tries to be ergonomic to use.

The standard ping examples for both Ipv6 and IPv4 are in the examples directory.

Dependencies

~340–590KB