jist.swans.route
Class RouteAodv.RreqBuffer

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

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

Buffer for keeping track of recently sent RREQ messages (so they are not resent). Also keeps track of recent RREQ messages that were answered with a RREP.


Field Summary
private  java.util.LinkedList list
          List of RreqBufferEntry objects.
private  NetAddress localAddr
          Local net address.
 
Constructor Summary
RouteAodv.RreqBuffer(NetAddress netAddr)
          Constructs a Route Request Buffer object.
 
Method Summary
 void addEntry(RouteAodv.RreqBufferEntry entry)
          Adds an entry to the RREQ buffer.
 void clearExpiredEntries()
          Remove all expired entries.
 boolean contains(RouteAodv.RreqBufferEntry entry)
          Checks if a given RouteBufferEntry exists in the RREQ Buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

private java.util.LinkedList list
List of RreqBufferEntry objects.


localAddr

private NetAddress localAddr
Local net address.

Constructor Detail

RouteAodv.RreqBuffer

public RouteAodv.RreqBuffer(NetAddress netAddr)
Constructs a Route Request Buffer object.

Parameters:
netAddr - local net address
Method Detail

addEntry

public void addEntry(RouteAodv.RreqBufferEntry entry)
Adds an entry to the RREQ buffer. If RREQ buffer is full, oldest entries are removed to make room. Also, any expired entries are removed.

Parameters:
entry - RreqBufferEntry to be added

contains

public boolean contains(RouteAodv.RreqBufferEntry entry)
Checks if a given RouteBufferEntry exists in the RREQ Buffer.

Parameters:
entry - the RouteBufferEntry
Returns:
True, if the RREQ buffer contains the specified entry

clearExpiredEntries

public void clearExpiredEntries()
Remove all expired entries.