Use IPAddressRange in the Configuration model

This commit is contained in:
Roopesh Chander 2018-10-13 19:05:52 +05:30
parent 0948363d5b
commit f6054775ca
1 changed files with 5 additions and 2 deletions

View File

@ -8,6 +8,7 @@
import Foundation
@available(OSX 10.14, iOS 12.0, *)
class TunnelConfiguration: Codable {
var name: String
let interface: InterfaceConfiguration
@ -18,9 +19,10 @@ class TunnelConfiguration: Codable {
}
}
@available(OSX 10.14, iOS 12.0, *)
class InterfaceConfiguration: Codable {
var privateKey: Data
var addresses: [String] = []
var addresses: [IPAddressRange] = []
var listenPort: UInt64? = nil
var mtu: UInt64? = nil
var dns: String? = nil
@ -29,10 +31,11 @@ class InterfaceConfiguration: Codable {
}
}
@available(OSX 10.14, iOS 12.0, *)
class PeerConfiguration: Codable {
var publicKey: Data
var preSharedKey: Data?
var allowedIPs: [String] = []
var allowedIPs: [IPAddressRange] = []
var endpoint: String?
var persistentKeepAlive: UInt64?
init(publicKey: Data) {