From 696befcc0e29dade5879dab2f33ea2d705be244b Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Wed, 12 Apr 2023 22:57:59 +0200 Subject: Wrappers Python: Update to newest API by implementing cookies --- wrappers/python/eduvpn_common/loader.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'wrappers/python/eduvpn_common/loader.py') diff --git a/wrappers/python/eduvpn_common/loader.py b/wrappers/python/eduvpn_common/loader.py index 36381b4..961b569 100644 --- a/wrappers/python/eduvpn_common/loader.py +++ b/wrappers/python/eduvpn_common/loader.py @@ -57,21 +57,22 @@ def initialize_functions(lib: CDLL) -> None: # Exposed functions # We have to use c_void_p instead of c_char_p to free it properly # See https://stackoverflow.com/questions/13445568/python-ctypes-how-to-free-memory-getting-invalid-pointer-error - lib.CancelOAuth.argtypes, lib.CancelOAuth.restype = [], c_void_p lib.Deregister.argtypes, lib.Deregister.restype = [], None lib.ExpiryTimes.argtypes, lib.ExpiryTimes.restype = [], DataError lib.FreeString.argtypes, lib.FreeString.restype = [c_void_p], None - lib.DiscoOrganizations.argtypes, lib.DiscoOrganizations.restype = [], DataError - lib.DiscoServers.argtypes, lib.DiscoServers.restype = [], DataError + lib.DiscoOrganizations.argtypes, lib.DiscoOrganizations.restype = [c_int], DataError + lib.DiscoServers.argtypes, lib.DiscoServers.restype = [c_int], DataError lib.GetConfig.argtypes, lib.GetConfig.restype = [ c_int, - c_char_p, c_int, c_char_p, + c_int, ], DataError lib.AddServer.argtypes, lib.AddServer.restype = [ + c_int, c_int, c_char_p, + c_int, ], c_char_p lib.CurrentServer.argtypes, lib.CurrentServer.restype = [], DataError lib.RemoveServer.argtypes, lib.RemoveServer.restype = [ @@ -86,21 +87,23 @@ def initialize_functions(lib: CDLL) -> None: VPNStateChange, c_int, ], c_void_p - lib.RenewSession.argtypes, lib.RenewSession.restype = [], c_void_p - lib.Cleanup.argtypes, lib.Cleanup.restype = [ - c_char_p, - ], c_void_p + lib.RenewSession.argtypes, lib.RenewSession.restype = [c_int], c_void_p + lib.Cleanup.argtypes, lib.Cleanup.restype = [c_int], c_void_p lib.SetProfileID.argtypes, lib.SetProfileID.restype = [c_char_p], c_void_p + lib.CookieNew.argtypes, lib.CookieNew.restype = [], c_int + lib.CookieReply.argtypes, lib.CookieReply.restype = [c_int, c_char_p], c_void_p + lib.CookieCancel.argtypes, lib.CookieCancel.restype = [c_int], c_void_p + lib.CookieDelete.argtypes, lib.CookieDelete.restype = [c_int], c_void_p lib.SetSecureLocation.argtypes, lib.SetSecureLocation.restype = [ + c_int, c_char_p, ], c_void_p - lib.SecureLocationList.argtypes, lib.SecureLocationList.restype = [], DataError lib.SetSupportWireguard.argtypes, lib.SetSupportWireguard.restype = [ c_int, ], c_void_p lib.StartFailover.argtypes, lib.StartFailover.restype = [ + c_int, c_char_p, c_int, ReadRxBytes, ], BoolError - lib.CancelFailover.argtypes, lib.CancelFailover.restype = [], c_void_p -- cgit v1.2.3