当前位置: 首页>>代码示例>>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;未经允许,请勿转载。