From 6b939462fb1064abd42e8cb8316700ec844172ea Mon Sep 17 00:00:00 2001 From: Jeroen Wijenbergh Date: Tue, 6 May 2025 10:31:57 +0200 Subject: All: Remove ProxyGuard integration This should be done in WireGuard-go or in case of a linux a small daemon --- wrappers/python/eduvpn_common/loader.py | 31 ----------------------- wrappers/python/eduvpn_common/main.py | 44 +-------------------------------- wrappers/python/eduvpn_common/types.py | 1 - 3 files changed, 1 insertion(+), 75 deletions(-) (limited to 'wrappers') diff --git a/wrappers/python/eduvpn_common/loader.py b/wrappers/python/eduvpn_common/loader.py index 11307ef..6957c15 100644 --- a/wrappers/python/eduvpn_common/loader.py +++ b/wrappers/python/eduvpn_common/loader.py @@ -6,7 +6,6 @@ from eduvpn_common.types import ( BoolError, DataError, HandlerError, - ProxySetup, ReadRxBytes, RefreshList, TokenGetter, @@ -134,33 +133,3 @@ def initialize_functions(lib: CDLL) -> None: ], BoolError, ) - lib.NewProxyguard.argtypes, lib.NewProxyguard.restype = ( - [ - c_int, - c_int, - c_int, - c_char_p, - ProxySetup, - ], - HandlerError, - ) - lib.ProxyguardRestart.argtypes, lib.ProxyguardRestart.restype = ( - [ - c_int, - ], - c_char_p, - ) - lib.ProxyguardTunnel.argtypes, lib.ProxyguardTunnel.restype = ( - [ - c_int, - c_int, - c_int, - ], - c_char_p, - ) - lib.ProxyguardPeerIPs.argtypes, lib.ProxyguardPeerIPs.restype = ( - [ - c_int, - ], - DataError, - ) diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py index 8d78afd..613dce2 100644 --- a/wrappers/python/eduvpn_common/main.py +++ b/wrappers/python/eduvpn_common/main.py @@ -1,13 +1,12 @@ import ctypes import json from enum import IntEnum -from typing import Any, Callable, Iterator, List, Optional +from typing import Any, Callable, Iterator, Optional from eduvpn_common.event import EventHandler from eduvpn_common.loader import initialize_functions, load_lib from eduvpn_common.state import State from eduvpn_common.types import ( - ProxySetup, ReadRxBytes, RefreshList, TokenGetter, @@ -20,29 +19,6 @@ from eduvpn_common.types import ( global_object = None -class Proxyguard(object): - def __init__(self, parent, handler): - self.parent = parent - self.handler = handler - - def tunnel(self, wglisten: int): - tunnel_err = self.parent.go_cookie_function(self.parent.lib.ProxyguardTunnel, self.handler, wglisten) - if tunnel_err: - forwardError(tunnel_err) - - @property - def peer_ips(self) -> List[str]: - peer_ips, peer_ips_err = self.parent.go_function(self.parent.lib.ProxyguardPeerIPs, self.handler) - if peer_ips_err: - forwardError(peer_ips_err) - return json.loads(peer_ips) - - def restart(self): - restart_err = self.parent.go_function(self.parent.lib.ProxyguardRestart, self.handler) - if restart_err: - forwardError(restart_err) - - class WrappedError(Exception): def __init__(self, translations, language, misc): self.translations = translations @@ -381,24 +357,6 @@ class EduVPN(object): forwardError(dropped_err) return dropped - def new_proxyguard( - self, - listen_port: int, - tcp_source_port: int, - peer: str, - setup: ProxySetup, - ) -> Proxyguard: - proxy, proxy_err = self.go_cookie_function( - self.lib.NewProxyguard, - listen_port, - tcp_source_port, - peer, - setup, - ) - if proxy_err: - forwardError(proxy_err) - return Proxyguard(self, proxy) - def cancel(self): self.jar.cancel() diff --git a/wrappers/python/eduvpn_common/types.py b/wrappers/python/eduvpn_common/types.py index 5e23d61..999fbdd 100644 --- a/wrappers/python/eduvpn_common/types.py +++ b/wrappers/python/eduvpn_common/types.py @@ -45,7 +45,6 @@ class BoolError(Structure): # The type for a Go state change callback VPNStateChange = CFUNCTYPE(c_int, c_int, c_int, c_char_p) -ProxySetup = CFUNCTYPE(c_void_p, c_int) ReadRxBytes = CFUNCTYPE(c_ulonglong) RefreshList = CFUNCTYPE(c_void_p) TokenGetter = CFUNCTYPE(c_void_p, c_char_p, c_int, POINTER(c_char), c_size_t) -- cgit v1.2.3