Class AddressNormalizationUtil


  • public final class AddressNormalizationUtil
    extends Object
    Utility class used for converting OpenFlow port numbers, Ipv4 and Ipv6 addresses to normalized format.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @Nullable String normalizeInetAddressWithMask​(@Nullable InetAddress address, @org.eclipse.jdt.annotation.Nullable byte[] mask)
      Convert arbitrary mask to prefix mask and append it to textual representation of Inet address.
      static @Nullable InetAddress normalizeIpAddress​(@org.eclipse.jdt.annotation.Nullable byte[] address, @org.eclipse.jdt.annotation.Nullable byte[] mask)
      Normalize generic IP address and arbitrary mask in byte array format and apply arbitrary mask to IP address.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix normalizeIpv4Address​(@org.eclipse.jdt.annotation.Nullable byte[] address, @org.eclipse.jdt.annotation.Nullable byte[] mask)
      Normalize Ipv4 address and arbitrary mask in byte array format and apply arbitrary mask to Ipv4 address.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix normalizeIpv4Arbitrary​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address ipv4Address, @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DottedQuad ipv4Mask)
      Normalize Ipv4 address and arbitrary mask and apply arbitrary mask to Ipv4 address.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix normalizeIpv4Prefix​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix ipv4Prefix)
      Normalize Ipv4 address with prefix mask (ex.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix normalizeIpv6Address​(@org.eclipse.jdt.annotation.Nullable byte[] address, @org.eclipse.jdt.annotation.Nullable byte[] mask)
      Normalize Ipv6 address and arbitrary mask in byte array format and apply arbitrary mask to Ipv6 address.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address normalizeIpv6AddressWithoutMask​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address)
      Normalize ipv 6 address without mask.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix normalizeIpv6Arbitrary​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address, @Nullable Ipv6ArbitraryMask ipv4Mask)
      Normalize Ipv6 address and arbitrary mask and apply arbitrary mask to Ipv6 address.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix normalizeIpv6Prefix​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix ipv6Prefix)
      Normalize Ipv6 address with prefix mask (ex.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress normalizeMacAddress​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress macAddress)
      Convert MAC address to it's lower case format.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress normalizeMacAddressMask​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress macAddress)
      Convert MAC address mask to it's lower case format and if it is full F mask, return null.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri normalizeProtocolAgnosticPort​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri port, short protocolVersion)
      Extract port number from URI and convert it to OpenFlow specific textual representation.
    • Method Detail

      • normalizeProtocolAgnosticPort

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri normalizeProtocolAgnosticPort​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri port,
                                                                                                                                                     short protocolVersion)
        Extract port number from URI and convert it to OpenFlow specific textual representation.
        Parameters:
        port - the OpenFlow port
        protocolVersion - the OpenFLow protocol version
        Returns:
        normalized uri
      • normalizeIpv6Prefix

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix normalizeIpv6Prefix​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix ipv6Prefix)
        Normalize Ipv6 address with prefix mask (ex. 1234:5678:9ABC::/76) and apply prefix mask to Ipv6 address.
        Parameters:
        ipv6Prefix - the Ipv6 prefix
        Returns:
        normalized Ipv6 prefix
      • normalizeIpv6Arbitrary

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix normalizeIpv6Arbitrary​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address,
                                                                                                                                                     @Nullable Ipv6ArbitraryMask ipv4Mask)
        Normalize Ipv6 address and arbitrary mask and apply arbitrary mask to Ipv6 address.
        Parameters:
        ipv6Address - the Ipv4 address
        ipv4Mask - the Ipv4 mask
        Returns:
        normalized Ipv6 prefix
      • normalizeIpv6AddressWithoutMask

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address normalizeIpv6AddressWithoutMask​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address)
        Normalize ipv 6 address without mask.
        Parameters:
        ipv6Address - the Ipv6 address
        Returns:
        normalized Ipv6 address
      • normalizeIpv4Prefix

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix normalizeIpv4Prefix​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix ipv4Prefix)
        Normalize Ipv4 address with prefix mask (ex. 192.168.0.1/24) and apply prefix mask to Ipv4 address.
        Parameters:
        ipv4Prefix - the Ipv4 prefix
        Returns:
        normalized Ipv4 prefix
      • normalizeIpv4Arbitrary

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix normalizeIpv4Arbitrary​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address ipv4Address,
                                                                                                                                                     @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DottedQuad ipv4Mask)
        Normalize Ipv4 address and arbitrary mask and apply arbitrary mask to Ipv4 address.
        Parameters:
        ipv4Address - the Ipv4 address
        ipv4Mask - the Ipv4 mask
        Returns:
        normalized Ipv4 prefix
      • normalizeIpv4Address

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix normalizeIpv4Address​(@org.eclipse.jdt.annotation.Nullable byte[] address,
                                                                                                                                                   @org.eclipse.jdt.annotation.Nullable byte[] mask)
        Normalize Ipv4 address and arbitrary mask in byte array format and apply arbitrary mask to Ipv4 address.
        Parameters:
        address - Ipv4 address byte array
        mask - Ipv4 mask byte array
        Returns:
        normalized Ipv4 prefix
      • normalizeIpv6Address

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix normalizeIpv6Address​(@org.eclipse.jdt.annotation.Nullable byte[] address,
                                                                                                                                                   @org.eclipse.jdt.annotation.Nullable byte[] mask)
        Normalize Ipv6 address and arbitrary mask in byte array format and apply arbitrary mask to Ipv6 address.
        Parameters:
        address - Ipv6 address byte array
        mask - Ipv6 mask byte array
        Returns:
        normalized Ipv6 prefix
      • normalizeIpAddress

        public static @Nullable InetAddress normalizeIpAddress​(@org.eclipse.jdt.annotation.Nullable byte[] address,
                                                               @org.eclipse.jdt.annotation.Nullable byte[] mask)
        Normalize generic IP address and arbitrary mask in byte array format and apply arbitrary mask to IP address.
        Parameters:
        address - address byte array
        mask - mask byte array
        Returns:
        normalized Inet address
      • normalizeInetAddressWithMask

        public static @Nullable String normalizeInetAddressWithMask​(@Nullable InetAddress address,
                                                                    @org.eclipse.jdt.annotation.Nullable byte[] mask)
        Convert arbitrary mask to prefix mask and append it to textual representation of Inet address.
        Parameters:
        address - the address
        mask - the mask
        Returns:
        the string
      • normalizeMacAddress

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress normalizeMacAddress​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress macAddress)
        Convert MAC address to it's lower case format.
        Parameters:
        macAddress - the MAC address
        Returns:
        normalized MAC address
      • normalizeMacAddressMask

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress normalizeMacAddressMask​(@Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress macAddress)
        Convert MAC address mask to it's lower case format and if it is full F mask, return null.
        Parameters:
        macAddress - the MAC address
        Returns:
        normalized MAC address