2 unstable releases

Uses old Rust 2015

0.1.0 Mar 17, 2017
0.0.3 May 4, 2016

#28 in #retrieve

Download history 732/week @ 2024-03-14 289/week @ 2024-03-21 1061/week @ 2024-03-28 716/week @ 2024-04-04 613/week @ 2024-04-11 345/week @ 2024-04-18 406/week @ 2024-04-25 126/week @ 2024-05-02 367/week @ 2024-05-09 557/week @ 2024-05-16 731/week @ 2024-05-23 350/week @ 2024-05-30 523/week @ 2024-06-06 537/week @ 2024-06-13 1952/week @ 2024-06-20 228/week @ 2024-06-27

3,360 downloads per month
Used in 10 crates (5 directly)

MIT license

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