Configure CI (#2)
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #2
Co-authored-by: Pierre HUBERT <pierre.git@communiquons.org>
Co-committed-by: Pierre HUBERT <pierre.git@communiquons.org>
This commit is contained in:
2024-04-05 18:58:30 +00:00
committed by Pierre Hubert
parent 9b55f1f29c
commit 1ed23317cb
9 changed files with 3097 additions and 3534 deletions

View File

@ -2,7 +2,7 @@ use nix::sys::socket::{AddressFamily, SockaddrLike};
use std::collections::HashMap;
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use std::str::FromStr;
use sysinfo::{NetworksExt, System, SystemExt};
use sysinfo::Networks;
pub fn extract_ipv4(ip: IpAddr) -> Ipv4Addr {
match ip {
@ -56,11 +56,11 @@ pub fn is_net_interface_name_valid<D: AsRef<str>>(int: D) -> bool {
/// Get the list of available network interfaces
pub fn net_list() -> Vec<String> {
let mut system = System::new();
system.refresh_networks_list();
let mut networks = Networks::new();
networks.refresh_list();
system
.networks()
networks
.list()
.iter()
.map(|n| n.0.to_string())
.collect::<Vec<_>>()