SunSPOT API V6.0


com.sun.spot.ipv6.routing
Class IPRouteEntry

java.lang.Object
  extended by com.sun.spot.ipv6.routing.IPRouteEntry
All Implemented Interfaces:
Comparable

public class IPRouteEntry
extends Object
implements Comparable

Class for a single route entry in the IP routing table. A route entry consists of a routing prefix and the IP address of the next-hop router responsible for handling traffic to that network from this local network.

Author:
Pete St. Pierre

Field Summary
static int DEFAULT_SUBNET_BITS
           
static IIPNetworkInterface DEVICE_UNKNOWN
           
static int ROUTE_DYNAMIC
           
static int ROUTE_LOCAL
           
static int ROUTE_NDRD
           
static int ROUTE_STATIC
           
static String[] RouteType
           
 
Constructor Summary
IPRouteEntry(byte[] dest, int mask, byte[] gw, int rt)
           
IPRouteEntry(byte[] dest, int mask, byte[] gw, int rt, IIPNetworkInterface iface)
           
 
Method Summary
 int compare(Object o)
           
protected  boolean contains(byte[] address)
           
 int getDestinationMask()
           
 byte[] getDestinationNetwork()
           
 byte[] getGatewayAddress()
          returns the gateway address associated with this route entry
 IIPNetworkInterface getNetworkInterface()
           
 int getType()
           
 String getTypeString()
           
static String getTypeString(int t)
           
protected  void setDestinationNetwork(byte[] dest, int mask)
           
protected  void setGatewayAddress(byte[] newGW)
          Set the gateway address associated with this route entry
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SUBNET_BITS

public static final int DEFAULT_SUBNET_BITS
See Also:
Constant Field Values

DEVICE_UNKNOWN

public static final IIPNetworkInterface DEVICE_UNKNOWN

RouteType

public static String[] RouteType

ROUTE_LOCAL

public static final int ROUTE_LOCAL
See Also:
Constant Field Values

ROUTE_STATIC

public static final int ROUTE_STATIC
See Also:
Constant Field Values

ROUTE_NDRD

public static final int ROUTE_NDRD
See Also:
Constant Field Values

ROUTE_DYNAMIC

public static final int ROUTE_DYNAMIC
See Also:
Constant Field Values
Constructor Detail

IPRouteEntry

public IPRouteEntry(byte[] dest,
                    int mask,
                    byte[] gw,
                    int rt)

IPRouteEntry

public IPRouteEntry(byte[] dest,
                    int mask,
                    byte[] gw,
                    int rt,
                    IIPNetworkInterface iface)
Method Detail

setGatewayAddress

protected void setGatewayAddress(byte[] newGW)
Set the gateway address associated with this route entry

Parameters:
newGW - the new gateway address

getGatewayAddress

public byte[] getGatewayAddress()
returns the gateway address associated with this route entry

Returns:
the IP address of the gateway

setDestinationNetwork

protected void setDestinationNetwork(byte[] dest,
                                     int mask)

getDestinationNetwork

public byte[] getDestinationNetwork()

getDestinationMask

public int getDestinationMask()

getTypeString

public static String getTypeString(int t)

getTypeString

public String getTypeString()

getType

public int getType()

getNetworkInterface

public IIPNetworkInterface getNetworkInterface()

toString

public String toString()
Description copied from class: Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class Object
Returns:
a string representation of the object.

contains

protected boolean contains(byte[] address)

compare

public int compare(Object o)
Specified by:
compare in interface Comparable

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.