IPRangeListRule
open class IPRangeListRule: Rule
The rule matches the ip of the target hsot to a list of IP ranges.
-
Undocumented
Declaration
Swift
open class IPRangeListRule: Rule
-
The list of regular expressions to match to.
Declaration
Swift
open var ranges: [IPRange] = []
-
Create a new
IPRangeListRule
instance.Throws
The error when parsing the IP range.
Declaration
Swift
public init(adapterFactory: AdapterFactory, ranges: [String]) throws
Parameters
adapterFactory
The factory which builds a corresponding adapter when needed.
ranges
The list of IP ranges to match. The IP ranges are expressed in CIDR form (
127.0.0.1/8
) or range form (127.0.0.1+16777216
). -
Match DNS request to this rule.
Declaration
Swift
override open func matchDNS(_ session: DNSSession, type: DNSSessionMatchType) -> DNSSessionMatchResult
Parameters
session
The DNS session to match.
type
What kind of information is available.
Return Value
The result of match.
-
Match connect session to this rule.
Declaration
Swift
override open func match(_ session: ConnectSession) -> AdapterFactory?
Parameters
session
connect session to match.
Return Value
The configured adapter if matched, return
nil
if not matched.