From c8e7424f0b9ca963c7454e3297a8d001d67d729d Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Wed, 7 Feb 2024 13:43:52 +0100 Subject: WireGuard: TCP support using proxyguard --- exports/exports.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'exports') diff --git a/exports/exports.go b/exports/exports.go index c7d4b8c..9ae85c8 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -879,6 +879,23 @@ func StartFailover(c C.uintptr_t, gateway *C.char, mtu C.int, readRxBytes C.Read return droppedC, nil } +// StartProxyguard starts the 'proxyguard' procedure in eduvpn-common +// +//export StartProxyguard +func StartProxyguard(c C.uintptr_t, listen *C.char, tcpsp C.int, peer *C.char) *C.char { + state, stateErr := getVPNState() + if stateErr != nil { + return getCError(stateErr) + } + ck, err := getCookie(c) + if err != nil { + return getCError(err) + } + + proxyErr := state.StartProxyguard(ck, C.GoString(listen), int(tcpsp), C.GoString(peer)) + return getCError(proxyErr) +} + // SetState sets the state of the statemachine // // Note: this transitions the FSM into the new state without passing any data to it. -- cgit v1.2.3