#mac-address #address #networking #interface #mac

mac_address2

Cross-platform retrieval of a network interface MAC address

4 stable releases

2.0.2 Mar 10, 2024
2.0.1 Jun 15, 2023
2.0.0 Apr 28, 2023
1.1.5 Apr 21, 2023

#8 in #mac-address

Download history 326/week @ 2024-11-15 233/week @ 2024-11-22 246/week @ 2024-11-29 201/week @ 2024-12-06 102/week @ 2024-12-13 31/week @ 2024-12-20 73/week @ 2024-12-27 100/week @ 2025-01-03 203/week @ 2025-01-10 126/week @ 2025-01-17 95/week @ 2025-01-24 89/week @ 2025-01-31 103/week @ 2025-02-07 174/week @ 2025-02-14 229/week @ 2025-02-21 219/week @ 2025-02-28

736 downloads per month

MIT/Apache

19KB
387 lines

mac_address2

crates.io Released API docs

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

Supported platforms: Linux, Windows, macOS, FreeBSD, OpenBSD, Android

Example

use mac_address2::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_address2 is licensed under both MIT and Apache 2.0


lib.rs:

mac_address2 provides a cross platform way to retrieve the MAC address of network hardware. See the Wikipedia entry for more information.

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

Dependencies

~0.2–9.5MB
~90K SLoC