From 53bccdd53b72f3c10f237bdc88f2cfcd9097c5c8 Mon Sep 17 00:00:00 2001 From: asxalex Date: Sat, 6 Jul 2024 00:02:48 +0800 Subject: [PATCH] print info --- src/network/tun_win.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/network/tun_win.rs b/src/network/tun_win.rs index 40b9725..168961c 100644 --- a/src/network/tun_win.rs +++ b/src/network/tun_win.rs @@ -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());