ICMP Sockets for both IPv4 and IPv6
This is a fork of zaphar/icmp-socket.
Major Changes Since Fork
- Added timestamp request/reply support
- Added
with_echo_replyfor IPv4 packets (@djackreuter) - Added support for binding to a network interface (@timoschwarzer)
- Removed
byteorderdependency - Use
Vec::spare_capacity_mutinstead of unsafe buffer initialization
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"..unwrap;
let socket = try_from.unwrap;
It can construct and parse the common ICMP packets for both ICMP4 and ICMP6.
let packet4 = with_echo_request;
let packet6 = with_echo_request;