diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-22 17:15:34 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-22 17:15:34 +0200 |
| commit | 80218da58eca9c95870770f88e477891e8fdb50a (patch) | |
| tree | 66f685f2bcbbaaac0031d2e7a83f306358043a88 /exports | |
| parent | 0c9a300a58d9dacce7b84ff93222eed35eab5721 (diff) | |
State + FSM + Exports: Implement changing a secure internet location
Diffstat (limited to 'exports')
| -rw-r--r-- | exports/exports.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/exports/exports.go b/exports/exports.go index 1e17587..2eb3ab7 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -193,6 +193,17 @@ func SetProfileID(name *C.char, data *C.char) *C.char { return C.CString(ErrorToString(profileErr)) } +//export ChangeSecureLocation +func ChangeSecureLocation(name *C.char) *C.char { + nameStr := C.GoString(name) + state, stateErr := GetVPNState(nameStr) + if stateErr != nil { + return C.CString(ErrorToString(stateErr)) + } + locationErr := state.ChangeSecureLocation() + return C.CString(ErrorToString(locationErr)) +} + //export SetSecureLocation func SetSecureLocation(name *C.char, data *C.char) *C.char { nameStr := C.GoString(name) |
