GGist / rust-ifaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust bindings to retrieve network interface information

This library contains functionality to retrieve network interface information on Linux machines.

Example usage

See examples/ for an example of printing out network interfaces on a machine:

extern crate ifaces;

fn main () {
    for iface in
            .into_iter() {
                println!("{}\t{:?}\t{:?}",, iface.kind, iface.addr);

On my machine, this prints out:

$ cargo run --example ifaces
lo0	Ipv6	Some(V6([::1]:0))
lo0	Ipv4	Some(V4(
lo0	Ipv6	Some(V6([fe80::1]:0))
en5	Ipv4	Some(V4(


License:MIT License


Language:Rust 100.0%