aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/Tunnel/TunnelStatus.swift
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2020-12-02 12:27:39 +0100
committerAndrej Mihajlov <and@mullvad.net>2020-12-03 13:32:24 +0100
commitec574085703ea1c8b2d4538596961beb910c4382 (patch)
tree73cf8bbdb74fe5575606664bccd0232ffa911803 /WireGuard/WireGuard/Tunnel/TunnelStatus.swift
parentWireGuardKit: Assert that resolutionResults must not contain failures (diff)
downloadwireguard-apple-ec574085703ea1c8b2d4538596961beb910c4382.tar.xz
wireguard-apple-ec574085703ea1c8b2d4538596961beb910c4382.zip
Move all source files to `Sources/` and rename WireGuardKit targets
Signed-off-by: Andrej Mihajlov <and@mullvad.net>
Diffstat (limited to 'WireGuard/WireGuard/Tunnel/TunnelStatus.swift')
-rw-r--r--WireGuard/WireGuard/Tunnel/TunnelStatus.swift63
1 files changed, 0 insertions, 63 deletions
diff --git a/WireGuard/WireGuard/Tunnel/TunnelStatus.swift b/WireGuard/WireGuard/Tunnel/TunnelStatus.swift
deleted file mode 100644
index 547aa9f..0000000
--- a/WireGuard/WireGuard/Tunnel/TunnelStatus.swift
+++ /dev/null
@@ -1,63 +0,0 @@
-// SPDX-License-Identifier: MIT
-// Copyright © 2018-2019 WireGuard LLC. All Rights Reserved.
-
-import Foundation
-import NetworkExtension
-
-@objc enum TunnelStatus: Int {
- case inactive
- case activating
- case active
- case deactivating
- case reasserting // Not a possible state at present
- case restarting // Restarting tunnel (done after saving modifications to an active tunnel)
- case waiting // Waiting for another tunnel to be brought down
-
- init(from systemStatus: NEVPNStatus) {
- switch systemStatus {
- case .connected:
- self = .active
- case .connecting:
- self = .activating
- case .disconnected:
- self = .inactive
- case .disconnecting:
- self = .deactivating
- case .reasserting:
- self = .reasserting
- case .invalid:
- self = .inactive
- @unknown default:
- fatalError()
- }
- }
-}
-
-extension TunnelStatus: CustomDebugStringConvertible {
- public var debugDescription: String {
- switch self {
- case .inactive: return "inactive"
- case .activating: return "activating"
- case .active: return "active"
- case .deactivating: return "deactivating"
- case .reasserting: return "reasserting"
- case .restarting: return "restarting"
- case .waiting: return "waiting"
- }
- }
-}
-
-extension NEVPNStatus: CustomDebugStringConvertible {
- public var debugDescription: String {
- switch self {
- case .connected: return "connected"
- case .connecting: return "connecting"
- case .disconnected: return "disconnected"
- case .disconnecting: return "disconnecting"
- case .reasserting: return "reasserting"
- case .invalid: return "invalid"
- @unknown default:
- fatalError()
- }
- }
-}