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-08-19 00:26:13 +0200
commit7b22f27424381b8e9c2e88520956e79351277505 (patch)
tree9a29dd6e794d307ecc5892ef34e239b7660cab9c /tunnel/tools/libwg-go/api-android.go
parent12b540d050f1e29766e415347948dcbbad036b35 (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.go13
1 files changed, 13 insertions, 0 deletions
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() {}