Coder Social home page Coder Social logo

marirs / mac-oui Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 5.42 MB

Lookup for MAC OUI vendor details from the oui database

License: MIT License

Rust 100.00%
mac-address oui ouilookup oui-search oui-database networking rust rust-lang rust-library rust-crate

mac-oui's Introduction

MAC Address lookup tool

Linux Arm7 Linux x86_64 macOS Windows Crates.io Documentation

Lookup the MAC Address for a corresponding details (eg: org, created, etc...)

Requirements

  • Rust 1.60+ (edition 2021)

Compile

  • Dev
cargo b
  • Release
cargo b --release

Usage

You can include this in your Cargo.toml file:

[dependencies]
mac_oui = "0.4.8"

If you want to use it with the inbuilt oui db; then:

[dependencies]
mac_oui = { version = "0.4.8", features = ["with-db"] }

and then

use mac_oui::Oui;

fn main () {
    let oui_db = Oui::default();
    assert!(oui_db.is_ok());
}

Running the Example

You can run the default example that is included in the following manner.

  • cargo run --example mac_lookup <mac address> eg:
cargo run --example mac_lookup --features="with-db" 70:B3:D5:e7:4f:81
    Finished dev [optimized + debuginfo] target(s) in 1.54s
     Running `target/debug/examples/mac_lookup '70:B3:D5:e7:4f:81'`
Entry {
    oui: "70:B3:D5",
    is_private: false,
    company_name: "Ieee Registration Authority",
    company_address: "445 Hoes Lane Piscataway NJ 08554 US",
    country_code: "US",
    assignment_block_size: "MA-L",
    date_created: "2014-01-12",
    date_updated: "2016-04-27",
}
  • Example of lookup by Manufacturer
$ cargo run --example manufacturer_lookup --features="with-db" "Apple, Inc"
    Finished dev [optimized + debuginfo] target(s) in 0.02s
     Running `target/debug/examples/manufacturer_lookup 'Apple, Inc'`
[
    Entry {
        oui: "...",
        is_private: false,
        company_name: "Apple, Inc",
        company_address: "1 Infinite Loop Cupertino CA 95014 US",
        country_code: "US",
        assignment_block_size: "MA-L",
        date_created: "2017-02-21",
        date_updated: "2017-02-21",
    },
    <clip>....
]
  • Example Getting a list of Manufacturers
$ cargo run --example --features="with-db" db_stats
    Finished dev [optimized + debuginfo] target(s) in 0.06s
     Running `target/debug/examples/db_stats`
Total Records= 47880
Total Manufacturers= 29491
Total MAC Addrs= 47880

====Manufacturers====
[
    "\"Azimut\" Production Association Jsc",
    "\"Continent\" Co Ltd",
    "\"Meta-chrom\" Co Ltd",
    "\"Rpc \"Energoautomatika\" Ltd",
    "(UN)Manned",
    "+plugg srl",
    "01db-Metravib",
    "1.A Connect GmbH",
    "1000eyes GmbH",
    "100fio networks Tech Llc",
    "10net Communications/Dca",
    "11811347 Canada Inc",
    "11wave Technonlogy Co, Ltd",
    "12Sided Tech, Llc",
    "1394 Printer Working Group",
    "1394 Trade Association",
    "16063",
    "1Net Corp",
    "1Verge Internet Tech (Beijing) Co, Ltd",
    "1more",
]
...
[
    "杭州德澜科技有限公司(HangZhou Delan Tech Co, Ltd)",
    "\u{200b}Asung Techno Co, Ltd",
    "éolane",
    "Östling Marking Systems GmbH",
    "Öresundskraft AB",
    "Åmic AB",
    "µTech Tecnologia Ltda",
    "«Intellect module» Llc",
    "zxsolution",
    "zte Corp",
    "zhejiang yuanwang communication technolgy Co, Ltd",
    "zhejiang ebang communication Co, Ltd",
    "z-max mediasolution",
    "yLez Tech Pte Ltd",
    "xxter b.v.",
    "xvtec Ltd",
    "xn systems",
    "xmi systems",
    "xm",
    "xiamenshi c-chip Tech Co, Ltd",
]

mac-oui's People

Contributors

eutampieri avatar marirs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mac-oui's Issues

Even using `with-db`, the `oui.tsv` file still needs to be local.

Unless I've misunderstood how Oui::default is meant to work, the path assets/oui.csv still needs to be present whilst using the with-db feature flag. If I build an executable and move it somewhere it can't see that path, it bails saying that it can't find the file.

I cloned the repo, deleted this check, and now it does what I expect: to have the OUI database built in without needing the dir and CSV file near the executable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.