當前位置: 首頁>>代碼示例>>Python>>正文


Python handler.MAIN_DISPATCHER屬性代碼示例

本文整理匯總了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) 
開發者ID:sdn-ixp,項目名稱:iSDX,代碼行數:9,代碼來源:refmon.py

示例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) 
開發者ID:OpenState-SDN,項目名稱:ryu,代碼行數:9,代碼來源:dpset.py

示例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) 
開發者ID:OpenState-SDN,項目名稱:ryu,代碼行數:8,代碼來源:tester.py

示例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) 
開發者ID:OpenState-SDN,項目名稱:ryu,代碼行數:8,代碼來源:stplib.py

示例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() 
開發者ID:OpenState-SDN,項目名稱:ryu,代碼行數:11,代碼來源:igmplib.py

示例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] 
開發者ID:ttsubo,項目名稱:simpleRouter,代碼行數:12,代碼來源:simpleMonitor.py


注:本文中的ryu.controller.handler.MAIN_DISPATCHER屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。