move system_config to dns::system

This commit is contained in:
Luna Yao
2026-02-23 03:40:16 +01:00
parent 202d8ec121
commit 4ed9cbc4a1
7 changed files with 6 additions and 7 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
pub mod config;
mod node;
mod node_mgr;
pub mod config;
mod peer_mgr;
pub mod server;
pub mod system;
mod utils;
pub mod zone;
+1 -3
View File
@@ -10,11 +10,9 @@ pub mod client_instance;
pub mod runner;
#[cfg(feature = "magic-dns")]
pub mod server_instance;
#[cfg(feature = "magic-dns")]
pub mod system_config;
#[cfg(all(test, feature = "tun", feature = "magic-dns"))]
mod tests;
pub mod tests;
pub static MAGIC_DNS_INSTANCE_ADDR: &str = "tcp://127.0.0.1:49813";
pub static MAGIC_DNS_FAKE_IP: &str = "100.100.100.101";
@@ -9,9 +9,9 @@
use super::{
config::{GeneralConfigBuilder, RunConfigBuilder},
server::Server,
system_config::{OSConfig, SystemConfig},
MAGIC_DNS_INSTANCE_ADDR,
};
use crate::dns::system::{OSConfig, SystemConfig};
use crate::{
common::{
ifcfg::{IfConfiger, IfConfiguerTrait},
@@ -495,14 +495,14 @@ fn get_system_config(
) -> Result<Option<Box<dyn SystemConfig>>, anyhow::Error> {
#[cfg(target_os = "windows")]
{
use super::system_config::windows::WindowsDNSManager;
use crate::dns::system::windows::WindowsDNSManager;
let tun_name = _tun_name.ok_or_else(|| anyhow::anyhow!("No tun name"))?;
return Ok(Some(Box::new(WindowsDNSManager::new(tun_name)?)));
}
#[cfg(all(target_os = "macos", not(feature = "macos-ne")))]
{
use super::system_config::darwin::DarwinConfigurator;
use crate::dns::system_config::darwin::DarwinConfigurator;
return Ok(Some(Box::new(DarwinConfigurator::new())));
}