-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRouteModel.swift
More file actions
62 lines (58 loc) · 1.81 KB
/
Copy pathRouteModel.swift
File metadata and controls
62 lines (58 loc) · 1.81 KB
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
55
56
57
58
59
60
61
62
mport Foundation
/// MARK: - NB4A Route Configuration Model
public struct NB4ARouteRule: Codable {
public var inbound: [String]
public var outbound: String
public var domain: [String]?
public var dstPort: String?
public var srcPort: String?
public var dstIP: [String]?
public var srcIP: [String]?
public var protocolType: [String]?
public var processName: [String]?
public var network: [String]?
public var outboundFallback: String?
public init(
inbound: [String],
outbound: String,
domain: [String]? = nil,
dstPort: String? = nil,
srcPort: String? = nil,
dstIP: [String]? = nil,
srcIP: [String]? = nil,
protocolType: [String]? = nil,
processName: [String]? = nil,
network: [String]? = nil,
outboundFallback: String? = nil
) {
self.inbound = inbound
self.outbound = outbound
self.domain = domain
self.dstPort = dstPort
self.srcPort = srcPort
self.dstIP = dstIP
self.srcIP = srcIP
self.protocolType = protocolType
self.processName = processName
self.network = network
self.outboundFallback = outboundFallback
}
}
/// MARK: - Full Route Configuration
public struct NB4ARouteConfig: Codable {
public var rules: [NB4ARouteRule]
public var dnsRoutingEnabled: Bool
public var localDNS: String
public var remoteDNS: String
public init(
rules: [NB4ARouteRule],
dnsRoutingEnabled: Bool = true,
localDNS: String = "223.5.5.5",
remoteDNS: String = "8.8.8.8"
) {
self.rules = rules
self.dnsRoutingEnabled = dnsRoutingEnabled
self.localDNS = localDNS
self.remoteDNS = remoteDNS
}
}