Crate manuf

Source
Expand description

rust-manuf is a rust library provides Ethernet vendor codes, and well-known MAC addresses.

§Example

#[macro_use]
extern crate manuf;

fn main() {
    assert_eq!(
        manuf::vendor([0x8c, 0x85, 0x90, 0x0b, 0xcb, 0x9e]),
        Some(("Apple", "Apple, Inc."))
    );

    assert!(
        manuf::prefix("Apple")
            .any(|prefix| prefix == ([0x8c, 0x85, 0x90, 0x00, 0x00, 0x00], 24))
    );
}

Constants§

ETHER_ADDR_LEN
The number of bytes in an ethernet (MAC) address.

Functions§

parse
Parse manuf file for vendor’s ((prefix, prefix_length), (name, description)).
prefix
Find vendor’s prefix and mask for the ethernet (MAC) address.
vendor
Find vendor name and description base on an ethernet (MAC) address.

Type Aliases§

EtherAddr
Structure of a 48-bit Ethernet address.