summaryrefslogtreecommitdiffhomepage
path: root/ios/PacketTunnel/WireGuardAdapter
diff options
context:
space:
mode:
authorAndrew Bulhak <andrew.bulhak@mullvad.net>2024-07-15 11:13:20 +0200
committerBug Magnet <marco.nikic@mullvad.net>2024-09-18 16:26:47 +0200
commitdee9d4e90af2dda070cbe72cc76cf4a375197012 (patch)
tree01a923d9d29c774abe992cebad9684cfbae615ea /ios/PacketTunnel/WireGuardAdapter
parent965777945868ee7dff0892945fbb67ecf500ffc6 (diff)
downloadmullvadvpn-dee9d4e90af2dda070cbe72cc76cf4a375197012.tar.xz
mullvadvpn-dee9d4e90af2dda070cbe72cc76cf4a375197012.zip
Add IAN-based TunnelPinger refactoring the pinger protocol accordingly
Diffstat (limited to 'ios/PacketTunnel/WireGuardAdapter')
-rw-r--r--ios/PacketTunnel/WireGuardAdapter/WgAdapter.swift4
-rw-r--r--ios/PacketTunnel/WireGuardAdapter/WireGuardAdapterError+Localization.swift8
2 files changed, 12 insertions, 0 deletions
diff --git a/ios/PacketTunnel/WireGuardAdapter/WgAdapter.swift b/ios/PacketTunnel/WireGuardAdapter/WgAdapter.swift
index cf52553a5e..dd2d562c2e 100644
--- a/ios/PacketTunnel/WireGuardAdapter/WgAdapter.swift
+++ b/ios/PacketTunnel/WireGuardAdapter/WgAdapter.swift
@@ -100,6 +100,10 @@ struct WgAdapter: TunnelAdapterProtocol {
let isUsingSameIP = (hasIPv4SameAddress || hasIPv6SameAddress) ? "" : "NOT "
logger.debug("Same IP is \(isUsingSameIP)being used")
}
+
+ public var icmpPingProvider: ICMPPingProvider {
+ adapter
+ }
}
extension WgAdapter: TunnelDeviceInfoProtocol {
diff --git a/ios/PacketTunnel/WireGuardAdapter/WireGuardAdapterError+Localization.swift b/ios/PacketTunnel/WireGuardAdapter/WireGuardAdapterError+Localization.swift
index 69806809d4..4ad6ffce0e 100644
--- a/ios/PacketTunnel/WireGuardAdapter/WireGuardAdapterError+Localization.swift
+++ b/ios/PacketTunnel/WireGuardAdapter/WireGuardAdapterError+Localization.swift
@@ -37,6 +37,14 @@ extension WireGuardAdapterError: LocalizedError {
return "Failure to start WireGuard backend (error code: \(code))."
case .noInterfaceIp:
return "Interface has no IP address specified."
+ case .noSuchTunnel:
+ return "No such WireGuard tunnel"
+ case .noTunnelVirtualInterface:
+ return "Tunnel has no virtual (IAN) interface"
+ case .icmpSocketNotOpen:
+ return "ICMP socket not open"
+ case let .internalError(code):
+ return "Internal error \(code)"
}
}
}