use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder in project openflowplugin by opendaylight.
the class InstructionsMissTablePropertySerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final InstructionsMiss property = new InstructionsMissBuilder().setInstructionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss.InstructionsMissBuilder().setInstruction(Collections.singletonList(new InstructionBuilder().setOrder(0).setInstruction(new ApplyActionsCaseBuilder().build()).build())).build()).build();
assertProperty(property, out -> {
assertEquals(out.readUnsignedShort(), InstructionConstants.APPLY_ACTIONS_TYPE);
// Skip length of set field action
out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder in project openflowplugin by opendaylight.
the class ClearActionsInstructionDeserializer method deserialize.
@Override
public Instruction deserialize(ByteBuf input) {
InstructionBuilder builder = new InstructionBuilder();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
builder.setInstructionChoice(new ClearActionsCaseBuilder().build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder in project openflowplugin by opendaylight.
the class MeterInstructionDeserializer method deserialize.
@Override
public Instruction deserialize(ByteBuf input) {
final InstructionBuilder builder = new InstructionBuilder();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
MeterCaseBuilder caseBuilder = new MeterCaseBuilder();
MeterBuilder instructionBuilder = new MeterBuilder();
instructionBuilder.setMeterId(input.readUnsignedInt());
caseBuilder.setMeter(instructionBuilder.build());
builder.setInstructionChoice(caseBuilder.build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder in project openflowplugin by opendaylight.
the class MeterInstructionDeserializer method deserializeHeader.
@Override
public Instruction deserializeHeader(ByteBuf input) {
InstructionBuilder builder = new InstructionBuilder();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
builder.setInstructionChoice(new MeterCaseBuilder().build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder in project openflowplugin by opendaylight.
the class WriteMetadataInstructionDeserializer method deserialize.
@Override
public Instruction deserialize(ByteBuf input) {
final InstructionBuilder builder = new InstructionBuilder();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
input.skipBytes(InstructionConstants.PADDING_IN_WRITE_METADATA);
final WriteMetadataCaseBuilder caseBuilder = new WriteMetadataCaseBuilder();
WriteMetadataBuilder metadataBuilder = new WriteMetadataBuilder();
byte[] metadata = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
input.readBytes(metadata);
metadataBuilder.setMetadata(metadata);
byte[] metadataMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
input.readBytes(metadataMask);
metadataBuilder.setMetadataMask(metadataMask);
caseBuilder.setWriteMetadata(metadataBuilder.build());
builder.setInstructionChoice(caseBuilder.build());
return builder.build();
}
Aggregations