summaryrefslogtreecommitdiffhomepage
path: root/tunnel/src/main/java/com/wireguard/android
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2023-03-07 20:18:07 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-05-10 21:08:27 +0200
commit70ad859a1401131c6fd981bd12a8c6d0fb9f51da (patch)
tree2f6b840af288a3a5240c55af3686c49b5e0e2ff9 /tunnel/src/main/java/com/wireguard/android
parent9fdb733d2767eff24d73f8922986e8b46eafff66 (diff)
WIP add ConfigDetail and PeerDetail
Diffstat (limited to 'tunnel/src/main/java/com/wireguard/android')
-rw-r--r--tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java3
-rw-r--r--tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java6
2 files changed, 9 insertions, 0 deletions
diff --git a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
index 384ea74a..f76452b8 100644
--- a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
+++ b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
@@ -637,6 +637,9 @@ public final class GoBackend implements Backend {
final InetEndpoint ep = peer.getEndpoint().orElse(null);
if (ep == null)
continue;
+ // FIXME
+ tunnel.onEndpointChange(peer.getPublicKey(), ep);
+ Log.i(TAG, "onEndpointChange " + peer.getPublicKey() + ", " + ep);
if (ep.getResolved(resolver, true).orElse(null) == null) {
if (i < DNS_RESOLUTION_RETRIES - 1) {
Log.w(TAG, "DNS host \"" + ep.getHost() + "\" failed to resolve; trying again");
diff --git a/tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java b/tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java
index 6c0f54e3..1dfadbce 100644
--- a/tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java
+++ b/tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java
@@ -5,6 +5,10 @@
package com.wireguard.android.backend;
+import androidx.annotation.Nullable;
+
+import com.wireguard.config.InetEndpoint;
+import com.wireguard.crypto.Key;
import com.wireguard.util.NonNullForAll;
import java.util.regex.Pattern;
@@ -61,4 +65,6 @@ public interface Tunnel {
* @param newDhcp The new DHCP info of the tunnel.
*/
void onDhcpChange(Dhcp newDhcp);
+
+ void onEndpointChange(@Nullable Key publicKey, @Nullable InetEndpoint newEndpoint);
}