def __init__(self, io_master, interpose_on_logging=True, blocking=True): self._in_get_time = False self.io_master = io_master self.interpose_on_logging = interpose_on_logging self.blocking = blocking self.core_up = False core.addListener(UpEvent, self.handle_UpEvent)
def registerReceiver(self, receiver): """Register a new message receiver receiver: a ravel.messaging.MessageReceiver object""" self.log.info("registering receiver") self.receiver.append(receiver) receiver.start() core.addListener(pox.core.GoingDownEvent, receiver.stop)
def __init__ (self, port = 6633, address = '0.0.0.0', ssl_key = None, ssl_cert = None, ssl_ca_cert = None): """ Initialize This listener will be for SSL connections if the SSL params are specified """ Task.__init__(self) self.port = int(port) self.address = address self.started = False self.ssl_key = ssl_key self.ssl_cert = ssl_cert self.ssl_ca_cert = ssl_ca_cert if self.ssl_key or self.ssl_cert or ssl_ca_cert: global ssl ssl = None try: import ssl as sslmodule ssl = sslmodule except: raise RuntimeError("SSL is not available") core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent)
def __init__(self, port=2555, address='0.0.0.0'): Task.__init__(self) self.port = int(port) self.address = address self.started = False core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent)
def __init__ (self, port = 6633, address = '0.0.0.0'): Task.__init__(self) self.port = int(port) self.address = address self.started = False core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent)
def __init__(self, port=6633, address='0.0.0.0'): Task.__init__(self) self.port = int(port) self.address = address self.daemon = True core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent)
def __init__(self, port=6633, address='0.0.0.0', ssl_key=None, ssl_cert=None, ssl_ca_cert=None): """ Initialize This listener will be for SSL connections if the SSL params are specified """ Task.__init__(self) self.port = int(port) self.address = address self.started = False self.ssl_key = ssl_key self.ssl_cert = ssl_cert self.ssl_ca_cert = ssl_ca_cert if self.ssl_key or self.ssl_cert or ssl_ca_cert: global ssl ssl = None try: import ssl as sslmodule ssl = sslmodule except: raise RuntimeError("SSL is not available") core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent)
def __init__(self, port=6633, address='0.0.0.0'): Task.__init__(self) self.port = int(port) self.address = address self.started = False # 当GoingUpEvent事件发生时,_handle_GoingUpEvent会被调用 core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent)
def __init__(self): log.debug('My Test initiated') self.slice = None self.poll = None core.openflow.addListeners(self) # Finish the rest of the initializations after the GoingUpEvent # is raised for safety core.addListener(pox.core.GoingUpEvent, self.finish_init)
def __init__(self): log.debug('My Test initiated') #all_nodes = Node.objects.all() #log.info(all_nodes) self.slice = None self.poll = None core.openflow.addListeners(self) core.addListener(pox.core.GoingUpEvent, self.start_event_loop)
def __init__(self, port = 2555, address = '0.0.0.0'): Task.__init__(self) self.port = port self.address = address self.started = False self.con = None core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent)
def __init__(self): Task.__init__(self) # call our superconstructor self.sockets = self.get_sockets() # ... the sockets to listen to events on # Note! We can't start our event loop until the core is up. Therefore, # we'll add an event handler. core.addListener(pox.core.GoingUpEvent, self.start_event_loop)
def __init__(self,listenPort=6633): Task.__init__(self) self.listenPort=int(listenPort) self.finallink=[] self.switches = set() self.adjacency = {} self.addswitches={} self.addlinks=[] self.statuslinks={} self.net=None self.snum=0 self.receivelinkevent=0 #core.addListener(pox.core.openflow_discovery, self._handle_LinkEvent) core.openflow_discovery.addListenerByName("LinkEvent", self._handle_LinkEvent) core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent)
def __init__(self, path): self.path = path self.filelist = None self.counter = 0 self.filenum = 0 self.cmdlist = [ "disconnect", "wait", "reconnect", "pass", "monitor", "reset", "redirect", "unredirect", "passit" ] self.handlers = handlers() self.funclist = None self.sig_table = { "BAD-TRAFFIC same SRC/DST": "1", "ICMP Time-To-Live Exceeded in Transit": "2", "ICMP Echo Reply": "3", "ICMP PING BSDtype": "4", "ICMP PING *NIX": "5", "ICMP PING": "6", "SNMP AgentX/tcp request": "7", "SNMP request tcp": "8" } self.func_table = {} self.alys_cmd() self.action_triggered = False self.name_process() self.mactable = {} self.iptable = {} self.droplist = {} self.monitorlist = {} self.redirectlist = {} self.ignorelist = [] self.socket_map = {} self.server = secure_server(self.socket_map) core.Reminder.addListeners(self) core.addListener(pox.core.GoingUpEvent, self.start_server) core.call_when_ready(self.start, ["openflow_discovery", "NX"]) core.callDelayed(1, self.start_watch)
def __init__(self, path): self.path = path self.filelist=None self.counter=0 self.filenum=0 self.cmdlist = ["disconnect", "wait", "reconnect", "pass", "monitor", "reset", "redirect", "unredirect", "passit"] self.handlers = handlers() self.funclist = None self.sig_table= {"BAD-TRAFFIC same SRC/DST":"1", "ICMP Time-To-Live Exceeded in Transit":"2", "ICMP Echo Reply":"3", "ICMP PING BSDtype":"4", "ICMP PING *NIX":"5", "ICMP PING":"6", "SNMP AgentX/tcp request":"7", "SNMP request tcp":"8"} self.func_table={} self.alys_cmd() self.action_triggered = False self.name_process() self.mactable = {} self.iptable = {} self.droplist = {} self.monitorlist = {} self.redirectlist = {} self.ignorelist = [] self.socket_map = {} self.server = secure_server(self.socket_map) core.Reminder.addListeners(self) core.addListener(pox.core.GoingUpEvent, self.start_server) core.call_when_ready(self.start, ["openflow_discovery", "NX"]) core.callDelayed(1, self.start_watch)
def __init__ (self, port = 6655, address = '0.0.0.0'): Task.__init__(self) self.port = int(port) self.address = address core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent)
def __init__(self): Task.__init__(self) # call our superconstructor self.sockets = self.get_sockets() core.addListener(pox.core.GoingUpEvent, self.start_event_loop) Timer(5,self.SendPortRequest)
def __init__(self): core.openflow.addListeners(self) core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent)
def __init__(self): Task.__init__(self) # call our superconstructor # Note! We can't start our event loop until the core is up. Therefore, # we'll add an event handler. core.addListener(pox.core.GoingUpEvent, self.start_run_loop)