Search in sources :

Example 16 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 ApplySetfieldMissTablePropertySerializerTest method testSerialize.

@Test
public void testSerialize() throws Exception {
    final ApplySetfieldMiss property = 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(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) ApplySetfieldMiss(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMiss) SetFieldMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch) ApplySetfieldMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMissBuilder) Test(org.junit.Test)

Example 17 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 createApplySetFieldTblFeatureProp.

private TableFeaturePropertiesBuilder createApplySetFieldTblFeatureProp() {
    // t13
    SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
    setFieldMatchBld1.setHasMask(false);
    setFieldMatchBld1.setMatchType(ArpOp.class);
    SetFieldMatchBuilder setFieldMatchBld2 = new SetFieldMatchBuilder();
    setFieldMatchBld2.setHasMask(true);
    setFieldMatchBld2.setMatchType(InPort.class);
    SetFieldMatchBuilder setFieldMatchBld3 = new SetFieldMatchBuilder();
    setFieldMatchBld3.setHasMask(true);
    setFieldMatchBld3.setMatchType(Ipv4Dst.class);
    List<SetFieldMatch> setFieldMatch = new ArrayList<>();
    setFieldMatch.add(setFieldMatchBld1.build());
    setFieldMatch.add(setFieldMatchBld2.build());
    setFieldMatch.add(setFieldMatchBld3.build());
    ApplySetfieldBuilder applySetfieldBld = new ApplySetfieldBuilder();
    org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder applySetfieldBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder();
    applySetfieldBuilder.setSetFieldMatch(setFieldMatch);
    applySetfieldBld.setApplySetfield(applySetfieldBuilder.build());
    TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
    tableFeatureProperty.setTableFeaturePropType(applySetfieldBld.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) ApplySetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldBuilder) 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) TableFeaturePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder)

Example 18 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 createWriteSetFieldTblFeatureProp.

private TableFeaturePropertiesBuilder createWriteSetFieldTblFeatureProp() {
    // t11
    SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
    setFieldMatchBld1.setHasMask(false);
    setFieldMatchBld1.setMatchType(MplsLabel.class);
    SetFieldMatchBuilder setFieldMatchBld2 = new SetFieldMatchBuilder();
    setFieldMatchBld2.setHasMask(true);
    setFieldMatchBld2.setMatchType(MplsBos.class);
    SetFieldMatchBuilder setFieldMatchBld3 = new SetFieldMatchBuilder();
    setFieldMatchBld3.setHasMask(true);
    setFieldMatchBld3.setMatchType(EthDst.class);
    List<SetFieldMatch> setFieldMatch = new ArrayList<>();
    setFieldMatch.add(setFieldMatchBld1.build());
    setFieldMatch.add(setFieldMatchBld2.build());
    setFieldMatch.add(setFieldMatchBld3.build());
    WriteSetfieldBuilder writeSetfieldBld = new WriteSetfieldBuilder();
    org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder writeSetfieldBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder();
    writeSetfieldBuilder.setSetFieldMatch(setFieldMatch);
    writeSetfieldBld.setWriteSetfield(writeSetfieldBuilder.build());
    TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
    tableFeatureProperty.setTableFeaturePropType(writeSetfieldBld.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) 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) TableFeaturePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder) WriteSetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldBuilder)

Example 19 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 createWriteSetFieldMissTblFeatureProp.

private TableFeaturePropertiesBuilder createWriteSetFieldMissTblFeatureProp() {
    // t12
    SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
    setFieldMatchBld1.setHasMask(false);
    setFieldMatchBld1.setMatchType(EthSrc.class);
    SetFieldMatchBuilder setFieldMatchBld2 = new SetFieldMatchBuilder();
    setFieldMatchBld2.setHasMask(true);
    setFieldMatchBld2.setMatchType(InPort.class);
    SetFieldMatchBuilder setFieldMatchBld3 = new SetFieldMatchBuilder();
    setFieldMatchBld3.setHasMask(true);
    setFieldMatchBld3.setMatchType(Ipv4Dst.class);
    List<SetFieldMatch> setFieldMatch = new ArrayList<>();
    setFieldMatch.add(setFieldMatchBld1.build());
    setFieldMatch.add(setFieldMatchBld2.build());
    setFieldMatch.add(setFieldMatchBld3.build());
    WriteSetfieldMissBuilder writeSetfieldBld = new WriteSetfieldMissBuilder();
    org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder writeSetfieldMissBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder();
    writeSetfieldMissBuilder.setSetFieldMatch(setFieldMatch);
    writeSetfieldBld.setWriteSetfieldMiss(writeSetfieldMissBuilder.build());
    TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
    tableFeatureProperty.setTableFeaturePropType(writeSetfieldBld.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) 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) WriteSetfieldMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMissBuilder) TableFeaturePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder)

Example 20 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 createApplySetFieldMissTblFeatureProp.

private TableFeaturePropertiesBuilder createApplySetFieldMissTblFeatureProp() {
    // t14
    SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
    setFieldMatchBld1.setHasMask(false);
    setFieldMatchBld1.setMatchType(ArpOp.class);
    SetFieldMatchBuilder setFieldMatchBld2 = new SetFieldMatchBuilder();
    setFieldMatchBld2.setHasMask(true);
    setFieldMatchBld2.setMatchType(InPort.class);
    SetFieldMatchBuilder setFieldMatchBld3 = new SetFieldMatchBuilder();
    setFieldMatchBld3.setHasMask(true);
    setFieldMatchBld3.setMatchType(Ipv4Dst.class);
    List<SetFieldMatch> setFieldMatch = new ArrayList<>();
    setFieldMatch.add(setFieldMatchBld1.build());
    setFieldMatch.add(setFieldMatchBld2.build());
    setFieldMatch.add(setFieldMatchBld3.build());
    ApplySetfieldMissBuilder applySetfieldMissBld = new ApplySetfieldMissBuilder();
    org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder applySetfieldMissBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder();
    applySetfieldMissBuilder.setSetFieldMatch(setFieldMatch);
    applySetfieldMissBld.setApplySetfieldMiss(applySetfieldMissBuilder.build());
    TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
    tableFeatureProperty.setTableFeaturePropType(applySetfieldMissBld.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) 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) ApplySetfieldMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMissBuilder) TableFeaturePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder)

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