jtomschroeder / ether Goto Github PK
View Code? Open in Web Editor NEWLibrary for parsing and manipulating network data, packet captures.
License: MIT License
Library for parsing and manipulating network data, packet captures.
License: MIT License
I'm having trouble compiling this:
Compiling ether v0.1.4
error[E0308]: mismatched types
--> /some/path/.cargo/registry/src/github.com-1ecc6299db9ec823/ether-0.1.4/src/tap/tap.rs:106:37
|
106 | iface.ifr_name[i] = c as i8;
| ^^^^^^^ expected u8, found i8
error: aborting due to previous error(s)
error: Could not compile `ether`.
This is rust 1.19, could you have a look into this?
I ran into another issue:
let mut tap = tap::Tap::new("eth0").unwrap();
is failing with this error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 0, message: "Success" } }', src/libcore/result.rs:860
This is the code of open():
pub fn new(interface: &str) -> io::Result<Self> {
fn open() -> io::Result<File> {
// On macOS: bpf exposed as /dev/bpf###
for entry in glob("/dev/bpf*").expect("Failed to read glob pattern") {
if let Some(file) = entry
.ok()
.and_then(|path| {
OpenOptions::new()
.read(true)
.write(true)
.open(&path)
.ok()
}) {
return Ok(file);
}
}
Err(io::Error::last_os_error())
}
let file = try!(open()); // this returns Err(io::Error::last_os_error())
let config = Config::default();
// [...]
It appears linux doesn't support berkley packet filter so it doesn't have /dev/bpf*
, falls through the loop and returns last_os_error()
which was unrelated and successful. :)
You might want to look into the pcap crate, I managed to dump traffic successfully using it, but I didn't feel like decoding ethernet, ip and tcp manually.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.