Ekko is a simple and light utility for sending echo requests synchronously, built upon raw sockets; currently in its early stages with little to no test coverage.
To use ekko
, add this to your Cargo.toml
:
toml
[dependencies]
ekko = "0.4.0"
The following example will trace the route to the specified destination. ```rust use ekko::{ error::{EkkoError}, EkkoResponse, Ekko, };
fn main() -> Result<(), EkkoError> { let mut ping = Ekko::with_target("rustup.rs")?;
// Send single ..
for hop in 0..64 {
match ping.send(hop)? {
EkkoResponse::Destination(data) => {
println!("{:?}", EkkoResponse::Destination(data));
break
}
x => println!("{:?}", x)
}
}
// Send batch ..
for response in ping.trace(0..64)? {
match response {
EkkoResponse::Destination(data) => {
println!("{:?}", EkkoResponse::Destination(data));
break
}
x => println!("{:?}", x)
}
}
Ok(())
} ```
All contributions are welcome, don't hesitate to open an issue if something is missing!