verinec.netsim.util.tables
Class RoutingTable

java.lang.Object
  extended by java.util.AbstractMap
      extended by verinec.netsim.util.tables.AddressTable
          extended by verinec.netsim.util.tables.RoutingTable
All Implemented Interfaces:
Map

public class RoutingTable
extends AddressTable

Version:
$Revision: 47 $
Author:
Dominik Jungo

Nested Class Summary
private  class RoutingTable.Entry
           
private  class RoutingTable.NetmaskAddressComparator
           
 
Constructor Summary
RoutingTable()
          Creates a new RoutingTable
 
Method Summary
 IAddress getInterface(IAddress key)
          gets the Address of the Interface over which data will be send to the destination address (key).
 Object put(Object arg0, Object arg1, Object arg2, double time)
          adds an entry to the routing table
 
Methods inherited from class verinec.netsim.util.tables.AddressTable
entrySet, getAddress, getReverseAddress, put, put, removeOlderThan
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoutingTable

public RoutingTable()
Creates a new RoutingTable

Method Detail

put

public Object put(Object arg0,
                  Object arg1,
                  Object arg2,
                  double time)
adds an entry to the routing table

Parameters:
arg0 - a key (destination address)
arg1 - the address of the interface
arg2 - the address of the used gateway
time - creation time of this entry
Returns:
the old value with the key arg0. null if there is no value with this key.

getInterface

public IAddress getInterface(IAddress key)
gets the Address of the Interface over which data will be send to the destination address (key). A matching algrothym using netmasks is used. If no interface address matches the address of the interface connected to default gateway is returned.

Parameters:
key - the destination address
Returns:
address of the interface over which data will be send to destination.

Copyright © 2005 Verinec, DIUF