Model: Name should be part of the interface, not the tunnel
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
6de354b4c5
commit
921b81e89b
|
@ -10,23 +10,23 @@ import Foundation
|
|||
|
||||
@available(OSX 10.14, iOS 12.0, *)
|
||||
class TunnelConfiguration: Codable {
|
||||
var name: String
|
||||
let interface: InterfaceConfiguration
|
||||
var peers: [PeerConfiguration] = []
|
||||
init(name: String, interface: InterfaceConfiguration) {
|
||||
self.name = name
|
||||
init(interface: InterfaceConfiguration) {
|
||||
self.interface = interface
|
||||
}
|
||||
}
|
||||
|
||||
@available(OSX 10.14, iOS 12.0, *)
|
||||
class InterfaceConfiguration: Codable {
|
||||
var name: String
|
||||
var privateKey: Data
|
||||
var addresses: [IPAddressRange] = []
|
||||
var listenPort: UInt64? = nil
|
||||
var mtu: UInt64? = nil
|
||||
var dns: String? = nil
|
||||
init(privateKey: Data) {
|
||||
init(name: String, privateKey: Data) {
|
||||
self.name = name
|
||||
self.privateKey = privateKey
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ class TunnelProviderManager {
|
|||
var name: String
|
||||
var tunnelConfiguration: TunnelConfiguration
|
||||
init(tunnelConfiguration: TunnelConfiguration) {
|
||||
self.name = tunnelConfiguration.name
|
||||
self.name = tunnelConfiguration.interface.name
|
||||
self.tunnelConfiguration = tunnelConfiguration
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue