2026-01-18 12:04:13 -05:00
|
|
|
use log::info;
|
2026-01-19 12:45:52 -05:00
|
|
|
|
|
|
|
|
use crate::mac_vendor_finder::MacVendorFinder;
|
2026-01-14 09:53:01 -05:00
|
|
|
mod config;
|
2026-01-13 07:57:47 -05:00
|
|
|
mod device_finders;
|
2026-01-19 12:45:52 -05:00
|
|
|
mod mac_vendor_finder;
|
2026-01-13 07:57:47 -05:00
|
|
|
|
2026-01-13 15:48:17 -05:00
|
|
|
#[tokio::main]
|
|
|
|
|
async fn main() {
|
2026-01-14 09:53:01 -05:00
|
|
|
env_logger::init();
|
|
|
|
|
info!("Starting up oott");
|
2026-01-13 07:57:47 -05:00
|
|
|
|
2026-01-19 12:45:52 -05:00
|
|
|
let mut mac_vendor_finder = MacVendorFinder::new();
|
|
|
|
|
|
|
|
|
|
let devices = device_finders::arp::find("eno1").await;
|
2026-01-14 09:53:01 -05:00
|
|
|
|
|
|
|
|
info!("Done with ARP probes");
|
2026-01-15 11:19:33 -05:00
|
|
|
info!("Found {} online devices", devices.iter().count());
|
2026-01-13 07:57:47 -05:00
|
|
|
for device in devices.iter() {
|
2026-01-15 11:19:33 -05:00
|
|
|
info!("Device found {}", device);
|
2026-01-19 12:45:52 -05:00
|
|
|
let vendor_result = mac_vendor_finder.find(device.get_mac_prefix().as_str());
|
|
|
|
|
match vendor_result {
|
|
|
|
|
Some(vendor) => info!("Device vendor = {}", vendor),
|
|
|
|
|
None => info!("Device vendor not found"),
|
|
|
|
|
}
|
2026-01-13 07:57:47 -05:00
|
|
|
}
|
2026-01-19 12:45:52 -05:00
|
|
|
|
2026-01-14 09:53:01 -05:00
|
|
|
info!("Exiting");
|
2026-01-13 07:57:47 -05:00
|
|
|
}
|