9 releases
Uses old Rust 2015
| 0.1.4 | Jul 20, 2017 |
|---|---|
| 0.1.3 | Jul 19, 2017 |
| 0.1.2 | May 24, 2017 |
| 0.1.0 | Mar 31, 2017 |
| 0.0.2 | Jan 26, 2017 |
#58 in #pcap
34KB
919 lines
ether
ether is a crate that provides a library parsing and manipulating network data, packet captures.
NOTE: ether is currently in the alpha phase (API is likely to change).
Usage
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);
}
}
Framework
interconnectpcaptap
Tools
ethdump- Eventually...
pingtrace-route
lib.rs:
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);
}
}
Dependencies
~275–385KB