Ekko is a simple utility for sending echo requests, giving you (mostly) everything you need.
use ekko::{ error::{EkkoError},
EkkoResponse,
Ekko,
};
fn main() -> Result<(), EkkoError> {
let mut ping = Ekko::with_target("rustup.rs")?;
for hop in 0..64 {
match ping.send(hop)? {
EkkoResponse::Destination(data) => {
println!("{:?}", EkkoResponse::Destination(data));
break
}
x => println!("{:?}", x)
}
}
for response in ping.trace(0..64)? {
match response {
EkkoResponse::Destination(data) => {
println!("{:?}", EkkoResponse::Destination(data));
break
}
x => println!("{:?}", x)
}
}
Ok(())
}