本文整理匯總了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]