Search in sources :

Example 1 with SetFieldMatchBuilder

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;
}
Also used : SetFieldMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder) TableFeaturePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder) ArrayList(java.util.ArrayList) TableFeaturePropertiesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesKey) WildcardSetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.wildcards.WildcardSetfieldBuilder) WildcardsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WildcardsBuilder) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch)

Example 2 with SetFieldMatchBuilder

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;
}
Also used : SetFieldMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder) MatchSetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfieldBuilder) TableFeaturePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder) ArrayList(java.util.ArrayList) TableFeaturePropertiesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesKey) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder) SetFieldMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder)

Example 3 with SetFieldMatchBuilder

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);
    });
}
Also used : WriteSetfieldMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMissBuilder) SetFieldMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder) WriteSetfieldMiss(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMiss) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch) Test(org.junit.Test)

Example 4 with SetFieldMatchBuilder

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);
    });
}
Also used : Ipv6Src(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Src) ArpSha(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSha) Icmpv6Type(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Type) ArpTha(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTha) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match) MatchSetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfieldBuilder) SctpDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpDst) Icmpv4Type(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type) MplsBos(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsBos) MplsTc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsTc) EthDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthDst) Ipv4Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Dst) TcpSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpSrc) SetFieldMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder) Ipv6Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Dst) Ipv6NdTarget(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTarget) InPort(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPort) UdpDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpDst) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch) IpEcn(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpEcn) EthType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType) VlanPcp(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanPcp) Ipv6Flabel(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Flabel) TcpDst(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpDst) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder) SetFieldMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder) AbstractTablePropertySerializerTest(org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.AbstractTablePropertySerializerTest) Test(org.junit.Test)

Example 5 with SetFieldMatchBuilder

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);
    });
}
Also used : SetFieldMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder) MatchSetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfieldBuilder) SetFieldMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match) Test(org.junit.Test)

Aggregations

SetFieldMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder)16 SetFieldMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch)14 ArrayList (java.util.ArrayList)7 Test (org.junit.Test)7 TableFeaturePropertiesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder)6 TableFeaturePropertiesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesKey)6 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder)3 MatchSetfieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfieldBuilder)3 ApplySetfieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldBuilder)2 ApplySetfieldMissBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMissBuilder)2 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match)2 WildcardsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WildcardsBuilder)2 WriteSetfieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldBuilder)2 WriteSetfieldMissBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMissBuilder)2 WildcardSetfieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.wildcards.WildcardSetfieldBuilder)2 AbstractTablePropertySerializerTest (org.opendaylight.openflowplugin.impl.protocol.serialization.multipart.tablefeatures.AbstractTablePropertySerializerTest)1 OxmRelatedTableFeatureProperty (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.OxmRelatedTableFeatureProperty)1 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)1 ArpSha (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSha)1 ArpTha (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTha)1