예제 #1
0
 def check_loops(simulation):
   # Always check liveness
   down_controllers = InvariantChecker.check_liveness(simulation)
   if down_controllers != []:
     return down_controllers
   # Warning! depends on python Hassell -- may be really slow!
   NTF = hsa_topo.generate_NTF(simulation.topology.live_switches)
   TTF = hsa_topo.generate_TTF(simulation.topology.live_links)
   loops = hsa.detect_loop(NTF, TTF, simulation.topology.access_links)
   return loops
예제 #2
0
 def check_loops(simulation):
     # Always check liveness
     down_controllers = InvariantChecker.check_liveness(simulation)
     if down_controllers != []:
         return down_controllers
     # Warning! depends on python Hassell -- may be really slow!
     NTF = hsa_topo.generate_NTF(simulation.topology.live_switches)
     TTF = hsa_topo.generate_TTF(simulation.topology.live_links)
     loops = hsa.detect_loop(NTF, TTF, simulation.topology.access_links)
     return loops
예제 #3
0
 def check_loops(simulation):
   # Always check liveness if there is a single controllers
   # Dynamic imports to allow this method to be serialized
   import sts.headerspace.topology_loader.topology_loader as hsa_topo
   import sts.headerspace.headerspace.applications as hsa
   if len(simulation.controller_manager.controllers) == 1:
     down_controllers = InvariantChecker.check_liveness(simulation)
     if down_controllers != []:
       return down_controllers
   # Warning! depends on python Hassell -- may be really slow!
   NTF = hsa_topo.generate_NTF(simulation.topology.live_switches)
   TTF = hsa_topo.generate_TTF(simulation.topology.live_links)
   loops = hsa.detect_loop(NTF, TTF, simulation.topology.live_switches)
   return loops