use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField in project openflowplugin by opendaylight.
the class AbstractOxmMatchEntryDeserializer method processHeader.
/**
* Prepares match entry header - sets oxm_class, oxm_field, hasMask
* + sets the buffer.readerIndex() to the end of match entry
* - where augmentation starts.
*
* @param oxmClass oxm class type
* @param oxmField oxm field type
* @param input input bytebuf
* @return MatchEntriesBuilder which can be filled with MatchEntry augmentation
*/
protected MatchEntryBuilder processHeader(Class<? extends OxmClassBase> oxmClass, Class<? extends MatchField> oxmField, ByteBuf input) {
MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(oxmClass);
// skip oxm_class (provided)
input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
builder.setOxmMatchField(oxmField);
boolean hasMask = (input.readUnsignedByte() & 1) != 0;
builder.setHasMask(hasMask);
// skip match entry length - not needed
input.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
return builder;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField in project openflowplugin by opendaylight.
the class PacketReceivedTranslatorTest method prepareHeader.
private static MatchEntryBuilder prepareHeader(Class<? extends MatchField> oxmMatchField, boolean hasMask) {
MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setOxmMatchField(oxmMatchField);
builder.setHasMask(hasMask);
return builder;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField in project openflowplugin by opendaylight.
the class TableFeaturesConvertor method setSetFieldTableFeatureProperty.
private static void setSetFieldTableFeatureProperty(final TableFeaturePropertiesBuilder builder, final TableFeaturesPropType type, final List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFields) {
List<MatchEntry> matchEntriesList = new ArrayList<>();
for (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch currMatch : setFields) {
Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField> currMatchType = currMatch.getMatchType();
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField> ofTableFeatureClass = SAL_TO_OF_TABLE_FEATURES.get(currMatchType);
setMatchEntry(matchEntryBuilder, ofTableFeatureClass, currMatch.isHasMask());
matchEntriesList.add(matchEntryBuilder.build());
}
OxmRelatedTableFeaturePropertyBuilder propBuilder = new OxmRelatedTableFeaturePropertyBuilder();
propBuilder.setMatchEntry(matchEntriesList);
builder.setType(type);
builder.addAugmentation(OxmRelatedTableFeatureProperty.class, propBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField in project openflowplugin by opendaylight.
the class MatchExtensionHelper method processExtension.
/**
* Processes an extension.
*
* @param ofVersion openflow version
* @param matchPath match path
* @param matchEntry match entry
* @return an ExtensionListBuilder
*/
private static ExtensionListBuilder processExtension(MatchEntry matchEntry, short ofVersion, MatchPath matchPath) {
ExtensionListBuilder extListBld = null;
// TODO: EXTENSION PROPOSAL (match, OFJava to MD-SAL)
MatchEntrySerializerKey<? extends OxmClassBase, ? extends MatchField> key = new MatchEntrySerializerKey<>(ofVersion, matchEntry.getOxmClass(), matchEntry.getOxmMatchField());
if (null != OFSessionUtil.getExtensionConvertorProvider()) {
ConvertorFromOFJava<MatchEntry, MatchPath> convertor = OFSessionUtil.getExtensionConvertorProvider().getConverter(key);
if (convertor != null) {
ExtensionAugment<? extends Augmentation<Extension>> extensionMatch = convertor.convert(matchEntry, matchPath);
ExtensionBuilder extBld = new ExtensionBuilder();
extBld.addAugmentation(extensionMatch.getAugmentationClass(), extensionMatch.getAugmentationObject());
extListBld = new ExtensionListBuilder();
extListBld.setExtension(extBld.build());
extListBld.setExtensionKey(extensionMatch.getKey());
}
}
return extListBld;
}
Aggregations