SSF.OS.BGP4
Class RouteInfoOOC

java.lang.Object
  |
  +--SSF.OS.BGP4.RouteInfo
        |
        +--SSF.OS.BGP4.RouteInfoOOC

public class RouteInfoOOC
extends RouteInfo

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
 
Fields inherited from class SSF.OS.BGP4.RouteInfo
AGG_CONTAINED, AGG_CONTAINS, AGG_NONE, FEASIBLE_FLAG, IMPLICIT_FLAG, INLOCRIB_FLAG, MAX_DOP, MIN_DOP, PERMISSIBLE_FLAG
 
Constructor Summary
RouteInfoOOC(BGPSession b)
          Constructs new route information with default values.
RouteInfoOOC(BGPSession b, Route rte, int dop, boolean feas, PeerEntry pe)
          Constructs new route information with the given attributes.
RouteInfoOOC(BGPSession b, Route r, int aggs, Route aggr, int d, boolean feas, boolean perm, PeerEntry pe)
          Constructs route information given all of the relevant data.
 
Method Summary
 int compare(RouteInfo ri)
          Performs a comparison with route information for another route to determine which route is more preferable.
 int dop()
          Get the degree of preference.
 boolean feasible()
          Returns whether or not the route is feasible.
 void finalize()
          Frees segment of allocated out-of-core memory.
 boolean implicit()
          Returns whether or not the last advertisement or withdrawal was implicit.
 boolean inlocrib()
          Returns whether or not the route is in the Loc-RIB.
 int peerind()
          Return the index of the peer who advertised the route.
 boolean permissible()
          Returns whether or not the route is permissible.
 Route route()
          Returns the enclosed route.
 void set_dop(int d)
          Set the degree of preference.
 void set_feasible(boolean b)
          Sets the feasibility of the route in this entry.
 void set_implicit(boolean b)
          Sets whether or not the last advertisement or withdrawal was implicit.
 void set_inlocrib(boolean b)
          Sets whether or not the route is in the Loc-RIB.
 void set_permissible(boolean b)
          Sets the permissibility of the route in this entry.
 void set_route(Route r)
           
 int toBytes(byte[] bytes, int bindex, boolean usenhi)
          Converts route info into a series of bytes and inserts them into a given byte array.
 java.lang.String toString()
          Returns route information as a string.
 java.lang.String toString(boolean usenhi)
          Returns route information as a string.
 
Methods inherited from class SSF.OS.BGP4.RouteInfo
approxBytes, bytes2str
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RouteInfoOOC

public RouteInfoOOC(BGPSession b)
Constructs new route information with default values.

Parameters:
b - The BGPSession with which this route info is associated.

RouteInfoOOC

public RouteInfoOOC(BGPSession b,
                    Route r,
                    int aggs,
                    Route aggr,
                    int d,
                    boolean feas,
                    boolean perm,
                    PeerEntry pe)
Constructs route information given all of the relevant data.

Parameters:
b - The BGPSession with which this route info is associated.
r - The route to which this information pertains.
aggs - The aggregation status of this information.
aggr - An aggregation of this route with others (may be null).
d - The degree of preference of the route.
feas - Whether or not the route is feasible.
perm - Whether or not the route is permissible.
pe - The peer who advertised this route.

RouteInfoOOC

public RouteInfoOOC(BGPSession b,
                    Route rte,
                    int dop,
                    boolean feas,
                    PeerEntry pe)
Constructs new route information with the given attributes.

Parameters:
b - The BGPSession with which this route info is associated.
rte - The route held by this entry.
dop - The degree of preference of the route.
feas - Whether or not the route is feasible.
pe - The entry for the peer who advertised this route.
Method Detail

dop

public int dop()
Get the degree of preference.

Specified by:
dop in class RouteInfo

set_dop

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

Specified by:
set_dop in class RouteInfo

peerind

public int peerind()
Description copied from class: RouteInfo
Return the index of the peer who advertised the route.

Specified by:
peerind in class RouteInfo

route

public Route route()
Description copied from class: RouteInfo
Returns the enclosed route.

Specified by:
route in class RouteInfo

set_route

public void set_route(Route r)

feasible

public 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.

Specified by:
feasible in class RouteInfo
Returns:
whether or not the route is feasible

set_feasible

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

Specified by:
set_feasible in class RouteInfo
Parameters:
b - Whether or not the route is feasible.

permissible

public 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.

Specified by:
permissible in class RouteInfo
Returns:
whether or not the route is permissible

set_permissible

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

Specified by:
set_permissible in class RouteInfo
Parameters:
b - Whether or not the route is permissible.

inlocrib

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

Specified by:
inlocrib in class RouteInfo
Returns:
whether or not the route is in the Loc-RIB

set_inlocrib

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

Specified by:
set_inlocrib in class RouteInfo
Parameters:
b - Whether or not the route is in the Loc-RIB.

implicit

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

Specified by:
implicit in class RouteInfo
Returns:
whether or not the last advertisement or withdrawal was implicit

set_implicit

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

Specified by:
set_implicit in class RouteInfo
Parameters:
b - Whether the last advertisement or withdrawal was implicit.

compare

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

Specified by:
compare in class RouteInfo
Returns:
1 if this route is preferred, 0 if they are identically preferable, and -1 if the given route is preferred.

toBytes

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

Specified by:
toBytes in class RouteInfo
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

toString

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

Specified by:
toString in class RouteInfo
Returns:
the route information as a string

toString

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

Specified by:
toString in class RouteInfo
Parameters:
usenhi - Whether or not to use NHI addressing.
Returns:
the route information as a string

finalize

public void finalize()
              throws java.lang.Throwable
Frees segment of allocated out-of-core memory.

Overrides:
finalize in class java.lang.Object
java.lang.Throwable