Search in sources :

Example 1 with TablesMissBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.miss.TablesMissBuilder in project openflowplugin by opendaylight.

the class OpenflowpluginTableFeaturesTestCommandProvider method createNextTableMissTblFeatureProp.

private TableFeaturePropertiesBuilder createNextTableMissTblFeatureProp() {
    TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
    List<Short> nextTblMissIds = Arrays.asList(new Short[] { 23, 24, 25, 27, 28, 29, 30 });
    NextTableMissBuilder nextTblMissBld = new NextTableMissBuilder();
    nextTblMissBld.setTablesMiss(new TablesMissBuilder().setTableIds(nextTblMissIds).build());
    tableFeatureProperty.setTableFeaturePropType(nextTblMissBld.build());
    TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
    tableFeatureProperty.setKey(keyValue);
    tableFeatureProperty.setOrder(1);
    return tableFeatureProperty;
}
Also used : TablesMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.miss.TablesMissBuilder) TableFeaturePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder) NextTableMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMissBuilder) TableFeaturePropertiesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesKey)

Example 2 with TablesMissBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.miss.TablesMissBuilder 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();
}
Also used : ApplyActionsMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder) ApplySetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldBuilder) TableFeatureProperties(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties) ArrayList(java.util.ArrayList) TableFeaturePropertiesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesKey) InstructionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder) 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) WildcardsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WildcardsBuilder) ApplyActionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder) WriteActionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsBuilder) ApplySetfieldMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMissBuilder) TablesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.TablesBuilder) WriteSetfieldMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMissBuilder) NextTableBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableBuilder) TableFeaturesPropType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType) TablesMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.miss.TablesMissBuilder) WildcardSetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.wildcards.WildcardSetfieldBuilder) InstructionsMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMissBuilder) NextTableMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMissBuilder) WriteActionsMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder) WriteSetfieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldBuilder) TablePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.TablePropertiesBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder)

Example 3 with TablesMissBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.miss.TablesMissBuilder in project openflowplugin by opendaylight.

the class NextTableMissTablePropertySerializerTest method testSerialize.

@Test
public void testSerialize() throws Exception {
    final short tableId = 42;
    final NextTableMiss property = new NextTableMissBuilder().setTablesMiss(new TablesMissBuilder().setTableIds(Collections.singletonList(tableId)).build()).build();
    assertProperty(property, out -> assertEquals(out.readUnsignedByte(), tableId));
}
Also used : TablesMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.miss.TablesMissBuilder) NextTableMiss(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMiss) NextTableMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMissBuilder) Test(org.junit.Test)

Aggregations

NextTableMissBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMissBuilder)3 TablesMissBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.next.table.miss.TablesMissBuilder)3 TableFeaturePropertiesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder)2 TableFeaturePropertiesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesKey)2 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 TableFeaturesPropType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType)1 ApplyActionsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder)1 ApplyActionsMissBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder)1 ApplySetfieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldBuilder)1 ApplySetfieldMissBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMissBuilder)1 InstructionsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder)1 InstructionsMissBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMissBuilder)1 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.MatchBuilder)1 NextTableBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableBuilder)1 NextTableMiss (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMiss)1 WildcardsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WildcardsBuilder)1 WriteActionsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsBuilder)1 WriteActionsMissBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder)1 WriteSetfieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldBuilder)1