summaryrefslogtreecommitdiffhomepage
path: root/tunnel/src/main/java/com/wireguard/android/backend
diff options
context:
space:
mode:
Diffstat (limited to 'tunnel/src/main/java/com/wireguard/android/backend')
-rw-r--r--tunnel/src/main/java/com/wireguard/android/backend/Bgp.java14
-rw-r--r--tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java2
2 files changed, 10 insertions, 6 deletions
diff --git a/tunnel/src/main/java/com/wireguard/android/backend/Bgp.java b/tunnel/src/main/java/com/wireguard/android/backend/Bgp.java
index 12668621..a6a8b420 100644
--- a/tunnel/src/main/java/com/wireguard/android/backend/Bgp.java
+++ b/tunnel/src/main/java/com/wireguard/android/backend/Bgp.java
@@ -23,6 +23,7 @@ import com.lumaserv.bgp.protocol.attribute.PathAttribute;
import com.lumaserv.bgp.protocol.attribute.TunnelEncapsAttribute;
import com.lumaserv.bgp.protocol.message.BGPUpdate;
+import com.wireguard.android.backend.Backend;
import com.wireguard.config.InetEndpoint;
import com.wireguard.config.InetNetwork;
import com.wireguard.crypto.Key;
@@ -53,12 +54,14 @@ public class Bgp implements BGPListener {
private static final int PORT = 0;
private static final int STATS_TAG = 1; // FIXME
- private ManagedChannel channel;
- private Tunnel tunnel;
- private int tunnelHandle;
+ private final Backend backend;
+ private final ManagedChannel channel;
+ private final Tunnel tunnel;
+ private final int tunnelHandle;
private BGPServer server;
- public Bgp(ManagedChannel channel, Tunnel tunnel, int tunnelHandle) {
+ public Bgp(Backend backend, ManagedChannel channel, Tunnel tunnel, int tunnelHandle) {
+ this.backend = backend;
this.channel = channel;
this.tunnel = tunnel;
this.tunnelHandle = tunnelHandle;
@@ -196,7 +199,8 @@ public class Bgp implements BGPListener {
}
tunnel.onAllowedIpsChange(publicKey, addNetworks, removeNetworks);
-
+ // backend.addAllowedIps(tunnel, publicKey, addNetworks);
+ // backend.removeAllowedIps(tunnel, publicKey, addNetworks); // TODO
} catch (KeyFormatException ex) {
Log.w(TAG, "Key.fromBytes " + ex);
}
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 894059c7..9c96e00f 100644
--- a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
+++ b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
@@ -460,7 +460,7 @@ public final class GoBackend implements Backend {
service.protect(wgGetSocketV6(currentTunnelHandle));
Log.i(TAG, "Dhcp done");
- bgp = new Bgp(channel, currentTunnel, currentTunnelHandle);
+ bgp = new Bgp(this, channel, currentTunnel, currentTunnelHandle);
bgp.startServer();
currentTunnel.onDhcpChange(dhcp);