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;
}
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();
}
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));
}
Aggregations