Class Ipv6Util


  • public final class Ipv6Util
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] bytesFromHexString​(java.lang.String values)  
      static java.lang.String bytesToHexString​(byte[] bytes)  
      static int calculateIcmpv6Checksum​(byte[] packet, Ipv6Header ip6Hdr)  
      static byte[] convertEthernetHeaderToByte​(EthernetHeader ethPdu)  
      static byte[] convertIpv6HeaderToByte​(Ipv6Header ip6Pdu)  
      static java.lang.String getFormattedIpAddress​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress ipAddress)
      Gets the formatted IP address.
      static java.lang.String getFormattedIpv6Address​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address)
      Gets the formatted IPv6 address.
      static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address getIpv6LinkLocalAddressFromMac​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress mac)  
      static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress getIpv6MulticastMacAddress​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address)  
      static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address getIpv6SolicitedNodeMcastAddress​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address)  
      static boolean validateChecksum​(byte[] packet, Ipv6Header ip6Hdr, int recvChecksum)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • bytesToHexString

        public static java.lang.String bytesToHexString​(byte[] bytes)
      • bytesFromHexString

        public static byte[] bytesFromHexString​(java.lang.String values)
      • calculateIcmpv6Checksum

        public static int calculateIcmpv6Checksum​(byte[] packet,
                                                  Ipv6Header ip6Hdr)
      • validateChecksum

        public static boolean validateChecksum​(byte[] packet,
                                               Ipv6Header ip6Hdr,
                                               int recvChecksum)
      • convertEthernetHeaderToByte

        public static byte[] convertEthernetHeaderToByte​(EthernetHeader ethPdu)
      • convertIpv6HeaderToByte

        public static byte[] convertIpv6HeaderToByte​(Ipv6Header ip6Pdu)
      • getIpv6LinkLocalAddressFromMac

        public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address getIpv6LinkLocalAddressFromMac​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress mac)
      • getIpv6SolicitedNodeMcastAddress

        public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address getIpv6SolicitedNodeMcastAddress​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address)
      • getIpv6MulticastMacAddress

        public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress getIpv6MulticastMacAddress​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address)
      • getFormattedIpAddress

        public static java.lang.String getFormattedIpAddress​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress ipAddress)
        Gets the formatted IP address.
        e.g.,
        1. input = "1001:db8:0:2::1", return = "1001:db8:0:2:0:0:0:1"
        2. input = "2607:f0d0:1002:51::4", return = "2607:f0d0:1002:51:0:0:0:4"
        3. input = "1001:db8:0:2:0:0:0:1", return = "1001:db8:0:2:0:0:0:1"
        4. input = "10.0.0.10", return = "10.0.0.10"
        Parameters:
        ipAddress - the IP address
        Returns:
        the formatted IP address
      • getFormattedIpv6Address

        public static java.lang.String getFormattedIpv6Address​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address ipv6Address)
        Gets the formatted IPv6 address.
        e.g.,
        1. input = "1001:db8:0:2::1", return = "1001:db8:0:2:0:0:0:1"
        2. input = "2607:f0d0:1002:51::4", return = "2607:f0d0:1002:51:0:0:0:4"
        3. input = "1001:db8:0:2:0:0:0:1", return = "1001:db8:0:2:0:0:0:1"
        Parameters:
        ipv6Address - the IPv6 address
        Returns:
        the formatted IPv6 address