print info

This commit is contained in:
asxalex 2024-07-06 00:02:48 +08:00
parent 6232bcb0b1
commit 53bccdd53b

View File

@ -1,5 +1,6 @@
use crate::network::ReadWriter;
use sdlan_sn_rs::utils::{Result, ip_to_string, net_bit_len_to_mask};
use std::ffi::OsStr;
use std::io::{Error, ErrorKind};
use std::process::Command;
use std::sync::Arc;
@ -52,6 +53,7 @@ impl Iface {
let netbit = ip_to_string(&net_bit_len_to_mask(netbit));
let mut cmd = Command::new("netsh");
debug!("name={}, addr={}, mask={}", self.name, ip, netbit);
let command = cmd
.arg("interface")
.arg("ip")
@ -66,7 +68,7 @@ impl Iface {
match res {
Ok(r) => {
debug!("netsh ok: {:?}", String::from_utf8_lossy(&r.stdout));
debug!("netsh ok: [{:?}]", String::from_utf8_lossy(&r.stdout));
}
Err(e) => {
error!("failed to run netsh: {}", e.to_string());