#mac #address #network #interface

mac_address

Cross-platform retrieval of a network interface MAC address

16 releases (stable)

1.1.5 May 25, 2023
1.1.4 Sep 20, 2022
1.1.3 Jan 24, 2022
1.1.2 Aug 8, 2021
0.8.0 Jul 21, 2018

#150 in Network programming

Download history 20569/week @ 2023-10-18 20219/week @ 2023-10-25 21053/week @ 2023-11-01 20602/week @ 2023-11-08 22270/week @ 2023-11-15 20083/week @ 2023-11-22 22547/week @ 2023-11-29 22730/week @ 2023-12-06 19419/week @ 2023-12-13 17158/week @ 2023-12-20 18376/week @ 2023-12-27 19852/week @ 2024-01-03 20630/week @ 2024-01-10 24243/week @ 2024-01-17 25140/week @ 2024-01-24 24141/week @ 2024-01-31

97,396 downloads per month
Used in 92 crates (57 directly)

MIT/Apache

21KB
474 lines

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


lib.rs:

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

Supported platforms: Linux, Windows, MacOS, FreeBSD

Dependencies

~0–730KB
~13K SLoC