summaryrefslogtreecommitdiffhomepage
path: root/test/test-rpc/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-rpc/src/lib.rs')
-rw-r--r--test/test-rpc/src/lib.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test-rpc/src/lib.rs b/test/test-rpc/src/lib.rs
index 5919a894d1..d2bee40dbb 100644
--- a/test/test-rpc/src/lib.rs
+++ b/test/test-rpc/src/lib.rs
@@ -53,6 +53,8 @@ pub enum Error {
InvalidUrl,
#[error(display = "Timeout")]
Timeout,
+ #[error(display = "TCP forward error")]
+ TcpForward,
}
/// Response from am.i.mullvad.net
@@ -148,6 +150,16 @@ mod service {
/// Perform DNS resolution.
async fn resolve_hostname(hostname: String) -> Result<Vec<SocketAddr>, Error>;
+ /// Start forwarding TCP bound to the given address. Return an ID that can be used with
+ /// `stop_tcp_forward`, and the address that the listening socket was actually bound to.
+ async fn start_tcp_forward(
+ bind_addr: SocketAddr,
+ via_addr: SocketAddr,
+ ) -> Result<(net::SockHandleId, SocketAddr), Error>;
+
+ /// Stop forwarding TCP that was previously started with `start_tcp_forward`.
+ async fn stop_tcp_forward(id: net::SockHandleId) -> Result<(), Error>;
+
/// Restart the Mullvad VPN application.
async fn restart_mullvad_daemon() -> Result<(), Error>;