aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/TunnelViewModel.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-02-16 18:25:17 +0530
committerRoopesh Chander <roop@roopc.net>2019-02-16 18:25:17 +0530
commit5031a7db4c70d6f71ea568839b67c39ab68b4bdb (patch)
treeb46c45118752673224d873e3946879e01726cd54 /WireGuard/WireGuard/UI/TunnelViewModel.swift
parentTunnelViewModel: Minor refactoring of exclude private IPs handling (diff)
downloadwireguard-apple-5031a7db4c70d6f71ea568839b67c39ab68b4bdb.tar.xz
wireguard-apple-5031a7db4c70d6f71ea568839b67c39ab68b4bdb.zip
macOS: Exclude private IPs
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/TunnelViewModel.swift')
-rw-r--r--WireGuard/WireGuard/UI/TunnelViewModel.swift8
1 files changed, 8 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/TunnelViewModel.swift b/WireGuard/WireGuard/UI/TunnelViewModel.swift
index 1864cad..8f95039 100644
--- a/WireGuard/WireGuard/UI/TunnelViewModel.swift
+++ b/WireGuard/WireGuard/UI/TunnelViewModel.swift
@@ -547,6 +547,14 @@ class TunnelViewModel {
}
}
+ func asWgQuickConfig() -> String? {
+ let saveResult = save()
+ if case .saved(let tunnelConfiguration) = saveResult {
+ return tunnelConfiguration.asWgQuickConfig()
+ }
+ return nil
+ }
+
@discardableResult
func applyConfiguration(other: TunnelConfiguration) -> Changes {
// Replaces current data with data from other TunnelConfiguration, ignoring any changes in peer ordering.