Class AbstractMatchEntrySerializer<E,​M>

    • 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​(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 interface MatchEntrySerializer
        Parameters:
        match - Openflow match
        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​(@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 prefix
        outBuffer - 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 prefix
        outBuffer - 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
      • 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 serialize
        mask - mask as extracted from entry
        outBuffer - output buffer