def __init__(self, *args, **kwargs): super(RFProxy, self).__init__(*args, **kwargs) self.ID = 0 self.table = Table() self.switches = kwargs['switches'] self.rfprocess = RFProcessor(self.switches, self.table) self.ipc = IPCService.for_proxy(str(self.ID), HubThreading) self.ipc.listen(RFSERVER_RFPROXY_CHANNEL, RFProtocolFactory(), self.rfprocess, False) log.info("RFProxy running.")
def __init__(self, configfile, islconffile, multitabledps, satellitedps): self.config = RFConfig(configfile) self.islconf = RFISLConf(islconffile) try: self.multitabledps = set([int(x, 16) for x in multitabledps.split(",")]) except ValueError: self.multitabledps = set() try: self.satellitedps = set([int(x, 16) for x in satellitedps.split(",")]) except ValueError: self.satellitedps = set() # Initialise state tables self.rftable = RFTable() self.isltable = RFISLTable() self.route_mod_translator = {} # Logging self.log = logging.getLogger("rfserver") if self.satellitedps: self.log.info("Datapaths that are ISL satellites: %s", list(self.satellitedps)) if self.multitabledps: self.log.info("Datapaths that support multiple tables: %s", list(self.multitabledps)) self.ack_q = Queue.Queue() self.dp_q = Queue.Queue() self.ipc_lock = threading.Lock() self.routemod_outstanding = threading.Event() self.ipc = IPCService.for_server(RFSERVER_ID) self.worker = threading.Thread(target=self.dp_worker) self.worker.daemon = True self.worker.start() self.ipc.listen(RFCLIENT_RFSERVER_CHANNEL, self, self, False) self.ipc.listen(RFSERVER_RFPROXY_CHANNEL, self, self, True)