Skip to content

Cross-platform rust utility library to enumerate local network interfaces.

License

Notifications You must be signed in to change notification settings

mensi/netifs-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netifs

This is a simple rust wrapper on top of libc/winapi to enumerate network interfaces. On Windows, an MSVC toolchain is necessary to build.

Loopback interface and IPv6 support is present in both platform specific implementations.

Usage

An small example program is provided in netifs-cli:

use netifs::get_interfaces;

fn main() {
    for interface in get_interfaces().expect("Getting interfaces failed") {
        println!("{}", interface.display_name);
        if let Some(mac) = interface.mac_address {
            println!("\tMAC: {}", mac.to_hex_string());
        }
        for ip in interface.ip_addresses {
            println!("\tIP: {}", ip);
        }
    }
}

About

Cross-platform rust utility library to enumerate local network interfaces.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages