From 01cbb80b300f92c3456d3b2965630c0783607905 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Mon, 24 Oct 2022 14:05:45 +0200 Subject: Client + Server + Exports: Implement optional WireGuard support --- wrappers/python/eduvpn_common/loader.py | 4 ++++ wrappers/python/eduvpn_common/main.py | 12 ++++++++++++ 2 files changed, 16 insertions(+) (limited to 'wrappers/python/eduvpn_common') diff --git a/wrappers/python/eduvpn_common/loader.py b/wrappers/python/eduvpn_common/loader.py index fc3d090..9463ab1 100644 --- a/wrappers/python/eduvpn_common/loader.py +++ b/wrappers/python/eduvpn_common/loader.py @@ -152,4 +152,8 @@ def initialize_functions(lib: CDLL) -> None: c_char_p, c_char_p, ], c_void_p + lib.SetSupportWireguard.argtypes, lib.SetSupportWireguard.restype = [ + c_char_p, + c_int, + ], c_void_p lib.ShouldRenewButton.argtypes, lib.ShouldRenewButton.restype = [], int diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py index 69d00db..1467adb 100644 --- a/wrappers/python/eduvpn_common/main.py +++ b/wrappers/python/eduvpn_common/main.py @@ -440,6 +440,18 @@ class EduVPN(object): if renew_err: raise renew_err + def set_support_wireguard(self, support: bool) -> None: + """Indicates whether or not the OS supports WireGuard connections. + + :param support: bool: whether or not wireguard is supported + + :raises WrappedError: An error by the Go library + """ + support_err = self.go_function(self.lib.SetSupportWireguard, support) + + if support_err: + raise support_err + def should_renew_button(self) -> bool: """Whether or not the UI should show the renew button -- cgit v1.2.3