raw-ether 0.2.2

Raw Ethernet on Linux, macOS and Windows: MAC addresses, interfaces, frames with hardware time stamps, PTP hardware clocks and captures
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! The helper an app ships for raw sockets, as small as it can be: grant
//! it CAP_NET_RAW (`sudo setcap cap_net_raw+ep target/debug/examples/netraw`)
//! and have the app start it with `raw_ether::broker::Broker::start` and
//! install it. The app itself then needs no capability.

#[cfg(target_os = "linux")]
fn main() {
    std::process::exit(raw_ether::broker::serve());
}

#[cfg(not(target_os = "linux"))]
fn main() {
    eprintln!("only Linux grants raw sockets by capability");
    std::process::exit(2);
}