mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-02-17 05:12:02 +00:00
Model: Endpoint.hasHostAsIPAddress()
This commit is contained in:
parent
b57824cde1
commit
1410b89f23
@ -75,3 +75,16 @@ extension Endpoint: Codable {
|
||||
case invalidData
|
||||
}
|
||||
}
|
||||
|
||||
extension Endpoint {
|
||||
func hasHostAsIPAddress() -> Bool {
|
||||
switch (host) {
|
||||
case .name(_, _):
|
||||
return false
|
||||
case .ipv4(_):
|
||||
return true
|
||||
case .ipv6(_):
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user