1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use sysinfo::{RefreshKind, SystemExt};

pub mod cli;

#[cfg(unix)]
pub fn interfaces_list() -> Vec<String> {
    let system = sysinfo::System::new_with_specifics(
        RefreshKind::new().with_networks().with_networks_list(),
    );
    system
        .networks()
        .into_iter()
        .map(|x| x.0.clone())
        .collect::<Vec<_>>()
}