summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/manager.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2017-02-06 14:26:14 +0100
committerKali Kaneko (leap communications) <kali@leap.se>2017-02-23 00:40:39 +0100
commit1ba66d113ae0e3ce1651709c812426a3453d94d2 (patch)
tree49170c4e5871f5937cdd99d9e020d1c074c261f7 /src/leap/bitmask/vpn/manager.py
parent7f07ffa13eaa51419af6f019bf9b36b298274485 (diff)
[feature] hard restarts upon ping-restart received
Diffstat (limited to 'src/leap/bitmask/vpn/manager.py')
-rw-r--r--src/leap/bitmask/vpn/manager.py35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/leap/bitmask/vpn/manager.py b/src/leap/bitmask/vpn/manager.py
index 8781603d..abadc00e 100644
--- a/src/leap/bitmask/vpn/manager.py
+++ b/src/leap/bitmask/vpn/manager.py
@@ -42,36 +42,33 @@ class VPNManager(object):
:type remotes: tuple of tuple(str, int)
"""
# TODO we can set all the needed ports, gateways and paths in here
+ # TODO need gateways here
+ # sorting them doesn't belong in here
+ # gateways = ((ip1, portA), (ip2, portB), ...)
+
ports = []
- # this seems to be obsolete, needed to get gateways
+ # TODO fix hardcoding
domain = "demo.bitmask.net"
+
self._remotes = remotes
self._eipconfig = _TempEIPConfig(extra_flags, cert_path, ports)
self._providerconfig = _TempProviderConfig(domain, ca_path)
- self._vpn = VPNControl(remotes=remotes)
+ host, port = self._get_management_location()
+ self._vpn = VPNControl(remotes=remotes,
+ eipconfig=self._eipconfig,
+ providerconfig=self._providerconfig,
+ socket_host=host, socket_port=port)
def start(self):
"""
Start the VPN process.
-
- VPN needs:
- * paths for: cert, key, ca
- * gateway, port
- * domain name
"""
- host, port = self._get_management_location()
-
- # TODO need gateways here
- # sorting them doesn't belong in here
- # gateways = ((ip1, portA), (ip2, portB), ...)
-
- self._vpn.start(eipconfig=self._eipconfig,
- providerconfig=self._providerconfig,
- socket_host=host, socket_port=port)
- return True
+ result = self._vpn.start()
+ print "RESULT START --->", result
+ return result
def stop(self):
"""
@@ -81,8 +78,8 @@ class VPNManager(object):
:rtype: bool
"""
# TODO how to return False if this fails
- self._vpn.stop(False, False) # TODO review params
- return True
+ result = self._vpn.stop(False, False) # TODO review params
+ return result
@property