SunSPOT API V6.0


com.sun.spot.ipv6
Class IPUtils

java.lang.Object
  extended by com.sun.spot.ipv6.IPUtils

public class IPUtils
extends Object

General routines for working iwth IPv6 packets and addresses

Author:
Pete St. Pierre

Constructor Summary
IPUtils()
           
 
Method Summary
static String addressToString(byte[] address)
           
static int compare(byte[] ipaddress, byte[] test)
           
static byte[] createNetmask(int bits)
           
static boolean equals(byte[] arr1, byte[] arr2)
           
protected static byte[] getMyLinkLocalAddress(byte[] linkAddress)
          A routine to create an Inet6Address with our link local address
static byte[] getMyLinkLocalAddress(IEEEAddress addr)
           
static byte[] getNetworkPart(byte[] addr, int bits)
           
static String hex16(int data)
           
static String hex8(int data)
           
static Inet6Address ieeeToIPv6Address(String target)
           
static boolean isAnyLocalAddress(byte[] ipaddress)
          Utility routine to check if the InetAddress in a wildcard address.
static boolean isGlobal(byte[] ipaddress)
          Utility routine to check if the address is a multicast.
static boolean isLinkLocalAddress(byte[] ipaddress)
          Utility routine to check if the InetAddress is an link local address.
static boolean isLoopbackAddress(byte[] ipaddress)
          Utility routine to check if the InetAddress is a loopbackAddress address.
static boolean isMC(byte[] ipaddress)
          Utility routine to check if the address is a multicast.
static boolean isMCLinkLocal(byte[] ipaddress)
          Utility routine to check if the multicast address has link scope.
static boolean isMulticastAddress(byte[] ipaddress)
          Utility routine to check if the InetAddress is an IP multicast address. 11111111 at the start of the address identifies the address as being a multicast address.
static byte[] macAddressToEUI64(byte[] a)
           
static Inet6Address parseInet6Address(String address)
           
static int parseInet6Netmask(String address)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPUtils

public IPUtils()
Method Detail

getMyLinkLocalAddress

public static byte[] getMyLinkLocalAddress(IEEEAddress addr)

getMyLinkLocalAddress

protected static byte[] getMyLinkLocalAddress(byte[] linkAddress)
A routine to create an Inet6Address with our link local address

Returns:
The link local address of this node in Inet6Address format

getNetworkPart

public static byte[] getNetworkPart(byte[] addr,
                                    int bits)

parseInet6Address

public static Inet6Address parseInet6Address(String address)

parseInet6Netmask

public static int parseInet6Netmask(String address)

createNetmask

public static byte[] createNetmask(int bits)

equals

public static boolean equals(byte[] arr1,
                             byte[] arr2)

compare

public static int compare(byte[] ipaddress,
                          byte[] test)

hex8

public static String hex8(int data)

hex16

public static String hex16(int data)

isMC

public static boolean isMC(byte[] ipaddress)
Utility routine to check if the address is a multicast.

Returns:
a boolean indicating if the address is a multicast address, false if it is not not a multicast address

isGlobal

public static boolean isGlobal(byte[] ipaddress)
Utility routine to check if the address is a multicast.

Returns:
a boolean indicating if the address is a globally routable address, false if it is not not a multicast address

isMCLinkLocal

public static boolean isMCLinkLocal(byte[] ipaddress)
Utility routine to check if the multicast address has link scope.

Returns:
a boolean indicating if the address has is a multicast address of link-local scope, false if it is not of link-local scope or it is not a multicast address

isLinkLocalAddress

public static boolean isLinkLocalAddress(byte[] ipaddress)
Utility routine to check if the InetAddress is an link local address.

Returns:
a boolean indicating if the InetAddress is a link local address; or false if address is not a link local unicast address.

isAnyLocalAddress

public static boolean isAnyLocalAddress(byte[] ipaddress)
Utility routine to check if the InetAddress in a wildcard address.

Returns:
a boolean indicating if the Inetaddress is a wildcard address.

isLoopbackAddress

public static boolean isLoopbackAddress(byte[] ipaddress)
Utility routine to check if the InetAddress is a loopbackAddress address.

Returns:
a boolean indicating if the InetAddress is a loopbackAddress address; or false otherwise.

isMulticastAddress

public static boolean isMulticastAddress(byte[] ipaddress)
Utility routine to check if the InetAddress is an IP multicast address. 11111111 at the start of the address identifies the address as being a multicast address.

Returns:
a boolean indicating if the InetAddress is an IP multicast address

addressToString

public static String addressToString(byte[] address)

macAddressToEUI64

public static byte[] macAddressToEUI64(byte[] a)

ieeeToIPv6Address

public static Inet6Address ieeeToIPv6Address(String target)

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.