diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-12 14:59:50 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-12 14:59:50 +0200 |
| commit | ffbc91079b6c425976fcefbb528f0c180f7971e2 (patch) | |
| tree | db713b29ea2ed9bbea2cabd0d13978aa96f5f44c /exports | |
| parent | f287501fde1be3bd7cb2bc2c163d309738e507a0 (diff) | |
Python + Exports: Implement Go back
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 aa2b40e..331270f 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -215,6 +215,17 @@ func GetIdentifier(name *C.char) (*C.char, *C.char) { return C.CString(identifier), C.CString("") } +//export GoBack +func GoBack(name *C.char) (*C.char) { + nameStr := C.GoString(name) + state, stateErr := GetVPNState(nameStr) + if stateErr != nil { + return C.CString(ErrorToString(stateErr)) + } + goBackErr := state.GoBack() + return C.CString(ErrorToString(goBackErr)) +} + //export SetIdentifier func SetIdentifier(name *C.char, identifier *C.char) *C.char { nameStr := C.GoString(name) |
