Skip to content

Instantly share code, notes, and snippets.

@muja
Created July 21, 2015 20:16
Show Gist options
  • Save muja/7718c2e76d6d0f3dddd8 to your computer and use it in GitHub Desktop.
Save muja/7718c2e76d6d0f3dddd8 to your computer and use it in GitHub Desktop.
fn main () {
for iface in ifaces::Interface::get_all().unwrap().into_iter() {
match iface.addr.unwrap().ip() {
IpAddr::V4(ip) => println!("{}: {:?}", iface.name, ip.is_loopback()),
_ => ()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment