2 unstable releases
Uses old Rust 2015
0.1.0 | Mar 17, 2017 |
---|---|
0.0.3 | May 4, 2016 |
#28 in #retrieve
3,360 downloads per month
Used in 10 crates
(5 directly)
8KB
174 lines
Rust bindings to retrieve network interface information
This library contains functionality to retrieve network interface information on Linux machines.
Example usage
See examples/ifaces.rs
for an example of printing out network interfaces on a machine:
extern crate ifaces;
fn main () {
for iface in
ifaces::Interface::get_all().unwrap()
.into_iter() {
println!("{}\t{:?}\t{:?}", iface.name, iface.kind, iface.addr);
}
}
On my machine, this prints out:
$ cargo run --example ifaces
lo0 Ipv6 Some(V6([::1]:0))
lo0 Ipv4 Some(V4(127.0.0.1:0))
lo0 Ipv6 Some(V6([fe80::1]:0))
en5 Ipv4 Some(V4(192.168.168.133:0))
Dependencies
~1.5MB
~37K SLoC