#mac #address #network #interface

mac_address

Cross-platform retrieval of a network interface MAC address

15 releases (stable)

1.1.4 Sep 20, 2022
1.1.3 Jan 24, 2022
1.1.2 Aug 8, 2021
1.1.1 Oct 25, 2020
0.8.0 Jul 21, 2018

#637 in Network programming

Download history 21222/week @ 2022-06-08 14263/week @ 2022-06-15 22112/week @ 2022-06-22 13994/week @ 2022-06-29 6445/week @ 2022-07-06 17285/week @ 2022-07-13 25584/week @ 2022-07-20 19951/week @ 2022-07-27 24186/week @ 2022-08-03 22190/week @ 2022-08-10 9451/week @ 2022-08-17 10115/week @ 2022-08-24 14395/week @ 2022-08-31 18406/week @ 2022-09-07 6101/week @ 2022-09-14 8312/week @ 2022-09-21

48,597 downloads per month
Used in 33 crates (26 directly)

MIT/Apache

18KB
392 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–530KB
~11K SLoC