diff options
author | Jeroen Leenarts <jeroen.leenarts@gmail.com> | 2018-08-31 21:40:24 +0200 |
---|---|---|
committer | Jeroen Leenarts <jeroen.leenarts@gmail.com> | 2018-08-31 21:40:24 +0200 |
commit | 4950254013dc4db21fab296b3a928405f3dae7a1 (patch) | |
tree | 793296be81a41c111210174f5e65c682f1cdf62a /WireGuard/Models/Interface+Extension.swift | |
parent | wireguard-go-bridge: include header for free function (diff) | |
download | wireguard-apple-4950254013dc4db21fab296b3a928405f3dae7a1.tar.xz wireguard-apple-4950254013dc4db21fab296b3a928405f3dae7a1.zip |
Add addresses, dns and mtu to export string.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | WireGuard/Models/Interface+Extension.swift | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/WireGuard/Models/Interface+Extension.swift b/WireGuard/Models/Interface+Extension.swift index 3b6ef62..5fdb5af 100644 --- a/WireGuard/Models/Interface+Extension.swift +++ b/WireGuard/Models/Interface+Extension.swift @@ -60,10 +60,19 @@ extension Interface { func export() -> String { var exportString = "[Interface]\n" if let privateKey = privateKey { - exportString.append("PrivateKey=\(privateKey)") + exportString.append("PrivateKey=\(privateKey)\n") + } + if let addresses = addresses { + exportString.append("Address=\(addresses)\n") + } + if let dns = dns { + exportString.append("DNS=\(dns)\n") + } + if mtu > 0 { + exportString.append("MTU=\(mtu)\n") } if listenPort > 0 { - exportString.append("ListenPort=\(listenPort)") + exportString.append("ListenPort=\(listenPort)\n") } exportString.append("\n") |