aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-10-24 17:21:39 +0530
committerRoopesh Chander <roop@roopc.net>2018-10-27 15:13:01 +0530
commit6cddb9e34b14f8c215492574a3e7144fbae68337 (patch)
tree4655874794f08b9cd435f67627c8089263b361d4
parentTunnel editing: Modifying a tunnel configuration (diff)
downloadwireguard-apple-6cddb9e34b14f8c215492574a3e7144fbae68337.tar.xz
wireguard-apple-6cddb9e34b14f8c215492574a3e7144fbae68337.zip
VPN: Tunnel container shall provide direct access to the configuration object
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift4
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift2
-rw-r--r--WireGuard/WireGuard/VPN/TunnelsManager.swift5
3 files changed, 7 insertions, 4 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
index 18a2fe3..1ca6ec6 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
@@ -25,7 +25,7 @@ class TunnelDetailTableViewController: UITableViewController {
init(tunnelsManager tm: TunnelsManager, tunnel t: TunnelContainer) {
tunnelsManager = tm
tunnel = t
- tunnelViewModel = TunnelViewModel(tunnelConfiguration: t.tunnelProvider.tunnelConfiguration)
+ tunnelViewModel = TunnelViewModel(tunnelConfiguration: t.tunnelConfiguration)
super.init(style: .grouped)
}
@@ -55,7 +55,7 @@ class TunnelDetailTableViewController: UITableViewController {
extension TunnelDetailTableViewController: TunnelEditTableViewControllerDelegate {
func saved(tunnel: TunnelContainer) {
- tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnel.tunnelProvider.tunnelConfiguration)
+ tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnel.tunnelConfiguration)
self.tableView.reloadData()
}
}
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
index 2543444..e3efc50 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
@@ -32,7 +32,7 @@ class TunnelEditTableViewController: UITableViewController {
init(tunnelsManager tm: TunnelsManager, tunnel t: TunnelContainer? = nil) {
tunnelsManager = tm
tunnel = t
- tunnelViewModel = TunnelViewModel(tunnelConfiguration: t?.tunnelProvider.tunnelConfiguration)
+ tunnelViewModel = TunnelViewModel(tunnelConfiguration: t?.tunnelConfiguration)
super.init(style: .grouped)
self.modalPresentationStyle = .formSheet
}
diff --git a/WireGuard/WireGuard/VPN/TunnelsManager.swift b/WireGuard/WireGuard/VPN/TunnelsManager.swift
index 704506a..9552c42 100644
--- a/WireGuard/WireGuard/VPN/TunnelsManager.swift
+++ b/WireGuard/WireGuard/VPN/TunnelsManager.swift
@@ -6,7 +6,7 @@ import Foundation
class TunnelProviderManager {
// Mock of NETunnelProviderManager
var name: String
- var tunnelConfiguration: TunnelConfiguration
+ fileprivate var tunnelConfiguration: TunnelConfiguration
init(tunnelConfiguration: TunnelConfiguration) {
self.name = tunnelConfiguration.interface.name
self.tunnelConfiguration = tunnelConfiguration
@@ -16,6 +16,9 @@ class TunnelProviderManager {
class TunnelContainer {
var name: String { return tunnelProvider.name }
let tunnelProvider: TunnelProviderManager
+ var tunnelConfiguration: TunnelConfiguration {
+ get { return tunnelProvider.tunnelConfiguration }
+ }
var index: Int
init(tunnel: TunnelProviderManager, index: Int) {
self.tunnelProvider = tunnel