Skip to main content

OuiDb

Struct OuiDb 

Source
pub struct OuiDb { /* private fields */ }
Expand description

§Organizationally Unique Identifiers (OUI) database

Implementations§

Source§

impl OuiDb

Source

pub fn is_virtual_nic(name: &str) -> bool

Checks if the given OUI name corresponds to a virtual NIC.

§Arguments
  • name - The OUI name to check.
§Returns

Returns true if the name is a virtual NIC (e.g., QEMU, VirtualBox), otherwise false.

Source

pub fn oui_subtable_name() -> &'static str

Returns the name identifier of the subtable (oui_28, oui_32, oui_36) in the database.

§Returns

Returns the subtable name string "Ieee Registration Authority".

Source

pub fn lookup_mac(&self, mac: MacAddress) -> Option<&'static str>

Looks up the organization name (OUI vendor information) for a given MAC address.

§Arguments
§Returns

Returns Some(&'static str) if the organization name is found, otherwise None.

§Example
use macaddr_ouidb::*;
let mac = MacAddress::new([0x00, 0x1A, 0x2B, 0x3C, 0x4D, 0x5E]);
let org = OUI_DB.lookup_mac(mac);
Source

pub fn lookup(&self, mac: [u8; 6]) -> Option<&'static str>

Looks up the organization name (OUI vendor information) for a given MAC address byte array.

Supports 24-bit, 28-bit, and 36-bit OUI queries.

§Arguments
  • mac - A 6-byte MAC address byte array.
§Returns

Returns Some(&'static str) if the organization name is found. Returns None if the MAC address length is not 6 bytes or no match is found.

Auto Trait Implementations§

§

impl Freeze for OuiDb

§

impl RefUnwindSafe for OuiDb

§

impl Send for OuiDb

§

impl Sync for OuiDb

§

impl Unpin for OuiDb

§

impl UnsafeUnpin for OuiDb

§

impl UnwindSafe for OuiDb

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.