aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/Model/Endpoint.swift13
1 files changed, 13 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/Model/Endpoint.swift b/WireGuard/WireGuard/Model/Endpoint.swift
index 483615b..a46d6b7 100644
--- a/WireGuard/WireGuard/Model/Endpoint.swift
+++ b/WireGuard/WireGuard/Model/Endpoint.swift
@@ -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
+ }
+ }
+}