-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
iHsin
committed
Mar 30, 2024
1 parent
e926959
commit 1594cc2
Showing
8 changed files
with
64 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use crate::config::internal::config::TunConfig; | ||
|
||
#[cfg(target_os = "linux")] | ||
pub async fn setup(cfg: &mut TunConfig, tun_name: &str) -> anyhow::Result<()>{ | ||
if !cfg.auto_route.unwrap_or(false) { | ||
return Ok(()); | ||
} | ||
let mark = cfg.mark.unwrap_or(6969); | ||
cfg.mark = Some(mark); | ||
let table = cfg.table.take().unwrap_or("2233".into()); | ||
cfg.table = Some(table); | ||
// TODO | ||
Ok(()) | ||
} | ||
|
||
#[cfg(not(target_os = "linux"))] | ||
pub fn setup(cfg: &mut TunConfig, tun_name: &str) -> anyhow::Result<()>{ | ||
tracing::error!("Auto route not impl!"); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod inbound; | ||
pub mod auto_route; | ||
pub use netstack_lwip as netstack; | ||
mod datagram; | ||
pub use inbound::get_runner as get_tun_runner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters