summaryrefslogtreecommitdiffhomepage
path: root/tunnel/tools/libwg-go/api-android.go
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2022-12-29 00:23:17 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-05-21 22:10:27 +0200
commit9bdb538694fcd13acaf72c30d4254b595e5078f4 (patch)
treec2a6bf7f5e432295497feedeb62cc56d933e46e3 /tunnel/tools/libwg-go/api-android.go
parent00945eb0c4b29a82dfbfb38fff44402e0b2ec279 (diff)
ui,tunnel: auto-detect IPv6/IPv4 preference
Detect IP address change. Request non-VPN network. Update endpoint when needed. Unregister network on wgTurnOff and use IPv4 if network is not known.
Diffstat (limited to 'tunnel/tools/libwg-go/api-android.go')
-rw-r--r--tunnel/tools/libwg-go/api-android.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/tunnel/tools/libwg-go/api-android.go b/tunnel/tools/libwg-go/api-android.go
index fd0142e1..0ab80be9 100644
--- a/tunnel/tools/libwg-go/api-android.go
+++ b/tunnel/tools/libwg-go/api-android.go
@@ -53,6 +53,11 @@ type TunnelHandle struct {
var tunnelHandles map[int32]TunnelHandle
+func GetTunnel(handle int32) (tunnelHandle TunnelHandle, ok bool) {
+ tunnelHandle, ok = tunnelHandles[handle]
+ return
+}
+
func init() {
tunnelHandles = make(map[int32]TunnelHandle)
signals := make(chan os.Signal)