SunSPOT API V2.0


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

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

public class RoutingTable
extends Object

Version:
0.1
Author:
Allen Ajit George, Jochen Furtmueller

Method Summary
 void addRoute(long address, long nextHopMACAddress, int hopCount, int routeCost, 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 cleanTable()
          delete all table entries that are expired
 void deactivateRoute(long originator, long destination)
          removes a node from the users list of a route and sets the activity flag to false
 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
static RoutingTable getInstance()
           
 RouteInfo getNextHopInfo(long address)
           
 void setOurAddress(long ourAddress)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RoutingTable getInstance()
Returns:
instance of this singleton

getNextHopInfo

public RouteInfo getNextHopInfo(long address)
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,
                     int routeCost,
                     int destSeqNumber)
Create a new route entry using the parameters, then call doTableAddition()

Parameters:
address -
nextHopMACAddress -
hopCount -
routeCost -
destSeqNumber -

addRoute

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

Parameters:
senderMACAddress -
message -

addRoute

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

Parameters:
senderMACAddress -
message -

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

cleanTable

public void cleanTable()
delete all table entries that are expired


freshenRoute

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

Parameters:
address -
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 -
destination -

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

setOurAddress

public void setOurAddress(long ourAddress)

SunSPOT API V2.0


Copyright © 2007 Sun Microsystems, Inc. All Rights Reserved.