Search in sources :

Example 26 with MatchEntry

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.

the class OxmMetadataSerializer method serialize.

@Override
public void serialize(MatchEntry entry, ByteBuf outBuffer) {
    super.serialize(entry, outBuffer);
    MetadataCase entryValue = (MetadataCase) entry.getMatchEntryValue();
    outBuffer.writeBytes(entryValue.getMetadata().getMetadata());
    if (entry.isHasMask()) {
        writeMask(entryValue.getMetadata().getMask(), outBuffer, EncodeConstants.SIZE_OF_LONG_IN_BYTES);
    }
}
Also used : MetadataCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCase)

Example 27 with MatchEntry

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.

the class OxmMplsLabelSerializer method serialize.

@Override
public void serialize(MatchEntry entry, ByteBuf outBuffer) {
    super.serialize(entry, outBuffer);
    MplsLabelCase entryValue = (MplsLabelCase) entry.getMatchEntryValue();
    outBuffer.writeInt(entryValue.getMplsLabel().getMplsLabel().intValue());
}
Also used : MplsLabelCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MplsLabelCase)

Example 28 with MatchEntry

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.

the class TypeKeyMakerFactory method createMatchEntriesKeyMaker.

/**
 * Creates a key maker for MatchEntry instances.
 *
 * @param version openflow wire version that shall be used in lookup key
 * @return lookup key
 */
public static TypeKeyMaker<MatchEntry> createMatchEntriesKeyMaker(short version) {
    return new AbstractTypeKeyMaker<MatchEntry>(version) {

        @Override
        public MatchEntrySerializerKey<?, ?> make(MatchEntry entry) {
            MatchEntrySerializerKey<?, ?> key;
            key = new MatchEntrySerializerKey<>(getVersion(), entry.getOxmClass(), entry.getOxmMatchField());
            if (entry.getOxmClass().equals(ExperimenterClass.class)) {
                ExperimenterIdCase entryValue = (ExperimenterIdCase) entry.getMatchEntryValue();
                key.setExperimenterId(entryValue.getExperimenter().getExperimenter().getValue());
                return key;
            }
            key.setExperimenterId(null);
            return key;
        }
    };
}
Also used : ExperimenterIdCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.oxm.container.match.entry.value.ExperimenterIdCase) MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)

Example 29 with MatchEntry

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.

the class OxmPbbIsidSerializer method serialize.

@Override
public void serialize(MatchEntry entry, ByteBuf outBuffer) {
    super.serialize(entry, outBuffer);
    PbbIsidCase entryValue = (PbbIsidCase) entry.getMatchEntryValue();
    outBuffer.writeMedium(entryValue.getPbbIsid().getIsid().intValue());
    if (entry.isHasMask()) {
        writeMask(entryValue.getPbbIsid().getMask(), outBuffer, getValueLength());
    }
}
Also used : PbbIsidCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.PbbIsidCase)

Example 30 with MatchEntry

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.

the class OxmSctpSrcSerializer method serialize.

@Override
public void serialize(MatchEntry entry, ByteBuf outBuffer) {
    super.serialize(entry, outBuffer);
    SctpSrcCase entryValue = (SctpSrcCase) entry.getMatchEntryValue();
    outBuffer.writeShort(entryValue.getSctpSrc().getPort().getValue().intValue());
}
Also used : SctpSrcCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.SctpSrcCase)

Aggregations

MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)207 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)127 Test (org.junit.Test)112 ArrayList (java.util.ArrayList)70 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder)33 CodecPreconditionException (org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)32 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)30 BigInteger (java.math.BigInteger)29 ByteBuf (io.netty.buffer.ByteBuf)26 Extension (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension)26 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)24 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)21 List (java.util.List)20 VersionDatapathIdConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData)20 SetFieldActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder)19 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)19 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)17 SetFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder)16 Ipv6Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)15 IpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder)15