Class AbstractMatchEntrySerializer<E,M>
java.lang.Object
org.opendaylight.openflowplugin.impl.protocol.serialization.match.AbstractMatchEntrySerializer<E,M>
- Type Parameters:
E- Match entry typeM- Match entry mask type, use Void a mask is not applicable
- All Implemented Interfaces:
MatchEntrySerializer
- Direct Known Subclasses:
AbstractExperimenterMatchEntrySerializer,AbstractIpv4PrefixEntrySerializer,AbstractMacAddressFilterEntrySerializer,AbstractPortNumberWithMaskEntrySerilizer,AbstractPrimitiveEntrySerializer,Ipv4DestinationEntrySerializer,Ipv4SourceEntrySerializer,Ipv6DestinationEntrySerializer,Ipv6ExtHeaderEntrySerializer,Ipv6LabelEntrySerializer,Ipv6SourceEntrySerializer,MetadataEntrySerializer,PbbEntrySerializer,TunnelIdEntrySerializer,VlanVidEntrySerializer
public abstract class AbstractMatchEntrySerializer<E,M>
extends Object
implements MatchEntrySerializer
Abstract base class for conveniently implementing
MatchEntrySerializer.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classUtilityAbstractMatchEntrySerializer.HeaderWriteroptimized for cases where the header does not depend on the actual entry content beyond presence/absence of a mask.protected static classBase class supporting writing out a particular match entry's header. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMatchEntrySerializer(int oxmClassCode, int oxmFieldCode, int valueLength) protectedAbstractMatchEntrySerializer(AbstractMatchEntrySerializer.HeaderWriter<E, M> headerWriter) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @Nullable EextractEntry(Match match) Extract the corresponding entry from a match.protected abstract @Nullable MextractEntryMask(@NonNull E entry) Extract the mask contained in an entry.protected abstract voidserializeEntry(@NonNull E entry, @Nullable M mask, @NonNull io.netty.buffer.ByteBuf outBuffer) Extract the corresponding entry from a match.final voidserializeIfPresent(Match match, io.netty.buffer.ByteBuf outBuffer) Serialize this match entry if it is present in the match.protected static voidwriteIpv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address address, io.netty.buffer.ByteBuf outBuffer) Serialize Ipv4 address to bytes.protected static voidwriteIpv4Prefix(@NonNull org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix prefix, @Nullable Integer mask, @NonNull io.netty.buffer.ByteBuf outBuffer) Serialize Ipv4 prefix (address and mask).protected static voidwriteIpv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address address, io.netty.buffer.ByteBuf outBuffer) Serialize Ipv6 address to bytes.protected static voidwriteIpv6Prefix(@NonNull org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix prefix, @Nullable Integer mask, @NonNull io.netty.buffer.ByteBuf outBuffer) Serialize Ipv6 prefix (address and mask).protected static voidwriteMacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress address, io.netty.buffer.ByteBuf outBuffer) Serialize Mac address to bytes.protected static voidwriteMask(byte[] mask, io.netty.buffer.ByteBuf outBuffer, int length) Serialize byte mask to bytes.
-
Constructor Details
-
AbstractMatchEntrySerializer
-
AbstractMatchEntrySerializer
protected AbstractMatchEntrySerializer(int oxmClassCode, int oxmFieldCode, int valueLength)
-
-
Method Details
-
serializeIfPresent
Description copied from interface:MatchEntrySerializerSerialize this match entry if it is present in the match.- Specified by:
serializeIfPresentin interfaceMatchEntrySerializer- Parameters:
match- Openflow matchoutBuffer- output buffer
-
writeMask
protected static void writeMask(byte[] mask, io.netty.buffer.ByteBuf outBuffer, int length) Serialize byte mask to bytes. checking for mask length.- Parameters:
mask- byte maskoutBuffer- output bufferlength- mask length
-
writeIpv4Address
protected static void writeIpv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address address, io.netty.buffer.ByteBuf outBuffer) Serialize Ipv4 address to bytes.- Parameters:
address- Ipv4 addressoutBuffer- output buffer
-
writeIpv6Address
protected static void writeIpv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address address, io.netty.buffer.ByteBuf outBuffer) Serialize Ipv6 address to bytes.- Parameters:
address- Ipv6 addressoutBuffer- output buffer
-
writeMacAddress
protected static void writeMacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress address, io.netty.buffer.ByteBuf outBuffer) Serialize Mac address to bytes.- Parameters:
address- Mac addressoutBuffer- output buffer
-
writeIpv4Prefix
protected static void writeIpv4Prefix(@NonNull org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix prefix, @Nullable Integer mask, @NonNull io.netty.buffer.ByteBuf outBuffer) Serialize Ipv4 prefix (address and mask).- Parameters:
prefix- Ipv4 prefixoutBuffer- output buffer
-
writeIpv6Prefix
protected static void writeIpv6Prefix(@NonNull org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix prefix, @Nullable Integer mask, @NonNull io.netty.buffer.ByteBuf outBuffer) Serialize Ipv6 prefix (address and mask).- Parameters:
prefix- Ipv6 prefixoutBuffer- output buffer
-
extractEntry
Extract the corresponding entry from a match.- Parameters:
match- Openflow match- Returns:
- Entry, null if not present
-
extractEntryMask
Extract the mask contained in an entry.- Parameters:
entry- entry to examine- Returns:
- Mask, null if not present
-
serializeEntry
protected abstract void serializeEntry(@NonNull E entry, @Nullable M mask, @NonNull io.netty.buffer.ByteBuf outBuffer) Extract the corresponding entry from a match.- Parameters:
entry- entry to serializemask- mask as extracted from entryoutBuffer- output buffer
-