From 4ed646973ee4e1871cda792083bf4fe70afa8c3f Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 22 Dec 2018 00:28:18 +0100 Subject: Move name from interface to tunnel Signed-off-by: Jason A. Donenfeld --- WireGuard/WireGuard/Tunnel/TunnelsManager.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'WireGuard/WireGuard/Tunnel') diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift index 8c7bbb3..bf5ab52 100644 --- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift +++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift @@ -54,7 +54,7 @@ class TunnelsManager { } func add(tunnelConfiguration: TunnelConfiguration, activateOnDemandSetting: ActivateOnDemandSetting = ActivateOnDemandSetting.defaultSetting, completionHandler: @escaping (WireGuardResult) -> Void) { - let tunnelName = tunnelConfiguration.interface.name ?? "" + let tunnelName = tunnelConfiguration.name ?? "" if tunnelName.isEmpty { completionHandler(.failure(TunnelsManagerError.tunnelNameEmpty)) return @@ -67,7 +67,7 @@ class TunnelsManager { let tunnelProviderManager = NETunnelProviderManager() tunnelProviderManager.protocolConfiguration = NETunnelProviderProtocol(tunnelConfiguration: tunnelConfiguration) - tunnelProviderManager.localizedDescription = tunnelConfiguration.interface.name + tunnelProviderManager.localizedDescription = tunnelConfiguration.name tunnelProviderManager.isEnabled = true activateOnDemandSetting.apply(on: tunnelProviderManager) @@ -107,7 +107,7 @@ class TunnelsManager { } func modify(tunnel: TunnelContainer, tunnelConfiguration: TunnelConfiguration, activateOnDemandSetting: ActivateOnDemandSetting, completionHandler: @escaping (TunnelsManagerError?) -> Void) { - let tunnelName = tunnelConfiguration.interface.name ?? "" + let tunnelName = tunnelConfiguration.name ?? "" if tunnelName.isEmpty { completionHandler(TunnelsManagerError.tunnelNameEmpty) return @@ -124,7 +124,7 @@ class TunnelsManager { } tunnelProviderManager.protocolConfiguration = NETunnelProviderProtocol(tunnelConfiguration: tunnelConfiguration) - tunnelProviderManager.localizedDescription = tunnelConfiguration.interface.name + tunnelProviderManager.localizedDescription = tunnelConfiguration.name tunnelProviderManager.isEnabled = true let isActivatingOnDemand = !tunnelProviderManager.isOnDemandEnabled && activateOnDemandSetting.isActivateOnDemandEnabled @@ -349,7 +349,7 @@ class TunnelContainer: NSObject { private var lastTunnelConnectionStatus: NEVPNStatus? var tunnelConfiguration: TunnelConfiguration? { - return (tunnelProvider.protocolConfiguration as? NETunnelProviderProtocol)?.tunnelConfiguration(name: tunnelProvider.localizedDescription) + return (tunnelProvider.protocolConfiguration as? NETunnelProviderProtocol)?.asTunnelConfiguration(called: tunnelProvider.localizedDescription) } var activateOnDemandSetting: ActivateOnDemandSetting { -- cgit v1.2.3-59-g8ed1b