aboutsummaryrefslogtreecommitdiffstats
path: root/Sources/WireGuardKitGo/api-ios.go
diff options
context:
space:
mode:
Diffstat (limited to 'Sources/WireGuardKitGo/api-ios.go')
-rw-r--r--Sources/WireGuardKitGo/api-ios.go26
1 files changed, 16 insertions, 10 deletions
diff --git a/Sources/WireGuardKitGo/api-ios.go b/Sources/WireGuardKitGo/api-ios.go
index 0f80384..eaadea1 100644
--- a/Sources/WireGuardKitGo/api-ios.go
+++ b/Sources/WireGuardKitGo/api-ios.go
@@ -56,7 +56,6 @@ var tunnelHandles = make(map[int32]tunnelHandle)
func init() {
versionString = C.CString(device.WireGuardGoVersion)
- device.RoamingDisabled = true
signals := make(chan os.Signal)
signal.Notify(signals, unix.SIGUSR2)
go func() {
@@ -74,11 +73,6 @@ func init() {
}()
}
-//export wgEnableRoaming
-func wgEnableRoaming(enabled bool) {
- device.RoamingDisabled = !enabled
-}
-
//export wgSetLogger
func wgSetLogger(context, loggerFn uintptr) {
loggerCtx = unsafe.Pointer(context)
@@ -149,14 +143,17 @@ func wgTurnOff(tunnelHandle int32) {
//export wgSetConfig
func wgSetConfig(tunnelHandle int32, settings *C.char) int64 {
- device, ok := tunnelHandles[tunnelHandle]
+ dev, ok := tunnelHandles[tunnelHandle]
if !ok {
return 0
}
- err := device.IpcSetOperation(bufio.NewReader(strings.NewReader(C.GoString(settings))))
+ err := dev.IpcSetOperation(bufio.NewReader(strings.NewReader(C.GoString(settings))))
if err != nil {
- device.Error.Println(err)
- return err.ErrorCode()
+ dev.Error.Println(err)
+ if ipcErr, ok := err.(*device.IPCError); ok {
+ return ipcErr.ErrorCode()
+ }
+ return -1
}
return 0
}
@@ -187,6 +184,15 @@ func wgBumpSockets(tunnelHandle int32) {
device.SendKeepalivesToPeersWithCurrentKeypair()
}
+//export wgDisableSomeRoamingForBrokenMobileSemantics
+func wgDisableSomeRoamingForBrokenMobileSemantics(tunnelHandle int32) {
+ device, ok := tunnelHandles[tunnelHandle]
+ if !ok {
+ return
+ }
+ device.DisableSomeRoamingForBrokenMobileSemantics()
+}
+
//export wgVersion
func wgVersion() *C.char {
return versionString