SSF.OS.BGP4
Class LocRIB

java.lang.Object
  |
  +--SSF.OS.BGP4.Util.RadixTree
        |
        +--SSF.OS.BGP4.RIBElement
              |
              +--SSF.OS.BGP4.LocRIB

public class LocRIB
extends RIBElement

The Loc-RIB section of BGP's Routing Information Base.


Field Summary
 
Fields inherited from class SSF.OS.BGP4.RIBElement
bgp, rtes, version
 
Method Summary
 RouteInfo add(RouteInfo info)
          Adds route information.
 java.util.ArrayList remove_all()
          Removes all route information from the Loc-RIB element, as well as from the local forwarding table, and returns it as a list.
 RouteInfo remove(IPaddress ipa)
          Removes the route information corresponding to the given route destination from both this Loc-RIB and the local forwarding table.
 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 Loc-RIB into a series of bytes and inserts them into a given byte array.
 
Methods inherited from class SSF.OS.BGP4.RIBElement
approxBytes, bytes2str, find, get_all_routes, get_dests, get_less_specifics, get_more_specifics, get_routes, hdr2str, is_less_specific, toString, toString
 
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
 

Method Detail

add

public RouteInfo add(RouteInfo info)
Adds route information. If route information with the same NLRI already exists, then the add fails and the pre-existing information is returned.

Overrides:
add in class RIBElement
Parameters:
info - The route information to add.
Returns:
pre-existing route information, if any

replace

public RouteInfo replace(RouteInfo info)
Adds route information, replacing any pre-existing information with the same NLRI. Also performs the appropriate actions on the local forwarding table.

Overrides:
replace in class RIBElement
Parameters:
info - The route information to add.
Returns:
the pre-existing route information, or null if there was none

remove

public RouteInfo remove(IPaddress ipa)
Removes the route information corresponding to the given route destination from both this Loc-RIB and the local forwarding table.

Overrides:
remove in class RIBElement
Parameters:
ipa - The destination of the route information to remove.
Returns:
the removed route information

remove_all

public java.util.ArrayList remove_all()
Removes all route information from the Loc-RIB element, as well as from the local forwarding table, and returns it as a list.

Overrides:
remove_all in class RIBElement
Returns:
a list of removed route information

toBytes

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

Overrides:
toBytes in class RIBElement
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