本文整理汇总了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;
}