Echo Request Utility
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.
Usage
To use ekko
, add this to your Cargo.toml
:
[dependencies]
ekko = "0.4.0"
Example
The following example will trace the route to the specified destination.
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(())
}
Contributing
All contributions are welcome, don't hesitate to open an issue if something is missing!
License
MIT