Fix function length warning.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
cc4bd254a2
commit
bd9d676c8f
|
@ -14,8 +14,20 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
var wgHandle: Int32?
|
private var wgHandle: Int32?
|
||||||
var wgContext: WireGuardContext?
|
private var wgContext: WireGuardContext?
|
||||||
|
|
||||||
|
private var config: NETunnelProviderProtocol {
|
||||||
|
return self.protocolConfiguration as! NETunnelProviderProtocol // swiftlint:disable:this force_cast
|
||||||
|
}
|
||||||
|
|
||||||
|
private var interfaceName: String {
|
||||||
|
return config.providerConfiguration![PCKeys.title.rawValue]! as! String // swiftlint:disable:this force_cast
|
||||||
|
}
|
||||||
|
|
||||||
|
private var settings: String {
|
||||||
|
return config.providerConfiguration![PCKeys.settings.rawValue]! as! String // swiftlint:disable:this force_cast
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: NEPacketTunnelProvider
|
// MARK: NEPacketTunnelProvider
|
||||||
|
|
||||||
|
@ -23,10 +35,6 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
||||||
override func startTunnel(options: [String: NSObject]?, completionHandler startTunnelCompletionHandler: @escaping (Error?) -> Void) {
|
override func startTunnel(options: [String: NSObject]?, completionHandler startTunnelCompletionHandler: @escaping (Error?) -> Void) {
|
||||||
os_log("Starting tunnel", log: Log.general, type: .info)
|
os_log("Starting tunnel", log: Log.general, type: .info)
|
||||||
|
|
||||||
let config = self.protocolConfiguration as! NETunnelProviderProtocol // swiftlint:disable:this force_cast
|
|
||||||
let interfaceName = config.providerConfiguration![PCKeys.title.rawValue]! as! String // swiftlint:disable:this force_cast
|
|
||||||
let settings = config.providerConfiguration![PCKeys.settings.rawValue]! as! String // swiftlint:disable:this force_cast
|
|
||||||
|
|
||||||
let validatedEndpoints = (config.providerConfiguration?[PCKeys.endpoints.rawValue] as? String ?? "").commaSeparatedToArray().compactMap { try? Endpoint(endpointString: String($0)) }.compactMap {$0}
|
let validatedEndpoints = (config.providerConfiguration?[PCKeys.endpoints.rawValue] as? String ?? "").commaSeparatedToArray().compactMap { try? Endpoint(endpointString: String($0)) }.compactMap {$0}
|
||||||
let validatedAddresses = (config.providerConfiguration?[PCKeys.addresses.rawValue] as? String ?? "").commaSeparatedToArray().compactMap { try? CIDRAddress(stringRepresentation: String($0)) }.compactMap { $0 }
|
let validatedAddresses = (config.providerConfiguration?[PCKeys.addresses.rawValue] as? String ?? "").commaSeparatedToArray().compactMap { try? CIDRAddress(stringRepresentation: String($0)) }.compactMap { $0 }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue