def __init__(self, config_file): print "Initialize the RouteOPS Server" self.relax_announce = True # Init the SDNRoute Server ## Parse Config self.sdnrouter = parse_config(config_file) self.peer = Peer() # MongoIPC agent<->server self.sdnrouter.server_ipc = \ lib.MongoIPC.MongoIPCMessageService(MONGO_ADDRESS, MONGO_DB_NAME, SERVER_ID, Thread, time.sleep) self.sdnrouter.server_ipc.listen(AGENT_SERVER_CHANNEL, False) self.sdnrouter.server_ipc.listen(SERVER_PROXY_CHANNEL, False) try: pass #db = mongo.Connection(MONGO_ADDRESS)[MONGO_DB_NAME] #self.sdnrouter.db_peers = db[TABLE_PEERS] #for participant in self.sdnrouter.participants: # res = None # res = self.sdnrouter.db_peers.find_one({'IP': self.sdnrouter.participants[participant]['IP']}) # if res: # pass # else: # self.sdnrouter.db_peers.insert(self.sdnrouter.participants[participant]) except Queue.Empty: pass except: pass self.run = True
def __init__(self, config_file): print "Initialize the Route Server" # Init the Route Server ## Parse Config self.xrs = parse_config(config_file) self.xrs.server = Server() self.run = True # Start arp proxy self.sdx_ap = arp_proxy(self.xrs) self.ap_thread = Thread(target=self.sdx_ap.start) self.ap_thread.daemon = True self.ap_thread.start()
def __init__(self, *args, **kwargs): super(aSDX, self).__init__(*args, **kwargs) wsgi = kwargs['wsgi'] wsgi.register(aSDXController, self) self.mac_to_port = {} self.datapath = None self.metadata_mask = 4095 self.cookie_mask = 15 # parse aSDX config CONF = cfg.CONF dir = CONF['asdx']['dir'] controller = CONF['asdx']['controller'] base_path = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)),"..","examples",dir,"controller-"+controller)) config_file = os.path.join(base_path, "sdx_config", "sdx_global.cfg") self.sdx = parse_config(base_path, config_file)
def __init__(self, *args, **kwargs): super(aSDX, self).__init__(*args, **kwargs) wsgi = kwargs['wsgi'] wsgi.register(aSDXController, self) self.mac_to_port = {} self.datapath = None self.metadata_mask = 4095 self.cookie_mask = 15 # parse aSDX config CONF = cfg.CONF dir = CONF['asdx']['dir'] base_path = os.path.abspath( os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "examples", dir, "controller")) config_file = os.path.join(base_path, "sdx_config", "sdx_global.cfg") policy_file = os.path.join(base_path, "sdx_config", "sdx_policies.cfg") self.sdx = parse_config(base_path, config_file, policy_file)