From 059798e617955088a355f086a26463692e0c71cc Mon Sep 17 00:00:00 2001 From: rhaskia Date: Sun, 10 Mar 2024 07:25:33 +1300 Subject: [PATCH] dummy set_up function for macos --- tun/Cargo.toml | 2 ++ tun/src/unix/apple/mod.rs | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/tun/Cargo.toml b/tun/Cargo.toml index d4cd67e1..245cb25b 100644 --- a/tun/Cargo.toml +++ b/tun/Cargo.toml @@ -14,6 +14,8 @@ tracing = "0.1" log = "0.4" serde = { version = "1", features = ["derive"], optional = true } schemars = { version = "0.8", optional = true } + +[target.'cfg(feature = "linux")'.dev-dependencies] rtnetlink = "0.14" futures = { version = "0.3.28", optional = true } diff --git a/tun/src/unix/apple/mod.rs b/tun/src/unix/apple/mod.rs index 6e859cac..82e3f71c 100644 --- a/tun/src/unix/apple/mod.rs +++ b/tun/src/unix/apple/mod.rs @@ -247,4 +247,10 @@ impl TunInterface { .try_into() .map_err(|_| Error::new(ErrorKind::Other, "Conversion error"))? } + + #[throws] + #[instrument] + pub fn set_up(&self, up: bool) { + tracing::warn!("Setting tun up is not supported yet on apple."); + } }