tree: fca61142c3d00674298b7855e2ccde488ff36f43 [path history] [tgz]
  1. .github/
  2. examples/
  3. patches/
  4. src/
  5. .android-checksum.json
  6. .cargo-checksum.json
  7. .cargo_vcs_info.json
  8. Android.bp
  9. android_config.toml
  10. Cargo.lock
  11. Cargo.toml
  12. Cargo.toml.orig
  13. cargo_embargo.json
  14. cargo_embargo_target_windows_enabled.bp.fragment
  15. LICENSE-MIT
  16. METADATA
  17. MODULE_LICENSE_MIT
  18. README.md
crates/if-addrs/README.md

if-addrs

https://crates.io/crates/if-addrs

Overview

Retrieve network interface info for all interfaces on the system:

// List all of the machine's network interfaces
for iface in if_addrs::get_if_addrs().unwrap() {
    println!("{:#?}", iface);
}

Get notifications for changes in network interfaces:

let mut notifier = if_addrs::IfChangeNotifier::new().unwrap();
loop {
    if let Ok(details) = notifier.wait(None) {
        println!("{:#?}", details);
    }
}

License

This SAFE Network library is dual-licensed under the Modified BSD (LICENSE-BSD https://opensource.org/licenses/BSD-3-Clause) or the MIT license (LICENSE-MIT http://opensource.org/licenses/MIT) at your option.

Contribution

Copyrights in the SAFE Network are retained by their contributors. No copyright assignment is required to contribute to this project.