#pcap #networking #capture #packet #manipulating #parser #data

bin+lib ether

Library for parsing and manipulating network data, packet captures

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

MIT license

34KB
919 lines

ether

crates.io License

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).

Documentation

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

  • interconnect
  • pcap
  • tap

Tools

  • ethdump
  • Eventually...
    • ping
    • trace-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