Expand description
This crate provides a library for parsing and manipulating network data, packet captures.
§Usage
Add ether
to the dependencies in your Cargo.toml
and the following to root of your crate:
extern crate ether;
Here’s a simple example that prints all packets received on interface en0
:
extern crate ether;
use ether::tap;
use ether::tap::Stream;
fn main() {
let mut tap = tap::Tap::new("en0").unwrap();
for packet in tap.stream().wait().filter_map(|p| p.ok()) {
println!("{:?}", packet);
}
}