首页 > 代码库 > selective_switch.py

selective_switch.py

from pox.core import corefrom pox.lib.util import str_to_dpidfrom pox.forwarding.l2_learning import LearningSwitchdef launch (ignore_dpid):  ignore_dpid = str_to_dpid(ignore_dpid)  def _handle_ConnectionUp (event):    if event.dpid != ignore_dpid:      core.getLogger().info("Connection %s" % (event.connection,))      LearningSwitch(event.connection, False)  core.openflow.addListenerByName("ConnectionUp", _handle_ConnectionUp)

 

selective_switch.py