diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-03-05 15:27:37 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-04-03 16:46:17 +0000 |
| commit | b76af88963d6260645b2e12da363a7790fdf1a16 (patch) | |
| tree | baa552792fa6418023ffdc1b041922735626419d | |
| parent | 896de4e12f5c8a755cca7d86bbb4043815287e6f (diff) | |
| download | mullvadvpn-b76af88963d6260645b2e12da363a7790fdf1a16.tar.xz mullvadvpn-b76af88963d6260645b2e12da363a7790fdf1a16.zip | |
Stub `RouteManager` for Android
| -rw-r--r-- | talpid-core/src/routing/android.rs | 32 | ||||
| -rw-r--r-- | talpid-core/src/routing/mod.rs | 5 |
2 files changed, 36 insertions, 1 deletions
diff --git a/talpid-core/src/routing/android.rs b/talpid-core/src/routing/android.rs new file mode 100644 index 0000000000..fa5c5c8f8e --- /dev/null +++ b/talpid-core/src/routing/android.rs @@ -0,0 +1,32 @@ +use super::{ + subprocess::{Exec, RunExpr}, + NetNode, RequiredRoutes, +}; +use std::{ + collections::HashSet, + net::{IpAddr, Ipv4Addr}, +}; + +error_chain! {} + +pub struct RouteManager; + +impl super::RoutingT for RouteManager { + type Error = Error; + + fn new() -> Result<Self> { + Ok(RouteManager) + } + + fn add_routes(&mut self, _required_routes: RequiredRoutes) -> Result<()> { + Ok(()) + } + + fn delete_routes(&mut self) -> Result<()> { + Ok(()) + } + + fn get_default_route_node(&mut self) -> Result<IpAddr> { + Ok(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0))) + } +} diff --git a/talpid-core/src/routing/mod.rs b/talpid-core/src/routing/mod.rs index 50385a436f..612c0b2396 100644 --- a/talpid-core/src/routing/mod.rs +++ b/talpid-core/src/routing/mod.rs @@ -9,8 +9,11 @@ mod imp; #[path = "linux.rs"] mod imp; -mod subprocess; +#[cfg(target_os = "android")] +#[path = "android.rs"] +mod imp; +mod subprocess; /// A single route #[derive(Hash, Eq, PartialEq)] |
