summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/NEProviderStopReason+Debug.swift
blob: eab9028dbecfca18f8489558a4283d7309ca3536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
//  NEProviderStopReason+Debug.swift
//  PacketTunnel
//
//  Created by pronebird on 14/04/2020.
//  Copyright © 2020 Mullvad VPN AB. All rights reserved.
//

import Foundation
import NetworkExtension

extension NEProviderStopReason: CustomStringConvertible {
    public var description: String {
        switch self {
        case .none:
            return  "none"
        case .userInitiated:
            return  "user initiated"
        case .providerFailed:
            return  "provider failed"
        case .noNetworkAvailable:
            return  "no network available"
        case .unrecoverableNetworkChange:
            return  "unrecoverable network change"
        case .providerDisabled:
            return  "provider disabled"
        case .authenticationCanceled:
            return  "authentication cancelled"
        case .configurationFailed:
            return  "configuration failed"
        case .idleTimeout:
            return  "idle timeout"
        case .configurationDisabled:
            return  "configuration disabled"
        case .configurationRemoved:
            return  "configuration removed"
        case .superceded:
            return  "superceded"
        case .userLogout:
            return  "user logout"
        case .userSwitch:
            return  "user switch"
        case .connectionFailed:
            return  "connection failed"
        case .sleep:
            return  "sleep"
        case .appUpdate:
            return  "app update"
        @unknown default:
            return  "unknown value (\(self.rawValue))"
        }
    }
}