diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2024-08-03 02:00:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-03 02:00:54 +0200 |
commit | 863a7fbedfb8d443a528e7475edb5de541499ce9 (patch) | |
tree | 7fa2f03bd46ea93f8d630c52218a4c22416d0969 /src-tauri/src/platform_specific/mod.rs | |
parent | 1ac4198ec988ac49cb7740336df7a43bab3fbe52 (diff) | |
download | FlightCore-863a7fbedfb8d443a528e7475edb5de541499ce9.tar.gz FlightCore-863a7fbedfb8d443a528e7475edb5de541499ce9.zip |
feat: Add initial CGNAT check logic (#969)
Adds some logic that gets external IP and runs tracert to count the number of hops to said IP address. The goal is to have an automated way to check for CGNAT.
Diffstat (limited to 'src-tauri/src/platform_specific/mod.rs')
-rw-r--r-- | src-tauri/src/platform_specific/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src-tauri/src/platform_specific/mod.rs b/src-tauri/src/platform_specific/mod.rs index 6fdb1ed1..4e0514d4 100644 --- a/src-tauri/src/platform_specific/mod.rs +++ b/src-tauri/src/platform_specific/mod.rs @@ -38,3 +38,13 @@ pub async fn get_local_northstar_proton_wrapper_version() -> Result<String, Stri #[cfg(target_os = "windows")] Err("Not supported on Windows".to_string()) } + +/// Check whether the current device might be behind a CGNAT +#[tauri::command] +pub async fn check_cgnat() -> Result<String, String> { + #[cfg(target_os = "linux")] + return Err("Not supported on Linux".to_string()); + + #[cfg(target_os = "windows")] + windows::check_cgnat().await +} |