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


Java OFFlowRemoved.getMatch方法代码示例

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


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

示例1: processFlowRemovedMessage

import org.openflow.protocol.OFFlowRemoved; //导入方法依赖的package包/类
/**
 * Processes a flow removed message. We will delete the learned MAC/VLAN mapping from
 * the switch's table.
 * @param sw The switch that sent the flow removed message.
 * @param flowRemovedMessage The flow removed message.
 * @return Whether to continue processing this message or stop.
 */
private Command processFlowRemovedMessage(IOFSwitch sw, OFFlowRemoved flowRemovedMessage) {
    if (flowRemovedMessage.getCookie() != LearningSwitch.LEARNING_SWITCH_COOKIE) {
        return Command.CONTINUE;
    }
    if (log.isTraceEnabled()) {
        log.trace("{} flow entry removed {}", sw, flowRemovedMessage);
    }
    OFMatch match = flowRemovedMessage.getMatch();
    // When a flow entry expires, it means the device with the matching source
    // MAC address and VLAN either stopped sending packets or moved to a different
    // port.  If the device moved, we can't know where it went until it sends
    // another packet, allowing us to re-learn its port.  Meanwhile we remove
    // it from the macVlanToPortMap to revert to flooding packets to this device.
    this.removeFromPortMap(sw, Ethernet.toLong(match.getDataLayerSource()),
        match.getDataLayerVirtualLan());

    // Also, if packets keep coming from another device (e.g. from ping), the
    // corresponding reverse flow entry will never expire on its own and will
    // send the packets to the wrong port (the matching input port of the
    // expired flow entry), so we must delete the reverse entry explicitly.
    this.writeFlowMod(sw, OFFlowMod.OFPFC_DELETE, -1, match.clone()
            .setWildcards(((Integer)sw.getAttribute(IOFSwitch.PROP_FASTWILDCARDS)).intValue()
                    & ~OFMatch.OFPFW_DL_VLAN & ~OFMatch.OFPFW_DL_SRC & ~OFMatch.OFPFW_DL_DST
                    & ~OFMatch.OFPFW_NW_SRC_MASK & ~OFMatch.OFPFW_NW_DST_MASK)
            .setDataLayerSource(match.getDataLayerDestination())
            .setDataLayerDestination(match.getDataLayerSource())
            .setNetworkSource(match.getNetworkDestination())
            .setNetworkDestination(match.getNetworkSource())
            .setTransportSource(match.getTransportDestination())
            .setTransportDestination(match.getTransportSource()),
            match.getInputPort());
    return Command.CONTINUE;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:41,代码来源:LearningSwitch.java

示例2: processFlowRemovedMessage

import org.openflow.protocol.OFFlowRemoved; //导入方法依赖的package包/类
/**
 * Processes a flow removed message. We will delete the learned MAC/VLAN mapping from
 * the switch's table.
 * @param sw The switch that sent the flow removed message.
 * @param flowRemovedMessage The flow removed message.
 * @return Whether to continue processing this message or stop.
 */
private Command processFlowRemovedMessage(IOFSwitch sw, OFFlowRemoved flowRemovedMessage) {
    if (flowRemovedMessage.getCookie() != LearningSwitch.LEARNING_SWITCH_COOKIE) {
        return Command.CONTINUE;
    }
    if (log.isTraceEnabled()) {
        log.trace("{} flow entry removed {}", sw, flowRemovedMessage);
    }
    OFMatch match = flowRemovedMessage.getMatch();
    // When a flow entry expires, it means the device with the matching source
    // MAC address and VLAN either stopped sending packets or moved to a different
    // port.  If the device moved, we can't know where it went until it sends
    // another packet, allowing us to re-learn its port.  Meanwhile we remove
    // it from the macVlanToPortMap to revert to flooding packets to this device.
    this.removeFromPortMap(sw, Ethernet.toLong(match.getDataLayerSource()),
        match.getDataLayerVirtualLan());
    
    // Also, if packets keep coming from another device (e.g. from ping), the
    // corresponding reverse flow entry will never expire on its own and will
    // send the packets to the wrong port (the matching input port of the
    // expired flow entry), so we must delete the reverse entry explicitly.
    this.writeFlowMod(sw, OFFlowMod.OFPFC_DELETE, -1, match.clone()
            .setWildcards(((Integer)sw.getAttribute(IOFSwitch.PROP_FASTWILDCARDS)).intValue()
                    & ~OFMatch.OFPFW_DL_VLAN & ~OFMatch.OFPFW_DL_SRC & ~OFMatch.OFPFW_DL_DST
                    & ~OFMatch.OFPFW_NW_SRC_MASK & ~OFMatch.OFPFW_NW_DST_MASK)
            .setDataLayerSource(match.getDataLayerDestination())
            .setDataLayerDestination(match.getDataLayerSource())
            .setNetworkSource(match.getNetworkDestination())
            .setNetworkDestination(match.getNetworkSource())
            .setTransportSource(match.getTransportDestination())
            .setTransportDestination(match.getTransportSource()),
            match.getInputPort());
    return Command.CONTINUE;
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:41,代码来源:LearningSwitch.java

示例3: deactivateFlow

import org.openflow.protocol.OFFlowRemoved; //导入方法依赖的package包/类
/**
 * Deactivate a flow in the flow-cache - called when flow-mod removal mesg
 * is received. For performance reasons the flow may be marked as inactive
 * and the space used by the flow may not be released. When flow-cache is
 * low on memory then deleteFlow() should be called instead.
 *
 * @param appInst the app inst
 * @param flowRemMsg the flow rem msg
 * @return true:  flow was found in the cache and was deactivated
 * false: flow was not found in the cache
 */
protected boolean deactivateFlow(String appInst, OFFlowRemoved flowRemMsg, long swDpid) {
    OFMatchWithSwDpid ofmWithSwDpid = new OFMatchWithSwDpid(flowRemMsg.getMatch(), swDpid);
    return deactivateFlow(
                appInst, ofmWithSwDpid, flowRemMsg.getPriority());
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:17,代码来源:BetterFlowCache.java

示例4: deleteFlow

import org.openflow.protocol.OFFlowRemoved; //导入方法依赖的package包/类
/**
 * Delete a flow from the flow-cache - called when flow-mod removal mesg
 * is received an flow cache is low on space. The space used by the flow is
 * released
 *
 * @param appInst the app inst
 * @param flowRemMsg the flow rem msg
 * @return true:  flow was found in the cache and was deactivated
 * false: flow was not found in the cache
 */
protected boolean deleteFlow(String appInst, OFFlowRemoved flowRemMsg, long swDpid) {
    OFMatchWithSwDpid ofmWithSwDpid = new OFMatchWithSwDpid(flowRemMsg.getMatch(), swDpid);
    return deleteFlow(
            appInst, ofmWithSwDpid, flowRemMsg.getPriority());
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:16,代码来源:BetterFlowCache.java


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