hankbao / rust-ifaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust bindings to retrieve network interface information

Date: 10/10 2017
RustVersion:nightly

OS Support

  • Windows
  • Unix-Like( BSD-Like, XNU, Linux )

Run

git clone https://github.com/LuoZijun/rust-ifaces.git
cargo run --example ifaces

Example

[dependencies]
ifaces = { git = "https://github.com/LuoZijun/rust-ifaces.git" }
extern crate ifaces;

fn main() {
    match ifaces::ifaces() {
        Ok(interfaces) => {
            for interface in interfaces.into_iter() {
                println!("Found Interface: {:?}", interface)
            }
        },
        Err(_) => println!("Ooops ...")
    };
}

Thanks

  • dlevy47 , Origin code(linux platform)
  • GGist , windows platform code

About

License:MIT License


Languages

Language:Rust 100.0%