diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-08-12 11:33:52 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-08-12 11:50:48 +0200 |
| commit | 05c180e7b28c4659b55e5bf1ebc4847e5b62230e (patch) | |
| tree | a3e33763a46076bcd6542899bcfce075d381be23 /wrappers/python/eduvpn_common/main.py | |
| parent | f3c04d56ca67c2ff0b08bf75cc51ea8be14c84b9 (diff) | |
Util: Add a function to calculate the gateway
Diffstat (limited to 'wrappers/python/eduvpn_common/main.py')
| -rw-r--r-- | wrappers/python/eduvpn_common/main.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py index 8c556e9..ce52024 100644 --- a/wrappers/python/eduvpn_common/main.py +++ b/wrappers/python/eduvpn_common/main.py @@ -152,6 +152,23 @@ class EduVPN(object): if register_err: forwardError(register_err) + def calculate_gateway(self, subnet: str) -> str: + """Calculate the gateway + + :param subnet: str: The IPv4/IPv6 subnet in CIDR notation + + :raises WrappedError: An error by the Go library + """ + gw, gw_err = self.go_function( + self.lib.CalculateGateway, + subnet, + ) + + if gw_err: + forwardError(gw_err) + + return gw + def add_server(self, _type: ServerType, _id: str, ot: Optional[int] = None) -> None: """Add a server |
