2018-12-21 04:52:45 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
// Copyright © 2018 WireGuard LLC. All Rights Reserved.
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
struct InterfaceConfiguration {
|
2018-12-21 21:16:09 +00:00
|
|
|
var name: String?
|
2018-12-21 04:52:45 +00:00
|
|
|
var privateKey: Data
|
|
|
|
var addresses = [IPAddressRange]()
|
|
|
|
var listenPort: UInt16?
|
|
|
|
var mtu: UInt16?
|
|
|
|
var dns = [DNSServer]()
|
2018-12-21 22:34:56 +00:00
|
|
|
|
2018-12-21 21:16:09 +00:00
|
|
|
init(name: String?, privateKey: Data) {
|
2018-12-21 04:52:45 +00:00
|
|
|
self.name = name
|
|
|
|
self.privateKey = privateKey
|
|
|
|
if privateKey.count != TunnelConfiguration.keyLength {
|
|
|
|
fatalError("Invalid private key")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|