예제 #1
0
파일: topology.py 프로젝트: rubiruchi/ryuo
 def __init__(self, *args, **kwargs):
     super(Topology, self).__init__(*args, **kwargs)
     self.is_active = True
     self.explicit_drop = True
     self.ports = PortDataState()
     self.links = _LinkState()
     self.lldp_event = hub.Event()
     self.link_event = hub.Event()
     self.threads.append(hub.spawn(self.lldp_loop))
     self.threads.append(hub.spawn(self.link_loop))
예제 #2
0
 def __init__(self, *args, **kwargs):
     super(L2Switch, self).__init__(*args, **kwargs)
     self.name = 'switches'
     self.dps = {}  # datapath_id => Datapath class
     self.port_state = {}  # datapath_id => ports
     self.ports = PortDataState()  # Port class -> PortData class
     self.links = LinkState()  # Link class -> timestamp
     self.is_active = True
     self.lldp_event = hub.Event()
     self.link_event = hub.Event()
     self.threads.append(hub.spawn(self.lldp_loop))
     self.threads.append(hub.spawn(self.link_loop))
     self.link_discovery = True