SSF.OS.BGP4
Class RouteInfo

java.lang.Object
  |
  +--SSF.OS.BGP4.RouteInfo
Direct Known Subclasses:
RouteInfoIC, RouteInfoOOC

public abstract class RouteInfo
extends java.lang.Object

A unit of BGP route information. It contains all information about a particular route which is used by BGP, including the destination, path attributes, and degree of preference.


Field Summary
static int AGG_CONTAINED
          Indicates that this route is part of an aggregation in which there is a less specific route than this one.
static int AGG_CONTAINS
          Indicates that this route is part of an aggregation in which this route is the least specific.
static int AGG_NONE
          Indicates that this route is not part of any aggregated route.
static int FEASIBLE_FLAG
          The value of the flag bit which indicates feasibility.
static int IMPLICIT_FLAG
          The value of the flag bit which indicates if the route's last advertisement or withdrawal was implicit.
static int INLOCRIB_FLAG
          The value of the flag bit which indicates if the route is in the Loc-RIB.
static int MAX_DOP
          The maximum value for degree of preference.
static int MIN_DOP
          The minimum value for degree of preference.
static int PERMISSIBLE_FLAG
          The value of the flag bit which indicates permissibility.
 
Constructor Summary
RouteInfo()
           
 
Method Summary
static int approxBytes(boolean usenhi)
          Determines the approximate number of bytes that would be required when converting this route info to a series of bytes with toBytes.
static int bytes2str(java.lang.StringBuffer infostr, byte[] bytes, int bindex, boolean usenhi)
          Converts a series of bytes into route info (in string form).
abstract  int compare(RouteInfo info)
          Performs a comparison with route information for another route to determine which route is more preferable.
abstract  int dop()
          Get the degree of preference.
abstract  boolean feasible()
          Returns whether or not the route is feasible.
abstract  boolean implicit()
          Returns whether or not the last advertisement or withdrawal was implicit.
abstract  boolean inlocrib()
          Returns whether or not the route is in the Loc-RIB.
abstract  int peerind()
          Return the index of the peer who advertised the route.
abstract  boolean permissible()
          Returns whether or not the route is permissible.
abstract  Route route()
          Returns the enclosed route.
abstract  void set_dop(int d)
          Set the degree of preference.
abstract  void set_feasible(boolean b)
          Sets the feasibility of the route in this entry.
abstract  void set_implicit(boolean b)
          Sets whether or not the last advertisement or withdrawal was implicit.
abstract  void set_inlocrib(boolean b)
          Sets whether or not the route is in the Loc-RIB.
abstract  void set_permissible(boolean b)
          Sets the permissibility of the route in this entry.
abstract  int toBytes(byte[] bytes, int bindex, boolean usenhi)
          Converts route info into a series of bytes and inserts them into a given byte array.
abstract  java.lang.String toString()
          Returns route information as a string.
abstract  java.lang.String toString(boolean usenhi)
          Returns route information as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AGG_NONE

public static final int AGG_NONE
Indicates that this route is not part of any aggregated route.

See Also:
Constant Field Values

AGG_CONTAINED

public static final int AGG_CONTAINED
Indicates that this route is part of an aggregation in which there is a less specific route than this one.

See Also:
Constant Field Values

AGG_CONTAINS

public static final int AGG_CONTAINS
Indicates that this route is part of an aggregation in which this route is the least specific.

See Also:
Constant Field Values

MIN_DOP

public static final int MIN_DOP
The minimum value for degree of preference.

See Also:
Constant Field Values

MAX_DOP

public static final int MAX_DOP
The maximum value for degree of preference.

See Also:
Constant Field Values

PERMISSIBLE_FLAG

public static final int PERMISSIBLE_FLAG
The value of the flag bit which indicates permissibility.

See Also:
Constant Field Values

FEASIBLE_FLAG

public static final int FEASIBLE_FLAG
The value of the flag bit which indicates feasibility.

See Also:
Constant Field Values

INLOCRIB_FLAG

public static final int INLOCRIB_FLAG
The value of the flag bit which indicates if the route is in the Loc-RIB.

See Also:
Constant Field Values

IMPLICIT_FLAG

public static final int IMPLICIT_FLAG
The value of the flag bit which indicates if the route's last advertisement or withdrawal was implicit.

See Also:
Constant Field Values
Constructor Detail

RouteInfo

public RouteInfo()
Method Detail

route

public abstract Route route()
Returns the enclosed route.


dop

public abstract int dop()
Get the degree of preference.


set_dop

public abstract void set_dop(int d)
Set the degree of preference.


peerind

public abstract int peerind()
Return the index of the peer who advertised the route.


permissible

public abstract boolean permissible()
Returns whether or not the route is permissible. A permissible route is one which was permitted by the input policy rules. Permissibility is orthogonal to feasibility.

Returns:
whether or not the route is permissible

set_permissible

public abstract void set_permissible(boolean b)
Sets the permissibility of the route in this entry.

Parameters:
b - Whether or not the route is permissible.

feasible

public abstract boolean feasible()
Returns whether or not the route is feasible. A feasible route is one that could be used, according to BGP specifications. That is, it does not contain any AS loops or have any other "illegal" properties.

Returns:
whether or not the route is feasible

set_feasible

public abstract void set_feasible(boolean b)
Sets the feasibility of the route in this entry.

Parameters:
b - Whether or not the route is feasible.

inlocrib

public abstract boolean inlocrib()
Returns whether or not the route is in the Loc-RIB.

Returns:
whether or not the route is in the Loc-RIB

set_inlocrib

public abstract void set_inlocrib(boolean b)
Sets whether or not the route is in the Loc-RIB.

Parameters:
b - Whether or not the route is in the Loc-RIB.

implicit

public abstract boolean implicit()
Returns whether or not the last advertisement or withdrawal was implicit.

Returns:
whether or not the last advertisement or withdrawal was implicit

set_implicit

public abstract void set_implicit(boolean b)
Sets whether or not the last advertisement or withdrawal was implicit.

Parameters:
b - Whether the last advertisement or withdrawal was implicit.

compare

public abstract int compare(RouteInfo info)
Performs a comparison with route information for another route to determine which route is more preferable.

Returns:
1 if this route is preferred, 0 if they are identically preferable, and -1 if the given route is preferred.

approxBytes

public static int approxBytes(boolean usenhi)
Determines the approximate number of bytes that would be required when converting this route info to a series of bytes with toBytes. It is more likely than not to be an overestimate. Using NHI addressing makes a difference, so it is included as a parameter.

Parameters:
usenhi - Whether or not to use NHI addressing.
Returns:
the approximate number of bytes that would result from conversion of this route inf to a series of bytes with toBytes

toBytes

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

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.
Returns:
the total number of bytes produced by the conversion

bytes2str

public static int bytes2str(java.lang.StringBuffer infostr,
                            byte[] bytes,
                            int bindex,
                            boolean usenhi)
Converts a series of bytes into route info (in string form).

Parameters:
infostr - A StringBuffer into which the results will be placed. It must be initialized to the empty string.
bytes - The byte array to convert to route information.
bindex - The index into the given byte array from which to begin converting.
usenhi - Whether or not to use NHI addressing.
Returns:
the total number of bytes produced by the conversion

toString

public abstract java.lang.String toString()
Returns route information as a string.

Overrides:
toString in class java.lang.Object
Returns:
the route information as a string

toString

public abstract java.lang.String toString(boolean usenhi)
Returns route information as a string.

Parameters:
usenhi - Whether or not to use NHI addressing.
Returns:
the route information as a string