use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCaseBuilder in project openflowplugin by opendaylight.
the class TableFeaturesConvertor method setActionTableFeatureProperty.
private static void setActionTableFeatureProperty(final TableFeaturePropertiesBuilder builder, final TableFeaturesPropType type, final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> salActions) {
List<Action> actionList = new ArrayList<>();
for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action currAction : salActions) {
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionType = currAction.getAction();
ActionBuilder actionBuilder = new ActionBuilder();
if (actionType instanceof OutputActionCase) {
OutputActionCaseBuilder outputActionCaseBuilder = new OutputActionCaseBuilder();
actionBuilder.setActionChoice(outputActionCaseBuilder.build());
} else if (actionType instanceof GroupActionCase) {
GroupCaseBuilder groupActionBuilder = new GroupCaseBuilder();
actionBuilder.setActionChoice(groupActionBuilder.build());
} else if (actionType instanceof CopyTtlOutCase) {
CopyTtlOutCaseBuilder copyTtlOutCaseBuilder = new CopyTtlOutCaseBuilder();
actionBuilder.setActionChoice(copyTtlOutCaseBuilder.build());
} else if (actionType instanceof CopyTtlInCase) {
CopyTtlInCaseBuilder copyTtlInCaseBuilder = new CopyTtlInCaseBuilder();
actionBuilder.setActionChoice(copyTtlInCaseBuilder.build());
} else if (actionType instanceof SetMplsTtlActionCase) {
SetMplsTtlCaseBuilder setMplsTtlActionBuilder = new SetMplsTtlCaseBuilder();
actionBuilder.setActionChoice(setMplsTtlActionBuilder.build());
} else if (actionType instanceof DecMplsTtlCase) {
DecMplsTtlCaseBuilder decMplsTtlCaseBuilder = new DecMplsTtlCaseBuilder();
actionBuilder.setActionChoice(decMplsTtlCaseBuilder.build());
} else if (actionType instanceof PushVlanActionCase) {
PushVlanCaseBuilder pushVlanActionBuilder = new PushVlanCaseBuilder();
actionBuilder.setActionChoice(pushVlanActionBuilder.build());
} else if (actionType instanceof PopVlanActionCase) {
PopVlanCaseBuilder popVlanCaseBuilder = new PopVlanCaseBuilder();
actionBuilder.setActionChoice(popVlanCaseBuilder.build());
} else if (actionType instanceof PushMplsActionCase) {
PushMplsCaseBuilder pushMplsActionBuilder = new PushMplsCaseBuilder();
actionBuilder.setActionChoice(pushMplsActionBuilder.build());
} else if (actionType instanceof PopMplsActionCase) {
PopMplsCaseBuilder popMplsCaseBuilder = new PopMplsCaseBuilder();
actionBuilder.setActionChoice(popMplsCaseBuilder.build());
} else if (actionType instanceof SetQueueActionCase) {
SetQueueCaseBuilder setQueueActionBuilder = new SetQueueCaseBuilder();
actionBuilder.setActionChoice(setQueueActionBuilder.build());
} else if (actionType instanceof SetNwTtlActionCase) {
SetNwTtlCaseBuilder setNwTtlActionBuilder = new SetNwTtlCaseBuilder();
actionBuilder.setActionChoice(setNwTtlActionBuilder.build());
} else if (actionType instanceof DecNwTtlCase) {
DecNwTtlCaseBuilder decNwTtlCaseBuilder = new DecNwTtlCaseBuilder();
actionBuilder.setActionChoice(decNwTtlCaseBuilder.build());
} else if (actionType instanceof SetFieldCase) {
SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
actionBuilder.setActionChoice(setFieldCaseBuilder.build());
} else if (actionType instanceof PushPbbActionCase) {
PushPbbCaseBuilder pushPbbCaseBuilder = new PushPbbCaseBuilder();
actionBuilder.setActionChoice(pushPbbCaseBuilder.build());
} else if (actionType instanceof PopPbbActionCase) {
PopPbbCaseBuilder popPbbCaseBuilder = new PopPbbCaseBuilder();
actionBuilder.setActionChoice(popPbbCaseBuilder.build());
}
// Experimenter action is unhandled
actionList.add(actionBuilder.build());
}
ActionRelatedTableFeaturePropertyBuilder propBuilder = new ActionRelatedTableFeaturePropertyBuilder();
propBuilder.setAction(actionList);
builder.setType(type);
builder.addAugmentation(ActionRelatedTableFeatureProperty.class, propBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createDecNwTtlInstructions.
private static InstructionsBuilder createDecNwTtlInstructions() {
DecNwTtlBuilder ta = new DecNwTtlBuilder();
DecNwTtl decNwTtl = ta.build();
ActionBuilder ab = new ActionBuilder();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
// Add our drop action to a list
List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setKey(new InstructionKey(0));
ib.setOrder(0);
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginGroupTestCommandProvider method createDecNwTtlAction.
private List<Action> createDecNwTtlAction() {
DecNwTtlBuilder nwttl = new DecNwTtlBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(nwttl.build()).build());
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
// output.setMaxLength(30);
Uri value = new Uri("2");
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
ab.setOrder(0);
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
actions.add(action.build());
return actions;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCaseBuilder in project openflowplugin by opendaylight.
the class GroupDescStatsResponseConvertorTest method testGroupDescStats.
/**
* Test single GroupDescStats conversion.
*/
@Test
public void testGroupDescStats() {
// **********************************************
// First group desc
// **********************************************
GroupDescBuilder builder = new GroupDescBuilder();
builder.setType(GroupType.OFPGTFF);
builder.setGroupId(new GroupId(42L));
// Buckets for first group desc
BucketsListBuilder bucketsBuilder = new BucketsListBuilder();
bucketsBuilder.setWeight(16);
bucketsBuilder.setWatchPort(new PortNumber(84L));
bucketsBuilder.setWatchGroup(168L);
// Actions for buckets for first group desc
List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new CopyTtlInCaseBuilder().build());
actions.add(actionBuilder.build());
// Build bucket with actions
bucketsBuilder.setAction(actions);
List<BucketsList> bucketsList = new ArrayList<>();
bucketsList.add(bucketsBuilder.build());
// Build first group desc
builder.setBucketsList(bucketsList);
List<GroupDesc> groupDescStats = new ArrayList<>();
groupDescStats.add(builder.build());
// **********************************************
// Second group desc
// **********************************************
builder = new GroupDescBuilder();
builder.setType(GroupType.OFPGTINDIRECT);
builder.setGroupId(new GroupId(50L));
// First buckets for second group desc
bucketsList = new ArrayList<>();
bucketsBuilder = new BucketsListBuilder();
bucketsBuilder.setWeight(100);
bucketsBuilder.setWatchPort(new PortNumber(200L));
bucketsBuilder.setWatchGroup(400L);
// Actions for first buckets for second group desc
actions = new ArrayList<>();
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new CopyTtlOutCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new DecNwTtlCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new PopPbbCaseBuilder().build());
actions.add(actionBuilder.build());
// Build first bucket with actions
bucketsBuilder.setAction(actions);
bucketsList.add(bucketsBuilder.build());
// Second buckets for second group desc
bucketsBuilder = new BucketsListBuilder();
bucketsBuilder.setWeight(5);
bucketsBuilder.setWatchPort(new PortNumber(10L));
bucketsBuilder.setWatchGroup(15L);
// Actions for second buckets for second group desc
actions = new ArrayList<>();
// Build second bucket with actions
bucketsBuilder.setAction(actions);
bucketsList.add(bucketsBuilder.build());
// Build second group desc
builder.setBucketsList(bucketsList);
groupDescStats.add(builder.build());
VersionConvertorData data = new VersionConvertorData(OFConstants.OFP_VERSION_1_3);
List<GroupDescStats> statsList = convert(groupDescStats, data);
Assert.assertEquals("Wrong groupDesc stats size", 2, statsList.size());
// **********************************************
// Test first group desc
// **********************************************
GroupDescStats stat = statsList.get(0);
Assert.assertEquals("Wrong type", GroupTypes.GroupFf, stat.getGroupType());
Assert.assertEquals("Wrong group-id", 42, stat.getGroupId().getValue().intValue());
Assert.assertEquals("Wrong key", 42, stat.getKey().getGroupId().getValue().intValue());
Assert.assertEquals("Wrong buckets size", 1, stat.getBuckets().getBucket().size());
// Test first bucket for first group desc
Bucket bucket = stat.getBuckets().getBucket().get(0);
Assert.assertEquals("Wrong type", 0, bucket.getKey().getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 0, bucket.getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 16, bucket.getWeight().intValue());
Assert.assertEquals("Wrong type", 168, bucket.getWatchGroup().intValue());
Assert.assertEquals("Wrong type", 84, bucket.getWatchPort().intValue());
Assert.assertEquals("Wrong type", 1, bucket.getAction().size());
// Test first action for first bucket for first group desc
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action action = bucket.getAction().get(0);
Assert.assertEquals("Wrong type", 0, action.getOrder().intValue());
Assert.assertEquals("Wrong type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112" + ".action.action.CopyTtlInCase", action.getAction().getImplementedInterface().getName());
// **********************************************
// Test second group desc
// **********************************************
stat = statsList.get(1);
Assert.assertEquals("Wrong type", GroupTypes.GroupIndirect, stat.getGroupType());
Assert.assertEquals("Wrong group-id", 50, stat.getGroupId().getValue().intValue());
Assert.assertEquals("Wrong key", 50, stat.getKey().getGroupId().getValue().intValue());
Assert.assertEquals("Wrong buckets size", 2, stat.getBuckets().getBucket().size());
// Test first bucket for second group desc
bucket = stat.getBuckets().getBucket().get(0);
Assert.assertEquals("Wrong type", 0, bucket.getKey().getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 0, bucket.getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 100, bucket.getWeight().intValue());
Assert.assertEquals("Wrong type", 400, bucket.getWatchGroup().intValue());
Assert.assertEquals("Wrong type", 200, bucket.getWatchPort().intValue());
Assert.assertEquals("Wrong type", 3, bucket.getAction().size());
// Test first action for first bucket of second group desc
action = bucket.getAction().get(0);
Assert.assertEquals("Wrong type", 0, action.getOrder().intValue());
Assert.assertEquals("Wrong type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112" + ".action.action.CopyTtlOutCase", action.getAction().getImplementedInterface().getName());
// Test second action for first bucket of second group desc
action = bucket.getAction().get(1);
Assert.assertEquals("Wrong type", 1, action.getOrder().intValue());
Assert.assertEquals("Wrong type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112" + ".action.action.DecNwTtlCase", action.getAction().getImplementedInterface().getName());
// Test third action for first bucket of second group desc
action = bucket.getAction().get(2);
Assert.assertEquals("Wrong type", 2, action.getOrder().intValue());
Assert.assertEquals("Wrong type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112" + ".action.action.PopPbbActionCase", action.getAction().getImplementedInterface().getName());
// Test second bucket for second group desc
bucket = stat.getBuckets().getBucket().get(1);
Assert.assertEquals("Wrong type", 1, bucket.getKey().getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 1, bucket.getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 5, bucket.getWeight().intValue());
Assert.assertEquals("Wrong type", 15, bucket.getWatchGroup().intValue());
Assert.assertEquals("Wrong type", 10, bucket.getWatchPort().intValue());
Assert.assertEquals("Wrong type", 0, bucket.getAction().size());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCaseBuilder in project openflowplugin by opendaylight.
the class OF13ActionsSerializerTest method test.
/**
* Testing correct serialization of actions.
*/
@Test
public void test() {
OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
OutputActionBuilder outputBuilder = new OutputActionBuilder();
outputBuilder.setPort(new PortNumber(42L));
outputBuilder.setMaxLength(52);
caseBuilder.setOutputAction(outputBuilder.build());
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(caseBuilder.build());
List<Action> actions = new ArrayList<>();
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new CopyTtlOutCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new CopyTtlInCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetMplsTtlCaseBuilder setMplsTtlCaseBuilder = new SetMplsTtlCaseBuilder();
SetMplsTtlActionBuilder setMplsTtlBuilder = new SetMplsTtlActionBuilder();
setMplsTtlBuilder.setMplsTtl((short) 4);
setMplsTtlCaseBuilder.setSetMplsTtlAction(setMplsTtlBuilder.build());
actionBuilder.setActionChoice(setMplsTtlCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new DecMplsTtlCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();
pushVlanBuilder.setEthertype(new EtherType(new EtherType(16)));
pushVlanCaseBuilder.setPushVlanAction(pushVlanBuilder.build());
actionBuilder.setActionChoice(pushVlanCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
PushMplsCaseBuilder pushMplsCaseBuilder = new PushMplsCaseBuilder();
PushMplsActionBuilder pushMplsBuilder = new PushMplsActionBuilder();
pushMplsBuilder.setEthertype(new EtherType(new EtherType(17)));
pushMplsCaseBuilder.setPushMplsAction(pushMplsBuilder.build());
actionBuilder.setActionChoice(pushMplsCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
PopMplsCaseBuilder popMplsCaseBuilder = new PopMplsCaseBuilder();
PopMplsActionBuilder popMplsBuilder = new PopMplsActionBuilder();
popMplsBuilder.setEthertype(new EtherType(new EtherType(18)));
popMplsCaseBuilder.setPopMplsAction(popMplsBuilder.build());
actionBuilder.setActionChoice(popMplsCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetQueueCaseBuilder setQueueCaseBuilder = new SetQueueCaseBuilder();
SetQueueActionBuilder setQueueBuilder = new SetQueueActionBuilder();
setQueueBuilder.setQueueId(1234L);
setQueueCaseBuilder.setSetQueueAction(setQueueBuilder.build());
actionBuilder.setActionChoice(setQueueCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
GroupCaseBuilder groupCaseBuilder = new GroupCaseBuilder();
GroupActionBuilder groupActionBuilder = new GroupActionBuilder();
groupActionBuilder.setGroupId(555L);
groupCaseBuilder.setGroupAction(groupActionBuilder.build());
actionBuilder.setActionChoice(groupCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetNwTtlCaseBuilder nwTtlCaseBuilder = new SetNwTtlCaseBuilder();
SetNwTtlActionBuilder nwTtlBuilder = new SetNwTtlActionBuilder();
nwTtlBuilder.setNwTtl((short) 8);
nwTtlCaseBuilder.setSetNwTtlAction(nwTtlBuilder.build());
actionBuilder.setActionChoice(nwTtlCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new DecNwTtlCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
matchBuilder.setOxmClass(OpenflowBasicClass.class);
matchBuilder.setOxmMatchField(InPort.class);
matchBuilder.setHasMask(false);
InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();
InPortBuilder inPortBuilder = new InPortBuilder();
inPortBuilder.setPortNumber(new PortNumber(1L));
inPortCaseBuilder.setInPort(inPortBuilder.build());
matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());
List<MatchEntry> entries = new ArrayList<>();
entries.add(matchBuilder.build());
SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
setFieldBuilder.setMatchEntry(entries);
SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
actionBuilder.setActionChoice(setFieldCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
PushPbbCaseBuilder pushPbbCaseBuilder = new PushPbbCaseBuilder();
PushPbbActionBuilder pushPbbBuilder = new PushPbbActionBuilder();
pushPbbBuilder.setEthertype(new EtherType(new EtherType(19)));
pushPbbCaseBuilder.setPushPbbAction(pushPbbBuilder.build());
actionBuilder.setActionChoice(pushPbbCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new PopPbbCaseBuilder().build());
actions.add(actionBuilder.build());
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
ListSerializer.serializeList(actions, TypeKeyMakerFactory.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID), registry, out);
Assert.assertEquals("Wrong action type", 0, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 16, out.readUnsignedShort());
Assert.assertEquals("Wrong action port", 42, out.readUnsignedInt());
Assert.assertEquals("Wrong action max-length", 52, out.readUnsignedShort());
out.skipBytes(6);
Assert.assertEquals("Wrong action type", 11, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
out.skipBytes(4);
Assert.assertEquals("Wrong action type", 12, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
out.skipBytes(4);
Assert.assertEquals("Wrong action type", 15, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
Assert.assertEquals("Wrong action mpls-ttl", 4, out.readUnsignedByte());
out.skipBytes(3);
Assert.assertEquals("Wrong action type", 16, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
out.skipBytes(4);
Assert.assertEquals("Wrong action type", 17, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
Assert.assertEquals("Wrong action ethertype", 16, out.readUnsignedShort());
out.skipBytes(2);
Assert.assertEquals("Wrong action type", 18, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
out.skipBytes(4);
Assert.assertEquals("Wrong action type", 19, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
Assert.assertEquals("Wrong action ethertype", 17, out.readUnsignedShort());
out.skipBytes(2);
Assert.assertEquals("Wrong action type", 20, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
Assert.assertEquals("Wrong action ethertype", 18, out.readUnsignedShort());
out.skipBytes(2);
Assert.assertEquals("Wrong action type", 21, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
Assert.assertEquals("Wrong action queue-id", 1234, out.readUnsignedInt());
Assert.assertEquals("Wrong action type", 22, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
Assert.assertEquals("Wrong action group", 555, out.readUnsignedInt());
Assert.assertEquals("Wrong action type", 23, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
Assert.assertEquals("Wrong action nw-ttl", 8, out.readUnsignedByte());
out.skipBytes(3);
Assert.assertEquals("Wrong action type", 24, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
out.skipBytes(4);
Assert.assertEquals("Wrong action type", 25, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 16, out.readUnsignedShort());
Assert.assertEquals("Wrong match entry class", 0x8000, out.readUnsignedShort());
Assert.assertEquals("Wrong match entry field & mask", 0, out.readUnsignedByte());
Assert.assertEquals("Wrong match entry length", 4, out.readUnsignedByte());
Assert.assertEquals("Wrong match entry value", 1, out.readUnsignedInt());
out.skipBytes(4);
Assert.assertEquals("Wrong action type", 26, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
Assert.assertEquals("Wrong action ethertype", 19, out.readUnsignedShort());
out.skipBytes(2);
Assert.assertEquals("Wrong action type", 27, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 8, out.readUnsignedShort());
out.skipBytes(4);
Assert.assertTrue("Unread data", out.readableBytes() == 0);
}
Aggregations