本文整理汇总了Java中org.onosproject.net.flow.instructions.Instructions.MetadataInstruction方法的典型用法代码示例。如果您正苦于以下问题:Java Instructions.MetadataInstruction方法的具体用法?Java Instructions.MetadataInstruction怎么用?Java Instructions.MetadataInstruction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.net.flow.instructions.Instructions
的用法示例。
在下文中一共展示了Instructions.MetadataInstruction方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DefaultTrafficTreatment
import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
/**
* Creates a new traffic treatment from the specified list of instructions.
*
* @param deferred deferred instructions
* @param immediate immediate instructions
* @param table table transition instruction
* @param clear instruction to clear the deferred actions list
*/
private DefaultTrafficTreatment(List<Instruction> deferred,
List<Instruction> immediate,
Instructions.TableTypeTransition table,
boolean clear,
Instructions.MetadataInstruction meta,
Instructions.MeterInstruction meter) {
this.immediate = ImmutableList.copyOf(checkNotNull(immediate));
this.deferred = ImmutableList.copyOf(checkNotNull(deferred));
this.all = new ImmutableList.Builder<Instruction>()
.addAll(immediate)
.addAll(deferred)
.build();
this.table = table;
this.meta = meta;
this.hasClear = clear;
this.meter = meter;
}
示例2: add
import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
@Override
public Builder add(Instruction instruction) {
switch (instruction.type()) {
case NOACTION:
case OUTPUT:
case GROUP:
case QUEUE:
case L0MODIFICATION:
case L1MODIFICATION:
case L2MODIFICATION:
case L3MODIFICATION:
case L4MODIFICATION:
case EXTENSION:
current.add(instruction);
break;
case TABLE:
table = (Instructions.TableTypeTransition) instruction;
break;
case METADATA:
meta = (Instructions.MetadataInstruction) instruction;
break;
case METER:
meter = (Instructions.MeterInstruction) instruction;
break;
default:
throw new IllegalArgumentException("Unknown instruction type: " +
instruction.type());
}
return this;
}
示例3: buildMetadata
import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
private OFInstruction buildMetadata(Instructions.MetadataInstruction m) {
OFInstruction instruction = factory().instructions().writeMetadata(
U64.of(m.metadata()), U64.of(m.metadataMask()));
return instruction;
}
示例4: writeMetadata
import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
@Override
public Instructions.MetadataInstruction writeMetadata() {
return meta;
}
示例5: writeMetadata
import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
/**
* Returns the metadata instruction if there is one.
*
* @return a metadata instruction that may be null
*/
Instructions.MetadataInstruction writeMetadata();