Backend: Add a function to enumerate running tunnels

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland
2018-01-06 05:18:34 -06:00
parent 2543f28274
commit 1c2239ae91
2 changed files with 27 additions and 16 deletions
@@ -5,6 +5,8 @@ import com.wireguard.android.model.Tunnel.State;
import com.wireguard.android.model.Tunnel.Statistics;
import com.wireguard.config.Config;
import java.util.Set;
import java9.util.concurrent.CompletionStage;
/**
@@ -25,6 +27,14 @@ public interface Backend {
*/
CompletionStage<Config> applyConfig(Tunnel tunnel, Config config);
/**
* Enumerate the names of currently-running tunnels.
*
* @return A future completed when the set of running tunnel names is available. This future
* will always be completed on the main thread.
*/
CompletionStage<Set<String>> enumerate();
/**
* Get the actual state of a tunnel, asynchronously.
*