ifaces

Crates.ioifaces
lib.rsifaces
version0.1.0
sourcesrc
created_at2016-05-04 17:57:04.456037
updated_at2017-03-17 18:29:09.596837
descriptionRust bindings to retrieve network interface information
homepagehttps://github.com/icorderi/rust-ifaces
repositoryhttps://github.com/icorderi/rust-ifaces
max_upload_size
id4971
size8,800
Core (github:actix:core)

documentation

README

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))
Commit count: 14

cargo fmt