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


Java OFActionEnqueue类代码示例

本文整理汇总了Java中org.projectfloodlight.openflow.protocol.action.OFActionEnqueue的典型用法代码示例。如果您正苦于以下问题:Java OFActionEnqueue类的具体用法?Java OFActionEnqueue怎么用?Java OFActionEnqueue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OFActionEnqueue类属于org.projectfloodlight.openflow.protocol.action包,在下文中一共展示了OFActionEnqueue类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildActions

import org.projectfloodlight.openflow.protocol.action.OFActionEnqueue; //导入依赖的package包/类
private List<OFAction> buildActions() {
    List<OFAction> acts = new LinkedList<>();
    OFAction act;
    if (treatment == null) {
        return acts;
    }
    for (Instruction i : treatment.immediate()) {
        switch (i.type()) {
        case NOACTION:
            return Collections.emptyList();
        case L2MODIFICATION:
            act = buildL2Modification(i);
            if (act != null) {
                acts.add(buildL2Modification(i));
            }
            break;
        case L3MODIFICATION:
            act = buildL3Modification(i);
            if (act != null) {
                acts.add(buildL3Modification(i));
            }
            break;
        case OUTPUT:
            OutputInstruction out = (OutputInstruction) i;
            OFActionOutput.Builder action = factory().actions().buildOutput()
                    .setPort(OFPort.of((int) out.port().toLong()));
            if (out.port().equals(PortNumber.CONTROLLER)) {
                action.setMaxLen(OFPCML_NO_BUFFER);
            }
            acts.add(action.build());
            break;
        case QUEUE:
            SetQueueInstruction queue = (SetQueueInstruction) i;
            if (queue.port() == null) {
                log.warn("Required argument 'port' undefined for OFActionEnqueue");
            }
            OFActionEnqueue.Builder queueBuilder = factory().actions().buildEnqueue()
                    .setQueueId(queue.queueId())
                    .setPort(OFPort.ofInt((int) queue.port().toLong()));
            acts.add(queueBuilder.build());
            break;
        case L0MODIFICATION:
        case L1MODIFICATION:
        case GROUP:
        case TABLE:
        case METADATA:
            log.warn("Instruction type {} not supported with protocol version {}",
                    i.type(), factory().getVersion());
            break;
        default:
            log.warn("Instruction type {} not yet implemented.", i.type());
        }
    }

    return acts;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:57,代码来源:FlowModBuilderVer10.java


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