summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/vpn/manager.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2017-02-01 00:00:20 +0100
committerKali Kaneko (leap communications) <kali@leap.se>2017-02-23 00:37:29 +0100
commit6d1d18faec5caa60c26b8245f0ab17c63d0b80d8 (patch)
tree08dbfd0e257bea0434543df6505bcc9e12acbf97 /src/leap/bitmask/vpn/manager.py
parent8fb76310e14a5893397894c6155ac7aa4f28e483 (diff)
[refactor] split vpn control into some modules
Diffstat (limited to 'src/leap/bitmask/vpn/manager.py')
-rw-r--r--src/leap/bitmask/vpn/manager.py43
1 files changed, 5 insertions, 38 deletions
diff --git a/src/leap/bitmask/vpn/manager.py b/src/leap/bitmask/vpn/manager.py
index 2403327..541da9e 100644
--- a/src/leap/bitmask/vpn/manager.py
+++ b/src/leap/bitmask/vpn/manager.py
@@ -22,43 +22,10 @@ VPN Manager
import os
import tempfile
-from leap.bitmask.vpn import process
+from leap.bitmask.vpn import process, _config
from leap.bitmask.vpn.constants import IS_WIN
-class _TempEIPConfig(object):
- """Current EIP code on bitmask depends on EIPConfig object, this temporary
- implementation helps on the transition."""
-
- def __init__(self, flags, path, ports):
- self._flags = flags
- self._path = path
- self._ports = ports
-
- def get_gateway_ports(self, idx):
- return self._ports
-
- def get_openvpn_configuration(self):
- return self._flags
-
- def get_client_cert_path(self, providerconfig):
- return self._path
-
-
-class _TempProviderConfig(object):
- """Current EIP code on bitmask depends on ProviderConfig object, this
- temporary implementation helps on the transition."""
-
- def __init__(self, domain, path):
- self._domain = domain
- self._path = path
-
- def get_domain(self):
- return self._domain
-
- def get_ca_cert_path(self):
- return self._path
-
class VPNManager(object):
@@ -78,8 +45,8 @@ class VPNManager(object):
domain = "demo.bitmask.net"
self._remotes = remotes
- self._eipconfig = _TempEIPConfig(extra_flags, cert_path, ports)
- self._providerconfig = _TempProviderConfig(domain, ca_path)
+ self._eipconfig = _config._TempEIPConfig(extra_flags, cert_path, ports)
+ self._providerconfig = _config._TempProviderConfig(domain, ca_path)
# signaler = None # XXX handle signaling somehow...
signaler = mock_signaler
self._vpn = process.VPN(remotes=remotes, signaler=signaler)
@@ -93,7 +60,7 @@ class VPNManager(object):
* gateway, port
* domain name
"""
- host, port = self._get_management()
+ host, port = self._get_management_location()
# TODO need gateways here
# sorting them doesn't belong in here
@@ -140,7 +107,7 @@ class VPNManager(object):
"""
pass
- def _get_management(self):
+ def _get_management_location(self):
"""
Return a tuple with the host (socket) and port to be used for VPN.