SSF.OS.OSPFv2
Class ShortestPath

java.lang.Object
  |
  +--SSF.OS.OSPFv2.ShortestPath

public class ShortestPath
extends java.lang.Object

When multiple paths of equal path-type and cost exist to a destination, they are stored in a single routing table entry. To destinguish between them this class holds the fields that uniquely indentify a shortest path. Objects of this class are kept in a Vector called equalCostPaths stored in a routing table entry. Remember, the advRouter field is valid in case of INTER_AREA routes only!


Field Summary
 int advRouter
          The router ID of the router who advertised this path.
 NextHop nextHop
          A NextHop Object describing the shortest path stored here.
 
Constructor Summary
ShortestPath(int advR, NextHop nH)
          Constructs an object that holds the fields which uniquely identifies a shortest path in case of an inter-area or AS external path.
ShortestPath(NextHop nH)
          Constructs an object that holds the fields which uniquely identifies a shortest path in any other case.
 
Method Summary
 boolean equals(java.lang.Object sPathObj)
          Indicates whether a ShortestPath object is "equal" to this one.
 int getNHopIP()
          Return the ip address of the next hop router if there is one.
 int getViaIntf()
          Return the ip address of the outgoing interface.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

advRouter

public int advRouter
The router ID of the router who advertised this path.


nextHop

public NextHop nextHop
A NextHop Object describing the shortest path stored here.

Constructor Detail

ShortestPath

public ShortestPath(int advR,
                    NextHop nH)
Constructs an object that holds the fields which uniquely identifies a shortest path in case of an inter-area or AS external path.

Parameters:
advR - The router ID of the router who advertised this path.
nH - A NextHop describing the path.

ShortestPath

public ShortestPath(NextHop nH)
Constructs an object that holds the fields which uniquely identifies a shortest path in any other case.

Parameters:
nH - A NextHop describing the path.
Method Detail

getViaIntf

public int getViaIntf()
Return the ip address of the outgoing interface.

Returns:
int value representig ip address of outgoing interface.

getNHopIP

public int getNHopIP()
Return the ip address of the next hop router if there is one. Otherwise return 0.

Returns:
int value representig ip address of the next hop router if any.

equals

public boolean equals(java.lang.Object sPathObj)
Indicates whether a ShortestPath object is "equal" to this one.

Overrides:
equals in class java.lang.Object
Parameters:
sPathObj - ShortestPath object to compare.
Returns:
boolean value indicating true if the Objects are equal else indicating false.