Class AbstractMatchEntrySerializer
- java.lang.Object
-
- org.opendaylight.openflowplugin.impl.protocol.serialization.match.AbstractMatchEntrySerializer
-
- All Implemented Interfaces:
HeaderSerializer<Match>
,OFGeneralSerializer
,OFSerializer<Match>
,MatchEntrySerializer
- Direct Known Subclasses:
AbstractExperimenterMatchEntrySerializer
,ArpOpEntrySerializer
,ArpSourceHardwareAddressEntrySerializer
,ArpSourceTransportAddressEntrySerializer
,ArpTargetHardwareAddressEntrySerializer
,ArpTargetTransportAddressEntrySerializer
,EthernetDestinationEntrySerializer
,EthernetSourceEntrySerializer
,EthernetTypeEntrySerializer
,Icmpv4CodeEntrySerializer
,Icmpv4TypeEntrySerializer
,Icmpv6CodeEntrySerializer
,Icmpv6TypeEntrySerializer
,InPhyPortEntrySerializer
,InPortEntrySerializer
,IpDscpEntrySerializer
,IpEcnEntrySerializer
,IpProtoEntrySerializer
,Ipv4DestinationEntrySerializer
,Ipv4SourceEntrySerializer
,Ipv6DestinationEntrySerializer
,Ipv6ExtHeaderEntrySerializer
,Ipv6LabelEntrySerializer
,Ipv6NdSllEntrySerializer
,Ipv6NdTargetEntrySerializer
,Ipv6NdTllEntrySerializer
,Ipv6SourceEntrySerializer
,MetadataEntrySerializer
,MplsBosEntrySerializer
,MplsLabelEntrySerializer
,MplsTcEntrySerializer
,PacketTypeEntrySerializer
,PbbEntrySerializer
,SctpDestinationPortEntrySerializer
,SctpSourcePortEntrySerializer
,TcpDestinationPortEntrySerializer
,TcpSourcePortEntrySerializer
,TunnelIdEntrySerializer
,TunnelIpv4DestinationEntrySerializer
,TunnelIpv4SourceEntrySerializer
,UdpDestinationPortEntrySerializer
,UdpSourcePortEntrySerializer
,VlanPcpEntrySerializer
,VlanVidEntrySerializer
public abstract class AbstractMatchEntrySerializer extends Object implements HeaderSerializer<Match>, MatchEntrySerializer
-
-
Constructor Summary
Constructors Constructor Description AbstractMatchEntrySerializer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
getHasMask(Match match)
Has mask getter.protected abstract int
getOxmClassCode()
Oxm class code.protected abstract int
getOxmFieldCode()
Oxm field numeric representation.protected abstract int
getValueLength()
Get value length.void
serialize(Match match, io.netty.buffer.ByteBuf outBuffer)
Transforms POJO/DTO into byte message (ByteBuf).void
serializeHeader(Match match, io.netty.buffer.ByteBuf outBuffer)
Serializes object headers (e.g.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(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix prefix, 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(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix prefix, 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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.protocol.serialization.MatchEntrySerializer
matchTypeCheck
-
-
-
-
Method Detail
-
serialize
public void serialize(Match match, io.netty.buffer.ByteBuf outBuffer)
Description copied from interface:OFSerializer
Transforms POJO/DTO into byte message (ByteBuf).- Specified by:
serialize
in interfaceOFSerializer<Match>
- Parameters:
match
- object to be serializedoutBuffer
- output buffer
-
serializeHeader
public void serializeHeader(Match match, io.netty.buffer.ByteBuf outBuffer)
Description copied from interface:HeaderSerializer
Serializes object headers (e.g. for Multipart message - Table Features).- Specified by:
serializeHeader
in interfaceHeaderSerializer<Match>
- Parameters:
match
- object whose headers should be serializedoutBuffer
- 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(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix prefix, io.netty.buffer.ByteBuf outBuffer)
Serialize Ipv4 prefix (address and mask).- Parameters:
prefix
- Ipv4 prefixoutBuffer
- output buffer
-
writeIpv6Prefix
protected static void writeIpv6Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix prefix, io.netty.buffer.ByteBuf outBuffer)
Serialize Ipv6 prefix (address and mask).- Parameters:
prefix
- Ipv6 prefixoutBuffer
- output buffer
-
getHasMask
protected abstract boolean getHasMask(Match match)
Has mask getter.- Parameters:
match
- Openflow match- Returns:
- if field has or has not mask
-
getOxmFieldCode
protected abstract int getOxmFieldCode()
Oxm field numeric representation.- Returns:
- numeric representation of oxm_field
-
getOxmClassCode
protected abstract int getOxmClassCode()
Oxm class code.- Returns:
- numeric representation of oxm_class
-
getValueLength
protected abstract int getValueLength()
Get value length.- Returns:
- match entry value length (without mask length)
-
-