本文整理汇总了Python中ryu.controller.handler.MAIN_DISPATCHER属性的典型用法代码示例。如果您正苦于以下问题:Python handler.MAIN_DISPATCHER属性的具体用法?Python handler.MAIN_DISPATCHER怎么用?Python handler.MAIN_DISPATCHER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类ryu.controller.handler
的用法示例。
在下文中一共展示了handler.MAIN_DISPATCHER属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dp_state_change_handler
# 需要导入模块: from ryu.controller import handler [as 别名]
# 或者: from ryu.controller.handler import MAIN_DISPATCHER [as 别名]
def dp_state_change_handler(self, ev):
datapath = ev.datapath
if ev.state == MAIN_DISPATCHER:
self.controller.switch_connect(datapath)
elif ev.state == DEAD_DISPATCHER:
self.controller.switch_disconnect(datapath)
示例2: dispatcher_change
# 需要导入模块: from ryu.controller import handler [as 别名]
# 或者: from ryu.controller.handler import MAIN_DISPATCHER [as 别名]
def dispatcher_change(self, ev):
datapath = ev.datapath
assert datapath is not None
if ev.state == handler.MAIN_DISPATCHER:
self._register(datapath)
elif ev.state == handler.DEAD_DISPATCHER:
self._unregister(datapath)
示例3: dispacher_change
# 需要导入模块: from ryu.controller import handler [as 别名]
# 或者: from ryu.controller.handler import MAIN_DISPATCHER [as 别名]
def dispacher_change(self, ev):
assert ev.datapath is not None
if ev.state == handler.MAIN_DISPATCHER:
self._register_sw(ev.datapath)
elif ev.state == handler.DEAD_DISPATCHER:
self._unregister_sw(ev.datapath)
示例4: dispacher_change
# 需要导入模块: from ryu.controller import handler [as 别名]
# 或者: from ryu.controller.handler import MAIN_DISPATCHER [as 别名]
def dispacher_change(self, ev):
assert ev.datapath is not None
if ev.state == handler.MAIN_DISPATCHER:
self._register_bridge(ev.datapath)
elif ev.state == handler.DEAD_DISPATCHER:
self._unregister_bridge(ev.datapath.id)
示例5: state_change_handler
# 需要导入模块: from ryu.controller import handler [as 别名]
# 或者: from ryu.controller.handler import MAIN_DISPATCHER [as 别名]
def state_change_handler(self, evt):
"""StateChange event handler."""
datapath = evt.datapath
assert datapath is not None
if datapath.id == self._querier.dpid:
if evt.state == MAIN_DISPATCHER:
self._querier.start_loop(datapath)
elif evt.state == DEAD_DISPATCHER:
self._querier.stop_loop()
示例6: _state_change_handler
# 需要导入模块: from ryu.controller import handler [as 别名]
# 或者: from ryu.controller.handler import MAIN_DISPATCHER [as 别名]
def _state_change_handler(self, ev):
datapath = ev.datapath
if ev.state == MAIN_DISPATCHER:
if not datapath.id in self.datapaths:
LOG.debug('register datapath: %016x', datapath.id)
self.datapaths[datapath.id] = datapath
elif ev.state == DEAD_DISPATCHER:
if datapath.id in self.datapaths:
LOG.debug('deregister datapath: %016x', datapath.id)
del self.datapaths[datapath.id]