diff options
author | Roopesh Chander <roop@roopc.net> | 2019-02-27 13:30:57 +0530 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-18 06:46:55 +0100 |
commit | 5941bf181cc37368cfff5e1d92398bce6c7b8a5e (patch) | |
tree | 8375b2e35e3544512c25accedf2adb63ceea7346 /WireGuard/WireGuard/Tunnel | |
parent | on-demand: Introducing ActivateOnDemandViewModel (diff) | |
download | wireguard-apple-5941bf181cc37368cfff5e1d92398bce6c7b8a5e.tar.xz wireguard-apple-5941bf181cc37368cfff5e1d92398bce6c7b8a5e.zip |
on-demand: iOS: Support for SSIDs
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/Tunnel')
-rw-r--r-- | WireGuard/WireGuard/Tunnel/ActivateOnDemandSetting.swift | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/Tunnel/ActivateOnDemandSetting.swift b/WireGuard/WireGuard/Tunnel/ActivateOnDemandSetting.swift index 28612c7..89edd77 100644 --- a/WireGuard/WireGuard/Tunnel/ActivateOnDemandSetting.swift +++ b/WireGuard/WireGuard/Tunnel/ActivateOnDemandSetting.swift @@ -132,3 +132,13 @@ private func ssidOnDemandRules(option: ActivateOnDemandSSIDOption) -> [NEOnDeman NEOnDemandRuleConnect(interfaceType: .wiFi)] } } + +extension ActivateOnDemandSetting { + init(with option: ActivateOnDemandOption) { + if option == .none { + self = ActivateOnDemandSetting(isActivateOnDemandEnabled: false, activateOnDemandOption: option) + } else { + self = ActivateOnDemandSetting(isActivateOnDemandEnabled: true, activateOnDemandOption: option) + } + } +} |