Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

* Download and extract the controller framework
```
wget -O controller-framework-beta-v0.3.tar.gz https://goo.gl/UQHfCE
tar xvzf controller-framework-beta-v0.3.tar.gz
cd controller-framework-beta-v0.3
wget -O controller-framework-beta-v0.3.1.tar.gz https://goo.gl/e7BSpo
tar xvzf controller-framework-beta-v0.3.1.tar.gz
cd controller-framework-beta-v0.3.1
```

* Run IPOP-Tincan
Expand All @@ -22,14 +22,15 @@ After starting IPOP-Tincan, you can either run the GroupVPN controller or the So

* Change directory to gvpn
```
cd gvpn
cd controller/modules/gvpn
```

* Change config.json according to the requirement. Add xmpp_username, xmpp_password and xmpp_host to the config file and ensure that the IP addresses are different for all the nodes.
* Change gvpn-config.json according to the requirement. Add xmpp_username, xmpp_password and xmpp_host to the config file and ensure that the IP addresses are different for all the nodes.

* Start GroupVPN controller
```
python CFx.py -c config.json &> log.txt &
cd ../../..
python -m controller.framework.CFx -c controller/modules/gvpn-config.json &> log.txt &
```
* Check the status

Expand All @@ -41,14 +42,15 @@ After starting IPOP-Tincan, you can either run the GroupVPN controller or the So

* Change directory to svpn
```
cd svpn
cd controller/modules/svpn
```

* Change config.json according to the requirement. Add xmpp_username, xmpp_password and xmpp_host to the config file.
* Change svpn-config.json according to the requirement. Add xmpp_username, xmpp_password and xmpp_host to the config file.

* Start SocialVPN controller
```
python CFx.py -c config.json &> log.txt &
cd ../../..
python -m controller.framework.CFx -c controller/modules/svpn-config.json &> log.txt &
```

* Check the status
Expand Down
Empty file added controller/__init__.py
Empty file.
File renamed without changes.
30 changes: 16 additions & 14 deletions gvpn/CFx.py → controller/framework/CFx.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ class CFX(object):

def __init__(self):

with open('config.json') as data_file:

# Read config.json into an OrderedDict, to load the
# modules in the order in which they appear in config.json
self.json_data = json.load(data_file,
object_pairs_hook=OrderedDict)

# Parse config and update default CONFIG in ipoplib
self.parse_config()
ipoplib.CONFIG = self.CONFIG

Expand Down Expand Up @@ -123,16 +115,18 @@ def initialize(self,):
try:
time.sleep(3)
self.sock_icc.bind((self.ip6, self.CONFIG['CFx']["icc_port"]))
except KeyboardInterrupt:
self.terminate()
except Exception as e:
print("Wait until ipop tap is available")
print("Wait until IPOP Tap is available")
continue
else:
break

self.sock_list.append(self.sock_icc)

else:
print "ICC is enabled but ipv6 is not supported. Exiting"
print "ICC is enabled but IPv6 is not supported. Exiting"
sys.exit()

# Register to the XMPP server
Expand Down Expand Up @@ -187,7 +181,13 @@ def load_module(self, module_name):
self.load_dependencies(module_name)

# Dynamically importing the modules
module = importlib.import_module(module_name)
try:
module = importlib.import_module("controller.modules."+module_name)
except:
if(self.vpn_type == "GroupVPN"):
module = importlib.import_module("controller.modules.gvpn."+module_name)
elif(self.vpn_type == "SocialVPN"):
module = importlib.import_module("controller.modules.svpn."+module_name)

# Get the class with name key from module
module_class = getattr(module, module_name)
Expand Down Expand Up @@ -277,10 +277,12 @@ def parse_config(self):
# Load the config file
with open(args.config_file) as f:

loaded_config = json.load(f)
for key in loaded_config:
# Read config file into an OrderedDict, to load the
# modules in the order in which they appear in config.json
self.json_data = json.load(f, object_pairs_hook=OrderedDict)
for key in self.json_data:
if(self.CONFIG.get(key, None)):
self.CONFIG[key].update(loaded_config[key])
self.CONFIG[key].update(self.json_data[key])

if args.config_string:
# Load the config string
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion svpn/LinkManager.py → controller/modules/LinkManager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ControllerModule import ControllerModule
from controller.framework.ControllerModule import ControllerModule


class LinkManager(ControllerModule):
Expand Down
2 changes: 1 addition & 1 deletion gvpn/Logger.py → controller/modules/Logger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from ControllerModule import ControllerModule
from controller.framework.ControllerModule import ControllerModule


class Logger(ControllerModule):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import select
from threading import Thread
from ControllerModule import ControllerModule
from controller.framework.ControllerModule import ControllerModule


class TincanListener(ControllerModule):
Expand Down
5 changes: 3 additions & 2 deletions gvpn/TincanSender.py → controller/modules/TincanSender.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import json
import socket
import random
import ipoplib
from ControllerModule import ControllerModule
import controller.framework.ipoplib as ipoplib
from controller.framework.ControllerModule import ControllerModule



class TincanSender(ControllerModule):
Expand Down
2 changes: 1 addition & 1 deletion gvpn/Watchdog.py → controller/modules/Watchdog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ControllerModule import ControllerModule
from controller.framework.ControllerModule import ControllerModule


class Watchdog(ControllerModule):
Expand Down
Empty file added controller/modules/__init__.py
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ControllerModule import ControllerModule
from ipoplib import gen_uid
from controller.framework.ipoplib import gen_uid
from controller.framework.ControllerModule import ControllerModule


class AddressMapper(ControllerModule):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import time
import socket
import struct
import ipoplib
from ControllerModule import ControllerModule
import controller.framework.ipoplib as ipoplib
from controller.framework.ControllerModule import ControllerModule


class BaseTopologyManager(ControllerModule):
Expand Down
2 changes: 1 addition & 1 deletion gvpn/Monitor.py → controller/modules/gvpn/Monitor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import time
from ControllerModule import ControllerModule
from controller.framework.ControllerModule import ControllerModule


class Monitor(ControllerModule):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from ControllerModule import ControllerModule
from controller.framework.ControllerModule import ControllerModule


class TincanDispatcher(ControllerModule):
Expand Down Expand Up @@ -127,7 +127,7 @@ def processCBT(self, cbt):
CBT = self.CFxHandle.createCBT(initiator='TincanDispatcher',
recipient='BaseTopologyManager',
action='TINCAN_PACKET',
data=data[2:])
data=data)
self.CFxHandle.submitCBT(CBT)

else:
Expand Down
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ipoplib
from ControllerModule import ControllerModule
import controller.framework.ipoplib as ipoplib
from controller.framework.ControllerModule import ControllerModule


class AddressMapper(ControllerModule):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ipoplib
from ControllerModule import ControllerModule
import controller.framework.ipoplib as ipoplib
from controller.framework.ControllerModule import ControllerModule


class BaseTopologyManager(ControllerModule):
Expand Down
4 changes: 2 additions & 2 deletions svpn/Monitor.py → controller/modules/svpn/Monitor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time
import ipoplib
from ControllerModule import ControllerModule
import controller.framework.ipoplib as ipoplib
from controller.framework.ControllerModule import ControllerModule


class Monitor(ControllerModule):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from ControllerModule import ControllerModule
from controller.framework.ControllerModule import ControllerModule


class TincanDispatcher(ControllerModule):
Expand Down
Empty file.
68 changes: 0 additions & 68 deletions gvpn/LinkManager.py

This file was deleted.

12 changes: 0 additions & 12 deletions svpn/CBT.py

This file was deleted.

Loading