print info
This commit is contained in:
parent
6232bcb0b1
commit
53bccdd53b
@ -1,5 +1,6 @@
|
|||||||
use crate::network::ReadWriter;
|
use crate::network::ReadWriter;
|
||||||
use sdlan_sn_rs::utils::{Result, ip_to_string, net_bit_len_to_mask};
|
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::io::{Error, ErrorKind};
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
@ -52,6 +53,7 @@ impl Iface {
|
|||||||
let netbit = ip_to_string(&net_bit_len_to_mask(netbit));
|
let netbit = ip_to_string(&net_bit_len_to_mask(netbit));
|
||||||
|
|
||||||
let mut cmd = Command::new("netsh");
|
let mut cmd = Command::new("netsh");
|
||||||
|
debug!("name={}, addr={}, mask={}", self.name, ip, netbit);
|
||||||
let command = cmd
|
let command = cmd
|
||||||
.arg("interface")
|
.arg("interface")
|
||||||
.arg("ip")
|
.arg("ip")
|
||||||
@ -66,7 +68,7 @@ impl Iface {
|
|||||||
|
|
||||||
match res {
|
match res {
|
||||||
Ok(r) => {
|
Ok(r) => {
|
||||||
debug!("netsh ok: {:?}", String::from_utf8_lossy(&r.stdout));
|
debug!("netsh ok: [{:?}]", String::from_utf8_lossy(&r.stdout));
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("failed to run netsh: {}", e.to_string());
|
error!("failed to run netsh: {}", e.to_string());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user