当前位置: 首页>>代码示例>>Java>>正文


Java OFPortStatus.getDesc方法代码示例

本文整理汇总了Java中org.openflow.protocol.OFPortStatus.getDesc方法的典型用法代码示例。如果您正苦于以下问题:Java OFPortStatus.getDesc方法的具体用法?Java OFPortStatus.getDesc怎么用?Java OFPortStatus.getDesc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openflow.protocol.OFPortStatus的用法示例。


在下文中一共展示了OFPortStatus.getDesc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handlePortStatusMessage

import org.openflow.protocol.OFPortStatus; //导入方法依赖的package包/类
protected void handlePortStatusMessage(IOFSwitch sw, OFPortStatus m) {
    short portNumber = m.getDesc().getPortNumber();
    OFPhysicalPort port = m.getDesc();
    if (m.getReason() == (byte)OFPortReason.OFPPR_MODIFY.ordinal()) {
        sw.setPort(port);
        log.debug("Port #{} modified for {}", portNumber, sw);
    } else if (m.getReason() == (byte)OFPortReason.OFPPR_ADD.ordinal()) {
        sw.setPort(port);
        log.debug("Port #{} added for {}", portNumber, sw);
    } else if (m.getReason() ==
               (byte)OFPortReason.OFPPR_DELETE.ordinal()) {
        sw.deletePort(portNumber);
        log.debug("Port #{} deleted for {}", portNumber, sw);
    }
    SwitchUpdate update = new SwitchUpdate(sw, SwitchUpdateType.PORTCHANGED);
    try {
        this.updates.put(update);
    } catch (InterruptedException e) {
        log.error("Failure adding update to queue", e);
    }
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:22,代码来源:Controller.java

示例2: handlePortStatusMessage

import org.openflow.protocol.OFPortStatus; //导入方法依赖的package包/类
protected void handlePortStatusMessage(IOFSwitch sw,
                                       OFPortStatus m,
                                       boolean updateStorage) {
    short portNumber = m.getDesc().getPortNumber();
    OFPhysicalPort port = m.getDesc();
    if (m.getReason() == (byte)OFPortReason.OFPPR_MODIFY.ordinal()) {
        sw.setPort(port);
        if (updateStorage)
            updatePortInfo(sw, port);
        log.debug("Port #{} modified for {}", portNumber, sw);
    } else if (m.getReason() == (byte)OFPortReason.OFPPR_ADD.ordinal()) {
        sw.setPort(port);
        if (updateStorage)
            updatePortInfo(sw, port);
        log.debug("Port #{} added for {}", portNumber, sw);
    } else if (m.getReason() == 
               (byte)OFPortReason.OFPPR_DELETE.ordinal()) {
        sw.deletePort(portNumber);
        if (updateStorage)
            removePortInfo(sw, portNumber);
        log.debug("Port #{} deleted for {}", portNumber, sw);
    }
    SwitchUpdate update = new SwitchUpdate(sw, SwitchUpdateType.PORTCHANGED);
    try {
        this.updates.put(update);
    } catch (InterruptedException e) {
        log.error("Failure adding update to queue", e);
    }
}
 
开发者ID:smartenit-eu,项目名称:smartenit,代码行数:30,代码来源:Controller.java

示例3: processPortStatusMsg

import org.openflow.protocol.OFPortStatus; //导入方法依赖的package包/类
private void processPortStatusMsg(OFPortStatus msg) {
    OFPhysicalPort port = msg.getDesc();
    if (msg.getReason() == (byte) OFPortReason.OFPPR_MODIFY.ordinal()) {
        updatePhysicalPort(port);
    } else if (msg.getReason() == (byte) OFPortReason.OFPPR_ADD.ordinal()) {
        updatePhysicalPort(port);
    } else if (msg.getReason() == (byte) OFPortReason.OFPPR_DELETE
            .ordinal()) {
        deletePhysicalPort(port);
    }

}
 
开发者ID:lbchen,项目名称:ODL,代码行数:13,代码来源:SwitchHandler.java


注:本文中的org.openflow.protocol.OFPortStatus.getDesc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。