diff options
Diffstat (limited to 'talpid-core/src')
| -rw-r--r-- | talpid-core/src/tunnel/tun_provider/mod.rs | 8 | ||||
| -rw-r--r-- | talpid-core/src/tunnel/tun_provider/stub.rs | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/talpid-core/src/tunnel/tun_provider/mod.rs b/talpid-core/src/tunnel/tun_provider/mod.rs index 3cac459c51..16c9c3f17c 100644 --- a/talpid-core/src/tunnel/tun_provider/mod.rs +++ b/talpid-core/src/tunnel/tun_provider/mod.rs @@ -53,6 +53,14 @@ pub trait TunProvider: Send + 'static { fn get_tun(&mut self, config: TunConfig) -> Result<Box<dyn Tun>, BoxedError>; /// Open a tunnel device using the previous or the default configuration. + /// + /// Will open a new tunnel if there is already an active tunnel. The previous tunnel will be + /// closed. + #[cfg(target_os = "android")] + fn create_tun(&mut self) -> Result<(), BoxedError>; + + /// Open a tunnel device using the previous or the default configuration if there is no + /// currently active tunnel. #[cfg(target_os = "android")] fn create_tun_if_closed(&mut self) -> Result<(), BoxedError>; diff --git a/talpid-core/src/tunnel/tun_provider/stub.rs b/talpid-core/src/tunnel/tun_provider/stub.rs index be985c8045..3cd6dd0ee8 100644 --- a/talpid-core/src/tunnel/tun_provider/stub.rs +++ b/talpid-core/src/tunnel/tun_provider/stub.rs @@ -16,6 +16,11 @@ impl TunProvider for StubTunProvider { } #[cfg(target_os = "android")] + fn create_tun(&mut self) -> Result<(), BoxedError> { + unimplemented!(); + } + + #[cfg(target_os = "android")] fn create_tun_if_closed(&mut self) -> Result<(), BoxedError> { unimplemented!(); } |
