#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

#293 in Network programming

Download history 7861/week @ 2022-11-29 8585/week @ 2022-12-06 7147/week @ 2022-12-13 12476/week @ 2022-12-20 5027/week @ 2022-12-27 7643/week @ 2023-01-03 11352/week @ 2023-01-10 9230/week @ 2023-01-17 11483/week @ 2023-01-24 14141/week @ 2023-01-31 14514/week @ 2023-02-07 15194/week @ 2023-02-14 12331/week @ 2023-02-21 20544/week @ 2023-02-28 25178/week @ 2023-03-07 9625/week @ 2023-03-14

72,008 downloads per month
Used in 49 crates (35 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–610KB
~14K SLoC