Class 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.
    • Constructor Detail

      • AbstractMatchEntrySerializer

        public AbstractMatchEntrySerializer()
    • 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 interface OFSerializer<Match>
        Parameters:
        match - object to be serialized
        outBuffer - 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 interface HeaderSerializer<Match>
        Parameters:
        match - object whose headers should be serialized
        outBuffer - 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 mask
        outBuffer - output buffer
        length - 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 address
        outBuffer - 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 address
        outBuffer - 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 address
        outBuffer - 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 prefix
        outBuffer - 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 prefix
        outBuffer - 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)