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 implementingMatchEntrySerializer
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractMatchEntrySerializer.ConstantHeaderWriter<E,M>
UtilityAbstractMatchEntrySerializer.HeaderWriter
optimized for cases where the header does not depend on the actual entry content beyond presence/absence of a mask.protected static class
AbstractMatchEntrySerializer.HeaderWriter<E,M>
Base class supporting writing out a particular match entry's header.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMatchEntrySerializer(int oxmClassCode, int oxmFieldCode, int valueLength)
protected
AbstractMatchEntrySerializer(AbstractMatchEntrySerializer.HeaderWriter<E,M> headerWriter)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract @Nullable E
extractEntry(Match match)
Extract the corresponding entry from a match.protected abstract @Nullable M
extractEntryMask(@NonNull E entry)
Extract the mask contained in an entry.protected abstract void
serializeEntry(@NonNull E entry, @Nullable M mask, @NonNull io.netty.buffer.ByteBuf outBuffer)
Extract the corresponding entry from a match.void
serializeIfPresent(Match match, io.netty.buffer.ByteBuf outBuffer)
Serialize this match entry if it is present in the match.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.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).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.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).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.protected static void
writeMask(byte[] mask, io.netty.buffer.ByteBuf outBuffer, int length)
Serialize byte mask to bytes.
-
-
-
Constructor Detail
-
AbstractMatchEntrySerializer
protected AbstractMatchEntrySerializer(AbstractMatchEntrySerializer.HeaderWriter<E,M> headerWriter)
-
AbstractMatchEntrySerializer
protected AbstractMatchEntrySerializer(int oxmClassCode, int oxmFieldCode, int valueLength)
-
-
Method Detail
-
serializeIfPresent
public final void serializeIfPresent(Match match, io.netty.buffer.ByteBuf outBuffer)
Description copied from interface:MatchEntrySerializer
Serialize this match entry if it is present in the match.- Specified by:
serializeIfPresent
in 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
protected abstract @Nullable E extractEntry(Match match)
Extract the corresponding entry from a match.- Parameters:
match
- Openflow match- Returns:
- Entry, null if not present
-
extractEntryMask
protected abstract @Nullable M extractEntryMask(@NonNull E entry)
Extract the mask contained in an entry.- Parameters:
entry
- entry to examine- Returns:
- Mask, null if not present
-
-