2 unstable releases

Uses old Rust 2015

0.1.0 Mar 17, 2017
0.0.3 May 4, 2016

#26 in #retrieve

Download history 50/week @ 2023-12-06 90/week @ 2023-12-13 66/week @ 2023-12-20 68/week @ 2023-12-27 65/week @ 2024-01-03 84/week @ 2024-01-10 67/week @ 2024-01-17 774/week @ 2024-01-24 822/week @ 2024-01-31 1492/week @ 2024-02-07 956/week @ 2024-02-14 775/week @ 2024-02-21 1365/week @ 2024-02-28 455/week @ 2024-03-06 586/week @ 2024-03-13 453/week @ 2024-03-20

3,158 downloads per month
Used in 9 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
~36K SLoC