diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-08-24 14:37:05 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-08-24 14:37:05 +0200 |
| commit | 03f0fc68168de8db1735cc7d1c4d328c4bdd03f2 (patch) | |
| tree | 53218a27cbfbfccf8fb792835e31f28d36aadbfa /wrappers/python/src | |
| parent | fea086334359e715ee388e01c4a4a00f5f379fe4 (diff) | |
State + Server + Exports: Implement removing a server
Diffstat (limited to 'wrappers/python/src')
| -rw-r--r-- | wrappers/python/src/__init__.py | 3 | ||||
| -rw-r--r-- | wrappers/python/src/main.py | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/wrappers/python/src/__init__.py b/wrappers/python/src/__init__.py index eba497c..bf97bce 100644 --- a/wrappers/python/src/__init__.py +++ b/wrappers/python/src/__init__.py @@ -50,6 +50,9 @@ VPNStateChange = CFUNCTYPE(None, c_char_p, c_int, c_int, c_char_p) # 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.RemoveSecureInternet.argtypes, lib.RemoveSecureInternet.restype = [c_char_p], c_void_p +lib.RemoveInstituteAccess.argtypes, lib.RemoveInstituteAccess.restype = [c_char_p, c_char_p], c_void_p +lib.RemoveCustomServer.argtypes, lib.RemoveCustomServer.restype = [c_char_p, c_char_p], c_void_p lib.GetConfigSecureInternet.argtypes, lib.GetConfigSecureInternet.restype = [ c_char_p, c_char_p, diff --git a/wrappers/python/src/main.py b/wrappers/python/src/main.py index 7ebeae6..b37842f 100644 --- a/wrappers/python/src/main.py +++ b/wrappers/python/src/main.py @@ -98,6 +98,24 @@ class EduVPN(object): return organizations + def remove_secure_internet(self): + remove_err = self.go_function(lib.RemoveSecureInternet) + + if remove_err: + raise Exception(remove_err) + + def remove_institute_access(self, url: str): + remove_err = self.go_function(lib.RemoveInstituteAccess, url) + + if remove_err: + raise Exception(remove_err) + + def remove_custom_server(self, url: str): + remove_err = self.go_function(lib.RemoveCustomServer, url) + + if remove_err: + raise Exception(remove_err) + def get_config(self, url: str, func: callable, force_tcp: bool = False): # Because it could be the case that a profile callback is started, store a threading event # In the constructor, we have defined a wait event for Ask_Profile, this waits for this event to be set |
