SSF.Net
Class RoutingInfoOOC

java.lang.Object
  |
  +--SSF.Net.RoutingInfo
        |
        +--SSF.Net.RoutingInfoOOC

public class RoutingInfoOOC
extends RoutingInfo

Forwarding data stored in a node in a RoutingTable (out of core).


Field Summary
protected  NIC INTERFACE
          Reference to the network interface that gets us to the next hop
protected  RoutingInfoOOC nextRoute
          Linked list of routes to the same destination IP address
 
Fields inherited from class SSF.Net.RoutingInfo
UNDEFINED_ADMINISTRATIVE_DISTANCE
 
Constructor Summary
RoutingInfoOOC(java.lang.String dest_ip, int next_hop, NIC iface, int cost, int adist, java.lang.String src)
           
 
Method Summary
 RoutingInfo addRoute(RoutingInfo newRte)
          Insert one or more new routes into the linked list, sorted primarily by administrative distance and secondarily by cost.
 int adist()
          Returns the administrative distance.
 int cost()
          Returns the cost.
 java.lang.String dest_ip()
          Returns the destination IP address.
 void finalize()
           
 RoutingInfo findRouteFrom(java.lang.String protocol)
          Find the first (best) route inserted by the named protocol.
 RoutingInfo[] findRoutesFrom(java.lang.String protocol)
          Return the list of routes inserted by the given protocol.
 java.lang.String getProtocol()
           
 NIC next_hop_interface()
          Return the next hop inteface (NIC) object.
 int next_hop_ip()
          Returns the next hop IP address.
 RoutingInfo nextRoute()
          Returns the next route info entry for the same IP address (if any).
 RoutingInfo removeRoute(RoutingInfo oldRoute)
          Remove the given route, and return the new head route (either this route, or if this route was removed, the next route).
 RoutingInfo removeRoutesFrom(java.lang.String protocol)
          Remove routes from the given protocol, and return the new head route (either this route, or if this route was removed, the next route).
 int toBytes(byte[] bytes, int bindex, boolean usenhi, Net topnet)
          Converts this routing info into a series of bytes and inserts them into a given byte array.
 java.lang.String toString()
          Returns the routing information as a string.
 java.lang.String toString(boolean usenhi, Net topnet)
          Returns the routing information as a string.
 
Methods inherited from class SSF.Net.RoutingInfo
approxBytes, bytes2info, decodeSource, encodeSource
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INTERFACE

protected NIC INTERFACE
Reference to the network interface that gets us to the next hop


nextRoute

protected RoutingInfoOOC nextRoute
Linked list of routes to the same destination IP address

Constructor Detail

RoutingInfoOOC

public RoutingInfoOOC(java.lang.String dest_ip,
                      int next_hop,
                      NIC iface,
                      int cost,
                      int adist,
                      java.lang.String src)
Method Detail

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
java.lang.Throwable

next_hop_interface

public final NIC next_hop_interface()
Description copied from class: RoutingInfo
Return the next hop inteface (NIC) object.

Specified by:
next_hop_interface in class RoutingInfo

dest_ip

public final java.lang.String dest_ip()
Description copied from class: RoutingInfo
Returns the destination IP address.

Specified by:
dest_ip in class RoutingInfo

next_hop_ip

public final int next_hop_ip()
Description copied from class: RoutingInfo
Returns the next hop IP address.

Specified by:
next_hop_ip in class RoutingInfo

cost

public int cost()
Returns the cost.

Specified by:
cost in class RoutingInfo

adist

public int adist()
Returns the administrative distance.

Specified by:
adist in class RoutingInfo

nextRoute

public RoutingInfo nextRoute()
Description copied from class: RoutingInfo
Returns the next route info entry for the same IP address (if any).

Specified by:
nextRoute in class RoutingInfo

getProtocol

public final java.lang.String getProtocol()
Specified by:
getProtocol in class RoutingInfo

addRoute

public RoutingInfo addRoute(RoutingInfo newRte)
Insert one or more new routes into the linked list, sorted primarily by administrative distance and secondarily by cost. Return the new head route (either the new route, or this route, whichever is lower-cost).

Specified by:
addRoute in class RoutingInfo

removeRoute

public RoutingInfo removeRoute(RoutingInfo oldRoute)
Remove the given route, and return the new head route (either this route, or if this route was removed, the next route).

Specified by:
removeRoute in class RoutingInfo

removeRoutesFrom

public RoutingInfo removeRoutesFrom(java.lang.String protocol)
Remove routes from the given protocol, and return the new head route (either this route, or if this route was removed, the next route). The special protocol name "*" matches all protocols. If the list argument is non-null, insert deleted routes into the list.

Specified by:
removeRoutesFrom in class RoutingInfo

findRoutesFrom

public RoutingInfo[] findRoutesFrom(java.lang.String protocol)
Return the list of routes inserted by the given protocol. The special protocol name "*" matches all protocols.

Specified by:
findRoutesFrom in class RoutingInfo

findRouteFrom

public RoutingInfo findRouteFrom(java.lang.String protocol)
Find the first (best) route inserted by the named protocol.

Specified by:
findRouteFrom in class RoutingInfo

toString

public java.lang.String toString()
Returns the routing information as a string.

Specified by:
toString in class RoutingInfo
Returns:
the routing information as a string

toString

public java.lang.String toString(boolean usenhi,
                                 Net topnet)
Returns the routing information as a string.

Specified by:
toString in class RoutingInfo
Parameters:
usenhi - Whether to use the NHI or IP prefix address format.
topnet - The top-level Net in the simulation.
Returns:
the routing information as a string

toBytes

public int toBytes(byte[] bytes,
                   int bindex,
                   boolean usenhi,
                   Net topnet)
Converts this routing info into a series of bytes and inserts them into a given byte array.

Specified by:
toBytes in class RoutingInfo
Parameters:
bytes - A byte array in which to place the results.
bindex - The index into the given byte array at which to begin placing the results.
usenhi - Whether or not to use NHI addressing.
topnet - The top-level Net in the simulation.
Returns:
the total number of bytes produced by the conversion