move system_config to dns::system

This commit is contained in:
Luna Yao
2026-04-06 11:54:02 +02: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;
mod node_mgr; mod node_mgr;
pub mod config;
mod peer_mgr; mod peer_mgr;
pub mod server; pub mod server;
pub mod system;
mod utils; mod utils;
pub mod zone; pub mod zone;
+1 -3
View File
@@ -10,11 +10,9 @@ pub mod client_instance;
pub mod runner; pub mod runner;
#[cfg(feature = "magic-dns")] #[cfg(feature = "magic-dns")]
pub mod server_instance; pub mod server_instance;
#[cfg(feature = "magic-dns")]
pub mod system_config;
#[cfg(all(test, feature = "tun", feature = "magic-dns"))] #[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_INSTANCE_ADDR: &str = "tcp://127.0.0.1:49813";
pub static MAGIC_DNS_FAKE_IP: &str = "100.100.100.101"; pub static MAGIC_DNS_FAKE_IP: &str = "100.100.100.101";
@@ -9,9 +9,9 @@
use super::{ use super::{
config::{GeneralConfigBuilder, RunConfigBuilder}, config::{GeneralConfigBuilder, RunConfigBuilder},
server::Server, server::Server,
system_config::{OSConfig, SystemConfig},
MAGIC_DNS_INSTANCE_ADDR, MAGIC_DNS_INSTANCE_ADDR,
}; };
use crate::dns::system::{OSConfig, SystemConfig};
use crate::{ use crate::{
common::{ common::{
ifcfg::{IfConfiger, IfConfiguerTrait}, ifcfg::{IfConfiger, IfConfiguerTrait},
@@ -495,14 +495,14 @@ fn get_system_config(
) -> Result<Option<Box<dyn SystemConfig>>, anyhow::Error> { ) -> Result<Option<Box<dyn SystemConfig>>, anyhow::Error> {
#[cfg(target_os = "windows")] #[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"))?; let tun_name = _tun_name.ok_or_else(|| anyhow::anyhow!("No tun name"))?;
return Ok(Some(Box::new(WindowsDNSManager::new(tun_name)?))); return Ok(Some(Box::new(WindowsDNSManager::new(tun_name)?)));
} }
#[cfg(all(target_os = "macos", not(feature = "macos-ne")))] #[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()))); return Ok(Some(Box::new(DarwinConfigurator::new())));
} }