use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTableFeaturesTestCommandProvider method createWildCardsTblFeatureProp.
private TableFeaturePropertiesBuilder createWildCardsTblFeatureProp() {
// t15
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(ArpOp.class);
SetFieldMatchBuilder setFieldMatchBld2 = new SetFieldMatchBuilder();
setFieldMatchBld2.setHasMask(true);
setFieldMatchBld2.setMatchType(InPort.class);
List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
WildcardsBuilder wildCardsBld = new WildcardsBuilder();
WildcardSetfieldBuilder wildcardsBuilder = new WildcardSetfieldBuilder();
wildcardsBuilder.setSetFieldMatch(setFieldMatch);
wildCardsBld.setWildcardSetfield(wildcardsBuilder.build());
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(wildCardsBld.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.set.field.match.SetFieldMatchBuilder 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.set.field.match.SetFieldMatchBuilder in project openflowplugin by opendaylight.
the class WriteSetfieldMissTablePropertySerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final WriteSetfieldMiss property = 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(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);
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder 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.set.field.match.SetFieldMatchBuilder 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