jist.swans.route
Class RouteAodv.PrecursorSet

java.lang.Object
  extended by jist.swans.route.RouteAodv.PrecursorSet
Enclosing class:
RouteAodv

private static class RouteAodv.PrecursorSet
extends java.lang.Object

Represents the set of neighboring nodes which (likely) route through this node. -A node periodically sends HELLO messages to its precursors, signaling to them that this node is still in range to receive packets. -A node also may send RERR messages to its precursors, informing them of broken routes.


Field Summary
private  java.util.Map map
          Data structure for storing the precursor set.
private  RouteAodv thisNode
          Reference to this RouteAodv instance.
 
Constructor Summary
RouteAodv.PrecursorSet(RouteAodv thisNode)
          Constructs a new PrecursorSet object.
 
Method Summary
 void add(MacAddress m)
          Adds an item to the precursor set.
 RouteAodv.PrecursorInfo getInfo(MacAddress m)
          Returns information for a precursor node.
 java.util.Iterator iterator()
          Returns an Iterator for the set.
 void remove(MacAddress m)
          Removes an item from the precursor set.
 void sendRERR(java.util.LinkedList nodes, byte ttl)
          Sends a RERR message to all precursors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

private java.util.Map map
Data structure for storing the precursor set.


thisNode

private RouteAodv thisNode
Reference to this RouteAodv instance.

Constructor Detail

RouteAodv.PrecursorSet

public RouteAodv.PrecursorSet(RouteAodv thisNode)
Constructs a new PrecursorSet object.

Parameters:
thisNode - reference to this RouteAodv instance
Method Detail

iterator

public java.util.Iterator iterator()
Returns an Iterator for the set. Each item of the iterator is of type Map.Entry, with map keys of type MacAddress, and map values of type PrecursorInfo

Returns:
the iterator

add

public void add(MacAddress m)
Adds an item to the precursor set.

Parameters:
m - Mac address of node to add to set

remove

public void remove(MacAddress m)
Removes an item from the precursor set.

Parameters:
m - Mac address of the node to remove from set

getInfo

public RouteAodv.PrecursorInfo getInfo(MacAddress m)
Returns information for a precursor node.

Parameters:
m - mac address of the precursor node
Returns:
precursor information

sendRERR

public void sendRERR(java.util.LinkedList nodes,
                     byte ttl)
Sends a RERR message to all precursors.

Parameters:
nodes - the list of destination addresses (of type NetAddress) to include in RERR message
ttl - TTL value to use