aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/VPN/TunnelsManager.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-12-07 19:05:04 +0530
committerRoopesh Chander <roop@roopc.net>2018-12-07 19:05:08 +0530
commit105eca7adcaa41f54228da53e237316e61f08c98 (patch)
tree84747d6faa72aced77dafb03aab79b641f8c2d64 /WireGuard/WireGuard/VPN/TunnelsManager.swift
parentMain VC: No need to refresh statuses if the tunnelsManager isn't initialized yet (diff)
downloadwireguard-apple-105eca7adcaa41f54228da53e237316e61f08c98.tar.xz
wireguard-apple-105eca7adcaa41f54228da53e237316e61f08c98.zip
State restoration: Restore tunnel detail view
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/VPN/TunnelsManager.swift4
1 files changed, 4 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/VPN/TunnelsManager.swift b/WireGuard/WireGuard/VPN/TunnelsManager.swift
index 4aada0c..4653b4c 100644
--- a/WireGuard/WireGuard/VPN/TunnelsManager.swift
+++ b/WireGuard/WireGuard/VPN/TunnelsManager.swift
@@ -238,6 +238,10 @@ class TunnelsManager {
return tunnels[index]
}
+ func tunnel(named tunnelName: String) -> TunnelContainer? {
+ return self.tunnels.first(where: { $0.name == tunnelName })
+ }
+
func startActivation(of tunnel: TunnelContainer, completionHandler: @escaping (TunnelsManagerError?) -> Void) {
guard (tunnel.status == .inactive) else {
return