|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--SSF.OS.BGP4.Util.RadixTree
|
+--SSF.OS.BGP4.RIBElement
An element of a RIB. A single RIBElement is either Loc-RIB, or part of Adj-RIBs-In or Adj-RIBs-Out. An array of RIBElements make up Adj-RIBs-In, and the same is true for Adj-RIBs-Out (since they each have one element per peer).
| Field Summary | |
protected BGPSession |
bgp
A reference to the local BGP protocol session. |
protected java.util.HashMap |
rtes
A table mapping NLRI to routes. |
protected int |
version
The version number of the table. |
| Method Summary | |
RouteInfo |
add(RouteInfo info)
Adds route information. |
int |
approxBytes(boolean usenhi)
Determines the approximate number of bytes that would be required when converting this RIB element to a series of bytes with toBytes. |
static int |
bytes2str(java.lang.StringBuffer ribstr,
byte[] bytes,
int bindex,
java.lang.String ind,
boolean usenhi)
Converts a series of bytes into a string represention of a RIB element. |
RouteInfo |
find(IPaddress ipa)
Attempts to find information for a given destination. |
java.util.ArrayList |
get_all_routes()
Constructs and returns a list of all route information in the RIB element. |
java.util.Iterator |
get_dests()
Returns an iterator for enumerating the destinations (IP addresses) of all contained routes. |
java.util.ArrayList |
get_less_specifics(IPaddress ipa)
Finds any routes with overlapping but less specific NLRI than the given IP address prefix. |
java.util.ArrayList |
get_more_specifics(IPaddress ipa)
Finds any routes with overlapping but more specific NLRI than the given IP address prefix. |
java.util.Iterator |
get_routes()
Returns an iterator for enumerating all contained routes. |
protected java.lang.String |
hdr2str(java.lang.String ind,
boolean usenhi)
Composes into a string of the header/title text used when printing out a RIB element. |
boolean |
is_less_specific(IPaddress ipa)
Determines if there are any routes with more specific NLRI than the given IP address prefix. |
java.util.ArrayList |
remove_all()
Removes all route information in the RIB element and returns it as a list. |
RouteInfo |
remove(IPaddress ipa)
Removes the route information corresponding to the given route destination. |
RouteInfo |
replace(RouteInfo info)
Adds route information, replacing any pre-existing information with the same NLRI. |
int |
toBytes(byte[] bytes,
int bindex,
boolean usenhi)
Converts this RIB element into a series of bytes and inserts them into a given byte array. |
java.lang.String |
toString()
Returns this RIB element as a string. |
java.lang.String |
toString(java.lang.String ind,
boolean usenhi)
Returns this RIB element as a string, indenting each line with the given prefix string. |
| Methods inherited from class SSF.OS.BGP4.Util.RadixTree |
add, find, get_ancestors, get_descendants, has_descendants, oldest_ancestor, print, prune, remove, replace, root, youngest_ancestor |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected BGPSession bgp
protected java.util.HashMap rtes
protected int version
| Method Detail |
public RouteInfo find(IPaddress ipa)
ipa - The destination IP address prefix to search for info about.
public RouteInfo add(RouteInfo info)
info - The route information to add.
public RouteInfo replace(RouteInfo info)
info - The route information to add.
public RouteInfo remove(IPaddress ipa)
ipa - The destination of the route information to remove.
public java.util.ArrayList remove_all()
public java.util.ArrayList get_all_routes()
public java.util.ArrayList get_less_specifics(IPaddress ipa)
ipa - An IP address prefix to find less specific NLRI than.
public java.util.ArrayList get_more_specifics(IPaddress ipa)
ipa - An IP address prefix to find more specific NLRI than.
public boolean is_less_specific(IPaddress ipa)
ipa - An IP address prefix to find more specific NLRI than.
public java.util.Iterator get_dests()
public java.util.Iterator get_routes()
public int approxBytes(boolean usenhi)
toBytes. It is more likely than not to be an overestimate.
Using NHI addressing makes a difference, so it is included as a parameter.
usenhi - Whether or not to use NHI addressing.
toBytes
public int toBytes(byte[] bytes,
int bindex,
boolean usenhi)
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.
public static int bytes2str(java.lang.StringBuffer ribstr,
byte[] bytes,
int bindex,
java.lang.String ind,
boolean usenhi)
ribstr - A StringBuffer into which the results will be placed.
It must be initialized to the empty string.bytes - The byte array to convert to a RIB element.bindex - The index into the given byte array from which to begin
converting.ind - The string with which to indent each line.usenhi - Whether or not to use NHI addressing.
protected java.lang.String hdr2str(java.lang.String ind,
boolean usenhi)
ind - The string with which to indent each line.usenhi - Whether or not NHI addressing is being used.
public java.lang.String toString(java.lang.String ind,
boolean usenhi)
ind - The string with which to indent each line.usenhi - Whether or not to use NHI addressing.
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||