ledeuns / mac_address

Cross-platform retrieval of a network interface MAC address.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mac_address

crates.io Released API docs

mac_address provides a cross platform way to retrieve the MAC address of network hardware.

Supported platforms: Linux, Windows, MacOS, FreeBSD, OpenBSD

Example

extern crate mac_address;

use mac_address::get_mac_address;

fn main() {
    match get_mac_address() {
        Ok(Some(ma)) => {
            println!("MAC addr = {}", ma);
            println!("bytes = {:?}", ma.bytes());
        }
        Ok(None) => println!("No MAC address found."),
        Err(e) => println!("{:?}", e),
    }
}

License

mac_address is licensed under both MIT and Apache 2.0

About

Cross-platform retrieval of a network interface MAC address.

License:Apache License 2.0


Languages

Language:Rust 100.0%