use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfieldBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTableFeaturesTestCommandProvider method createMatchFieldTblFeatureProp.
private TableFeaturePropertiesBuilder createMatchFieldTblFeatureProp() {
// t10
List<SetFieldMatch> setFieldMatch = new ArrayList<>();
SetFieldMatchBuilder setFieldMatchBld = new SetFieldMatchBuilder();
setFieldMatchBld.setHasMask(false);
setFieldMatchBld.setMatchType(MplsLabel.class);
setFieldMatch.add(setFieldMatchBld.build());
MatchBuilder matchBld = new MatchBuilder();
MatchSetfieldBuilder matchSetfieldBld = new MatchSetfieldBuilder();
matchSetfieldBld.setSetFieldMatch(setFieldMatch);
matchBld.setMatchSetfield(matchSetfieldBld.build());
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(matchBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfieldBuilder in project openflowplugin by opendaylight.
the class MultipartReplyTableFeaturesDeserializer method readTableProperties.
private TableProperties readTableProperties(ByteBuf message, int length) {
final List<TableFeatureProperties> items = new ArrayList<>();
int tableFeaturesLength = length;
int order = 0;
while (tableFeaturesLength > 0) {
final int propStartIndex = message.readerIndex();
final TableFeaturesPropType propType = TableFeaturesPropType.forValue(message.readUnsignedShort());
int propertyLength = message.readUnsignedShort();
final int paddingRemainder = propertyLength % EncodeConstants.PADDING;
tableFeaturesLength -= propertyLength;
final int commonPropertyLength = propertyLength - COMMON_PROPERTY_LENGTH;
final TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder().setOrder(order).setKey(new TableFeaturePropertiesKey(order));
switch(propType) {
case OFPTFPTINSTRUCTIONS:
propBuilder.setTableFeaturePropType(new InstructionsBuilder().setInstructions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.InstructionsBuilder().setInstruction(readInstructions(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTINSTRUCTIONSMISS:
propBuilder.setTableFeaturePropType(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(readInstructions(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTNEXTTABLES:
propBuilder.setTableFeaturePropType(new NextTableBuilder().setTables(new TablesBuilder().setTableIds(readNextTableIds(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTNEXTTABLESMISS:
propBuilder.setTableFeaturePropType(new NextTableMissBuilder().setTablesMiss(new TablesMissBuilder().setTableIds(readNextTableIds(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTWRITEACTIONS:
propBuilder.setTableFeaturePropType(new WriteActionsBuilder().setWriteActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.WriteActionsBuilder().setAction(readActions(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTWRITEACTIONSMISS:
propBuilder.setTableFeaturePropType(new WriteActionsMissBuilder().setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.miss.WriteActionsMissBuilder().setAction(readActions(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTAPPLYACTIONS:
propBuilder.setTableFeaturePropType(new ApplyActionsBuilder().setApplyActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.ApplyActionsBuilder().setAction(readActions(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTAPPLYACTIONSMISS:
propBuilder.setTableFeaturePropType(new ApplyActionsMissBuilder().setApplyActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.actions.miss.ApplyActionsMissBuilder().setAction(readActions(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTMATCH:
propBuilder.setTableFeaturePropType(new MatchBuilder().setMatchSetfield(new MatchSetfieldBuilder().setSetFieldMatch(readMatchFields(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTWILDCARDS:
propBuilder.setTableFeaturePropType(new WildcardsBuilder().setWildcardSetfield(new WildcardSetfieldBuilder().setSetFieldMatch(readMatchFields(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTWRITESETFIELD:
propBuilder.setTableFeaturePropType(new WriteSetfieldBuilder().setWriteSetfield(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder().setSetFieldMatch(readMatchFields(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTWRITESETFIELDMISS:
propBuilder.setTableFeaturePropType(new WriteSetfieldMissBuilder().setWriteSetfieldMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder().setSetFieldMatch(readMatchFields(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTAPPLYSETFIELD:
propBuilder.setTableFeaturePropType(new ApplySetfieldBuilder().setApplySetfield(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder().setSetFieldMatch(readMatchFields(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTAPPLYSETFIELDMISS:
propBuilder.setTableFeaturePropType(new ApplySetfieldMissBuilder().setApplySetfieldMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder().setSetFieldMatch(readMatchFields(message, commonPropertyLength)).build()).build());
break;
case OFPTFPTEXPERIMENTER:
case OFPTFPTEXPERIMENTERMISS:
final long expId = message.readUnsignedInt();
message.readerIndex(propStartIndex);
final OFDeserializer<TableFeatureProperties> propDeserializer = registry.getDeserializer(ExperimenterDeserializerKeyFactory.createMultipartReplyTFDeserializerKey(EncodeConstants.OF13_VERSION_ID, expId));
// TODO: Finish experimenter table features (currently using OFJava deserialization only to skip
// bytes)
propDeserializer.deserialize(message);
LOG.debug("Table feature property type {} is not handled yet.", propType);
break;
default:
}
if (paddingRemainder != 0) {
message.skipBytes(EncodeConstants.PADDING - paddingRemainder);
tableFeaturesLength -= EncodeConstants.PADDING - paddingRemainder;
}
items.add(propBuilder.build());
order++;
}
return new TablePropertiesBuilder().setTableFeatureProperties(items).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfieldBuilder in project openflowplugin by opendaylight.
the class MatchFieldSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final Match property = new MatchBuilder().setMatchSetfield(new MatchSetfieldBuilder().setSetFieldMatch(ImmutableList.<SetFieldMatch>builder().add(new SetFieldMatchBuilder().setMatchType(ArpOp.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(ArpSha.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(ArpSpa.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(ArpTha.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(ArpTpa.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(EthDst.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(EthSrc.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(EthType.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Icmpv4Code.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Icmpv4Type.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Icmpv6Code.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Icmpv6Type.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(InPhyPort.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(InPort.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(IpDscp.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(IpEcn.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(IpProto.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Ipv4Dst.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Ipv4Src.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Ipv6Dst.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Ipv6Exthdr.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Ipv6Flabel.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Ipv6NdSll.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Ipv6NdTarget.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Ipv6NdTll.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Ipv6Src.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(Metadata.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(MplsBos.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(MplsLabel.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(MplsTc.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(PbbIsid.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(SctpDst.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(SctpSrc.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(TcpDst.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(TcpFlags.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(TcpSrc.class).setHasMask(true).build()).add(new SetFieldMatchBuilder().setMatchType(TunnelId.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(UdpDst.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(UdpSrc.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(VlanPcp.class).setHasMask(false).build()).add(new SetFieldMatchBuilder().setMatchType(VlanVid.class).setHasMask(false).build()).build()).build()).build();
assertProperty(property, out -> {
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_SHA << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_SPA << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_THA << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_TPA << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ETH_DST << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ETH_SRC << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ETH_TYPE << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ICMPV4_CODE << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ICMPV4_TYPE << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ICMPV6_CODE << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ICMPV6_TYPE << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IN_PHY_PORT << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IN_PORT << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IP_DSCP << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IP_ECN << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IP_PROTO << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV4_DST << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV4_SRC << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_DST << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_EXTHDR << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_FLABEL << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_ND_SLL << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_ND_TARGET << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_ND_TLL << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.IPV6_SRC << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.METADATA << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.MPLS_BOS << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.MPLS_LABEL << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.MPLS_TC << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.PBB_ISID << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.SCTP_DST << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.SCTP_SRC << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.TCP_DST << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.EXPERIMENTER_CLASS);
assertEquals(out.readUnsignedByte(), EncodeConstants.ONFOXM_ET_TCP_FLAGS << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte() >>> 1, OxmMatchConstants.TCP_SRC);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.TUNNEL_ID << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.UDP_DST << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.UDP_SRC << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.VLAN_PCP << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.VLAN_VID << 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfieldBuilder in project openflowplugin by opendaylight.
the class MatchTablePropertySerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final Match property = new MatchBuilder().setMatchSetfield(new MatchSetfieldBuilder().setSetFieldMatch(ImmutableList.<SetFieldMatch>builder().add(new SetFieldMatchBuilder().setMatchType(ArpOp.class).setHasMask(false).build()).build()).build()).build();
assertProperty(property, out -> {
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
// Skip match entry length
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
});
}
Aggregations