37 lines
853 B
Swift
37 lines
853 B
Swift
|
import Foundation
|
||
|
|
||
|
enum GlobalState: UInt8, Codable {
|
||
|
case nominal = 0
|
||
|
|
||
|
/// No domains set in configuration file
|
||
|
case noDomainConfigured = 1
|
||
|
|
||
|
/// Both addresses are missing
|
||
|
case missingAddresses = 2
|
||
|
|
||
|
/// Missing IPv4 address
|
||
|
case missingIPv4 = 3
|
||
|
|
||
|
/// Missing IPv6 address
|
||
|
case missingIPv6 = 4
|
||
|
|
||
|
case serverError = 5
|
||
|
|
||
|
case clientError = 6
|
||
|
}
|
||
|
|
||
|
extension GlobalState: CustomStringConvertible {
|
||
|
|
||
|
var description: String {
|
||
|
switch self {
|
||
|
case .nominal: return "Nominal"
|
||
|
case .noDomainConfigured: return "No domains"
|
||
|
case .missingAddresses: return "Missing addresses"
|
||
|
case .missingIPv4: return "Missing IPv4"
|
||
|
case .missingIPv6: return "Missing IPv6"
|
||
|
case .serverError: return "Server error"
|
||
|
case .clientError: return "Client error"
|
||
|
}
|
||
|
}
|
||
|
}
|