summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/MullvadVPN/SimulatorTunnelProvider/SimulatorTunnelProvider.swift22
-rw-r--r--ios/MullvadVPN/TunnelManager/VPNConnectionProtocol.swift22
2 files changed, 22 insertions, 22 deletions
diff --git a/ios/MullvadVPN/SimulatorTunnelProvider/SimulatorTunnelProvider.swift b/ios/MullvadVPN/SimulatorTunnelProvider/SimulatorTunnelProvider.swift
index bfbc9cb301..64b8b55b17 100644
--- a/ios/MullvadVPN/SimulatorTunnelProvider/SimulatorTunnelProvider.swift
+++ b/ios/MullvadVPN/SimulatorTunnelProvider/SimulatorTunnelProvider.swift
@@ -11,28 +11,6 @@ import NetworkExtension
#if targetEnvironment(simulator)
-protocol VPNTunnelProviderManagerProtocol: Equatable {
- associatedtype SelfType: VPNTunnelProviderManagerProtocol
- associatedtype ConnectionType: VPNConnectionProtocol
-
- var isEnabled: Bool { get set }
- var protocolConfiguration: NEVPNProtocol? { get set }
- var localizedDescription: String? { get set }
- var connection: ConnectionType { get }
-
- init()
-
- func loadFromPreferences(completionHandler: @escaping (Error?) -> Void)
- func saveToPreferences(completionHandler: ((Error?) -> Void)?)
- func removeFromPreferences(completionHandler: ((Error?) -> Void)?)
-
- static func loadAllFromPreferences(completionHandler: @escaping ([SelfType]?, Error?) -> Void)
-}
-
-extension NEVPNConnection: VPNConnectionProtocol {}
-extension NETunnelProviderSession: VPNTunnelProviderSessionProtocol {}
-extension NETunnelProviderManager: VPNTunnelProviderManagerProtocol {}
-
class SimulatorTunnelProviderDelegate {
var connection: SimulatorVPNConnection?
diff --git a/ios/MullvadVPN/TunnelManager/VPNConnectionProtocol.swift b/ios/MullvadVPN/TunnelManager/VPNConnectionProtocol.swift
index fbf9280b9b..43f4cfe975 100644
--- a/ios/MullvadVPN/TunnelManager/VPNConnectionProtocol.swift
+++ b/ios/MullvadVPN/TunnelManager/VPNConnectionProtocol.swift
@@ -9,6 +9,24 @@
import Foundation
import NetworkExtension
+protocol VPNTunnelProviderManagerProtocol: Equatable {
+ associatedtype SelfType: VPNTunnelProviderManagerProtocol
+ associatedtype ConnectionType: VPNConnectionProtocol
+
+ var isEnabled: Bool { get set }
+ var protocolConfiguration: NEVPNProtocol? { get set }
+ var localizedDescription: String? { get set }
+ var connection: ConnectionType { get }
+
+ init()
+
+ func loadFromPreferences(completionHandler: @escaping (Error?) -> Void)
+ func saveToPreferences(completionHandler: ((Error?) -> Void)?)
+ func removeFromPreferences(completionHandler: ((Error?) -> Void)?)
+
+ static func loadAllFromPreferences(completionHandler: @escaping ([SelfType]?, Error?) -> Void)
+}
+
protocol VPNConnectionProtocol: NSObject {
var status: NEVPNStatus { get }
var connectedDate: Date? { get }
@@ -21,3 +39,7 @@ protocol VPNConnectionProtocol: NSObject {
protocol VPNTunnelProviderSessionProtocol {
func sendProviderMessage(_ messageData: Data, responseHandler: ((Data?) -> Void)?) throws
}
+
+extension NEVPNConnection: VPNConnectionProtocol {}
+extension NETunnelProviderSession: VPNTunnelProviderSessionProtocol {}
+extension NETunnelProviderManager: VPNTunnelProviderManagerProtocol {}