Search in sources :

Example 1 with SetFieldMatch

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch 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 SetFieldMatch

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch 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 SetFieldMatch

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch in project openflowplugin by opendaylight.

the class TableFeaturesMatchFieldDeserializerTest method deserialize.

@Test
public void deserialize() throws Exception {
    ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_OP);
    Optional<SetFieldMatch> fieldMatch = deserializer.deserialize(buffer);
    assertEquals(ArpOp.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_SHA);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(ArpSha.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_SPA);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(ArpSpa.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_THA);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(ArpTha.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_TPA);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(ArpTpa.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ETH_DST);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(EthDst.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ETH_SRC);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(EthSrc.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV4_CODE);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Icmpv4Code.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV4_TYPE);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Icmpv4Type.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV6_CODE);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Icmpv6Code.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV6_TYPE);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Icmpv6Type.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IN_PHY_PORT);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(InPhyPort.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IN_PORT);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(InPort.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_DSCP);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(IpDscp.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_ECN);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(IpEcn.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_PROTO);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(IpProto.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV4_SRC);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Ipv4Src.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV4_DST);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Ipv4Dst.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_SRC);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Ipv6Src.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_DST);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Ipv6Dst.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_EXTHDR);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Ipv6Exthdr.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_FLABEL);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Ipv6Flabel.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_ND_SLL);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Ipv6NdSll.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_ND_TLL);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Ipv6NdTll.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_ND_TARGET);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Ipv6NdTarget.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.METADATA);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(Metadata.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_BOS);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(MplsBos.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_LABEL);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(MplsLabel.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_TC);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(MplsTc.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.PBB_ISID);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(PbbIsid.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.SCTP_SRC);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(SctpSrc.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.SCTP_DST);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(SctpDst.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TCP_SRC);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(TcpSrc.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TCP_DST);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(TcpDst.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TUNNEL_ID);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(TunnelId.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.UDP_SRC);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(UdpSrc.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.UDP_DST);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(UdpDst.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.VLAN_PCP);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(VlanPcp.class, fieldMatch.get().getKey().getMatchType());
    addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.VLAN_VID);
    fieldMatch = deserializer.deserialize(buffer);
    assertEquals(VlanVid.class, fieldMatch.get().getKey().getMatchType());
    assertEquals(0, buffer.readableBytes());
}
Also used : ByteBuf(io.netty.buffer.ByteBuf) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch) Test(org.junit.Test)

Example 4 with SetFieldMatch

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch in project openflowplugin by opendaylight.

the class TableFeaturesConvertor method setTableFeatureProperty.

private static void setTableFeatureProperty(final Match propType, final TableFeaturePropertiesBuilder propBuilder) {
    MatchSetfield matchSetField = propType.getMatchSetfield();
    List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
    if (null != matchSetField) {
        setFieldMatch = matchSetField.getSetFieldMatch();
    }
    setSetFieldTableFeatureProperty(propBuilder, TableFeaturesPropType.OFPTFPTMATCH, setFieldMatch == null ? new ArrayList<>() : setFieldMatch);
}
Also used : MatchSetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfield) WriteSetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfield) ApplySetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfield) WildcardSetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.wildcards.WildcardSetfield) MatchSetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfield) ArrayList(java.util.ArrayList)

Example 5 with SetFieldMatch

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch in project openflowplugin by opendaylight.

the class TableFeaturesConvertor method setTableFeatureProperty.

private static void setTableFeatureProperty(final Wildcards propType, final TableFeaturePropertiesBuilder propBuilder) {
    List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
    WildcardSetfield wildcardSetField = propType.getWildcardSetfield();
    if (null != wildcardSetField) {
        setFieldMatch = wildcardSetField.getSetFieldMatch();
    }
    setSetFieldTableFeatureProperty(propBuilder, TableFeaturesPropType.OFPTFPTWILDCARDS, setFieldMatch == null ? new ArrayList<>() : setFieldMatch);
}
Also used : WildcardSetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.wildcards.WildcardSetfield) MatchSetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.match.MatchSetfield) WriteSetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfield) ApplySetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfield) WildcardSetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.wildcards.WildcardSetfield) ArrayList(java.util.ArrayList)

Aggregations

SetFieldMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch)17 SetFieldMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder)14 ArrayList (java.util.ArrayList)10 Test (org.junit.Test)9 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 ApplySetfield (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfield)4 WriteSetfield (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfield)4 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match)3 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 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)2 ArpSha (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSha)2 ArpTha (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTha)2 EthDst (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthDst)2 EthType (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType)2 Icmpv4Type (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type)2 Icmpv6Type (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Type)2 InPort (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPort)2 IpEcn (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpEcn)2