diff options
Diffstat (limited to 'WireGuard/Shared/Model/Legacy/LegacyInterfaceConfiguration.swift')
-rw-r--r-- | WireGuard/Shared/Model/Legacy/LegacyInterfaceConfiguration.swift | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/WireGuard/Shared/Model/Legacy/LegacyInterfaceConfiguration.swift b/WireGuard/Shared/Model/Legacy/LegacyInterfaceConfiguration.swift new file mode 100644 index 0000000..680c8d7 --- /dev/null +++ b/WireGuard/Shared/Model/Legacy/LegacyInterfaceConfiguration.swift @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +// Copyright © 2018 WireGuard LLC. All Rights Reserved. + +import Foundation + +struct LegacyInterfaceConfiguration: Codable { + let name: String + let privateKey: Data + let addresses: [LegacyIPAddressRange] + let listenPort: UInt16? + let mtu: UInt16? + let dns: [LegacyDNSServer] +} + +extension LegacyInterfaceConfiguration { + var migrated: InterfaceConfiguration { + var interface = InterfaceConfiguration(name: name, privateKey: privateKey) + interface.addresses = addresses.migrated + interface.listenPort = listenPort + interface.mtu = mtu + interface.dns = dns.migrated + return interface + } +} |