From f22dd9c79b865eb1ae970b75f892f412c8ec0070 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 29 Dec 2022 00:23:17 +0100 Subject: 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. --- tunnel/tools/libwg-go/api-android.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tunnel/tools/libwg-go/api-android.go') diff --git a/tunnel/tools/libwg-go/api-android.go b/tunnel/tools/libwg-go/api-android.go index d47c5d76..d4e36480 100644 --- a/tunnel/tools/libwg-go/api-android.go +++ b/tunnel/tools/libwg-go/api-android.go @@ -224,4 +224,17 @@ func wgVersion() *C.char { return C.CString("unknown") } +//export wgSetConfig +func wgSetConfig(tunnelHandle int32, settings string) int32 { + handle, ok := tunnelHandles[tunnelHandle] + if !ok { + return -1 + } + err := handle.device.IpcSet(settings) + if err != nil { + return -1 + } + return 0 +} + func main() {} -- cgit v1.2.3