Configure CI (#2)
All checks were successful
continuous-integration/drone/push Build is passing
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:
@ -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<_>>()
|
||||
|
Reference in New Issue
Block a user