Skip to main content

r_lanlib/oui/
types.rs

1/// A remote OUI data source with a filename and download URL.
2pub(crate) struct OuiDataUrl {
3    /// Local filename used when saving the downloaded CSV.
4    pub(crate) basename: &'static str,
5    /// IEEE URL to download the CSV from.
6    pub(crate) url: &'static str,
7}
8
9/// OUI record containing the registered organization name.
10#[derive(Debug, Clone)]
11pub struct OuiData {
12    /// Registered organization name for this OUI prefix.
13    pub(crate) organization: String,
14}
15
16impl OuiData {
17    /// Returns the vendor / organization for this OuiData
18    pub fn organization(&self) -> &str {
19        &self.organization
20    }
21}
22
23impl From<&oui_data::OuiData> for OuiData {
24    fn from(value: &oui_data::OuiData) -> Self {
25        Self {
26            organization: value.organization().into(),
27        }
28    }
29}