summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2020-05-08 16:20:02 +0200
committerAndrej Mihajlov <and@mullvad.net>2020-05-08 16:20:02 +0200
commit42ee944f83e4a116757a99fb5958e13d340b4c7e (patch)
tree402798e3219f29640c709e7549680ec88685fbb7
parentd96cc30415577bf99008f2ddb54345e0dca728c5 (diff)
downloadmullvadvpn-42ee944f83e4a116757a99fb5958e13d340b4c7e.tar.xz
mullvadvpn-42ee944f83e4a116757a99fb5958e13d340b4c7e.zip
Add ondemand fields to the simulated tunnel
-rw-r--r--ios/MullvadVPN/SimulatorTunnelProvider.swift26
1 files changed, 26 insertions, 0 deletions
diff --git a/ios/MullvadVPN/SimulatorTunnelProvider.swift b/ios/MullvadVPN/SimulatorTunnelProvider.swift
index 4fb22eb951..6844dd9921 100644
--- a/ios/MullvadVPN/SimulatorTunnelProvider.swift
+++ b/ios/MullvadVPN/SimulatorTunnelProvider.swift
@@ -158,6 +158,12 @@ private struct SimulatorTunnelInfo {
/// Whether configuration is enabled
var isEnabled = false
+ /// Whether on-demand VPN is enabled
+ var isOnDemandEnabled = false
+
+ /// On-demand VPN rules
+ var onDemandRules = [NEOnDemandRule]()
+
/// Protocol configuration
var protocolConfiguration: NEVPNProtocol?
@@ -176,6 +182,26 @@ class SimulatorTunnelProviderManager: VPNTunnelProviderManagerProtocol, Equatabl
lock.withCriticalBlock { tunnelInfo.identifier }
}
+ var isOnDemandEnabled: Bool {
+ get {
+ lock.withCriticalBlock { tunnelInfo.isOnDemandEnabled }
+ }
+ set {
+ lock.withCriticalBlock {
+ tunnelInfo.isOnDemandEnabled = newValue
+ }
+ }
+ }
+
+ var onDemandRules: [NEOnDemandRule] {
+ get {
+ lock.withCriticalBlock { tunnelInfo.onDemandRules }
+ }
+ set {
+ lock.withCriticalBlock { tunnelInfo.onDemandRules = newValue }
+ }
+ }
+
var isEnabled: Bool {
get {
lock.withCriticalBlock { tunnelInfo.isEnabled }