SunSPOT API V5.0


com.sun.spot.peripheral.radio.mhrp.lqrp.routing
Class RoutingTable

java.lang.Object
  extended by com.sun.spot.peripheral.radio.mhrp.lqrp.routing.RoutingTable

public class RoutingTable
extends Object

An object that represents a routing table for the mesh

Version:
0.1
Author:
Allen Ajit George, Jochen Furtmueller, modifications by Pradip De, Pete St. Pierre & Ron Goldman

Method Summary
 void addRoute(long address, long nextHopMACAddress, int hopCount, double routeCost, int lowLQlinkCount, int destSeqNumber)
          Create a new route entry using the parameters, then call doTableAddition()
 void addRoute(long senderMACAddress, RREP message)
          Create a new route entry based on a received route reply, then call doTableAddition()
 void addRoute(long senderMACAddress, RREQ message)
          Create a new route entry based on a received route request, then call doTableAddition()
 void deactivateRoute(long originator, long destination)
          removes a node from the users list of a route and sets the activity flag to false
 void deactivateRoutesUsing(long nextHop)
          removes all routes starting with given node
 void dumpTable()
           
 boolean freshenRoute(long address)
          increases the expiry time for a route that is specified by the destination address
 Vector getAllEntries()
          This method provides access to the entire routing table.
 int getDestinationSequenceNumber(long address)
          get the destination sequence number for a certain entry
 RoutingEntry getEntry(long address)
          Returns the route entry for a given destination.
static RoutingTable getInstance()
          retrieve a handle to this routing table
 RouteInfo getNextHopInfo(long address)
          returns an object that describes the route for a given destination
 void setOurAddress(long ourAddress)
          sets our IEEE Address
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

start

public void start()

stop

public void stop()

getInstance

public static RoutingTable getInstance()
retrieve a handle to this routing table

Returns:
instance of this singleton

getEntry

public RoutingEntry getEntry(long address)
Returns the route entry for a given destination. Note: now checks if route has expired.

Parameters:
address - for which a route is wanted
Returns:
routeEntry in Routing table, if present, or null

getNextHopInfo

public RouteInfo getNextHopInfo(long address)
returns an object that describes the route for a given destination

Parameters:
address - for which a route info is wanted
Returns:
routeInfo that has a valid next hop field if there was a route in the table, or a invalid next hop field if there was not

addRoute

public void addRoute(long address,
                     long nextHopMACAddress,
                     int hopCount,
                     double routeCost,
                     int lowLQlinkCount,
                     int destSeqNumber)
Create a new route entry using the parameters, then call doTableAddition()

Parameters:
address - destination address of route entry
nextHopMACAddress - address of next hop to this address
hopCount - number of hops to destination
routeCost - LQRP route cost mechanism
destSeqNumber - LQRP sequence number

addRoute

public void addRoute(long senderMACAddress,
                     RREQ message)
Create a new route entry based on a received route request, then call doTableAddition()

Parameters:
senderMACAddress - mac address of the requestor
message - route request message received

addRoute

public void addRoute(long senderMACAddress,
                     RREP message)
Create a new route entry based on a received route reply, then call doTableAddition()

Parameters:
senderMACAddress - sender of the route response
message - route response message received

getDestinationSequenceNumber

public int getDestinationSequenceNumber(long address)
get the destination sequence number for a certain entry

Parameters:
address - address of the entry that we are interested in
Returns:
destinationSequenceNumber

freshenRoute

public boolean freshenRoute(long address)
increases the expiry time for a route that is specified by the destination address

Parameters:
address - destination address to be refreshed
Returns:
true when finished

deactivateRoute

public void deactivateRoute(long originator,
                            long destination)
removes a node from the users list of a route and sets the activity flag to false

Parameters:
originator - originator of the route request
destination - destination address of route entry

deactivateRoutesUsing

public void deactivateRoutesUsing(long nextHop)
removes all routes starting with given node

Parameters:
nextHop - starting point for routes to remove

getAllEntries

public Vector getAllEntries()
This method provides access to the entire routing table. It can be used to monitor the state of the routing table by an application. CAUTION: As this method accesses a syncronized object, it should not be called to often.

Returns:
vector of all routing entries

dumpTable

public void dumpTable()

setOurAddress

public void setOurAddress(long ourAddress)
sets our IEEE Address

Parameters:
ourAddress - our IEEE Address as a long

SunSPOT API V5.0


Copyright � 2006-2008 Sun Microsystems, Inc. All Rights Reserved.