|
xorp
|
RouteTable which stores routing protocols' registration of interest in changes to certain routes. More...
#include <rt_tab_register.hh>
Public Member Functions | |
| RegisterTable (const string &tablename, RegisterServer ®ister_server, bool multicast) | |
| RegisterTable constructor. | |
| ~RegisterTable () | |
| RegisterTable destructor. | |
| int | add_route (const IPRouteEntry< A > &route, RouteTable< A > *caller) |
| Add a new route to the RIB. | |
| int | delete_route (const IPRouteEntry< A > *route, RouteTable< A > *caller) |
| Delete a route from the RIB. | |
| const IPRouteEntry< A > * | lookup_route (const IPNet< A > &net) const |
| Lookup a route in the RIB. | |
| const IPRouteEntry< A > * | lookup_route (const A &addr) const |
| Lookup a route in the RIB. | |
| RouteRange< A > * | lookup_route_range (const A &addr) const |
| Lookup a route_range in the RIB. | |
| void | replumb (RouteTable< A > *old_parent, RouteTable< A > *new_parent) |
| Replumb to replace the old parent of this table with a new parent. | |
| RouteTable< A > * | parent () |
| string | str () const |
| void | print () |
| Print the contents of this RegisterTable as a string for debugging purposes. | |
| RouteRegister< A > * | register_route_range (const A &addr, const string &module) |
| register_route_range is called to register interest in routing changes that affect a specific IP address. | |
| int | deregister_route_range (const IPNet< A > &subnet, const string &module) |
| deregister_route_range is called to de-register interest in routing changes following a prior call to register_route_range. | |
| TableType | type () const |
| void | flush () |
| Cause the register server to push out queued changes to the routing protocols. | |
Private Member Functions | |
| RouteRegister< A > * | add_registration (const IPNet< A > &net, const IPRouteEntry< A > *route, const string &module) |
| int | delete_registration (const IPNet< A > &net, const string &module) |
| int | notify_relevant_modules (bool add, const IPRouteEntry< A > &changed_route) |
| int | find_matches (const IPRouteEntry< A > &route) |
| void | notify_invalidated (typename Trie< A, RouteRegister< A > * >::iterator trie_iter) |
| void | notify_route_changed (typename Trie< A, RouteRegister< A > * >::iterator trie_iter, const IPRouteEntry< A > &changed_route) |
Private Attributes | |
| map< string, ModuleData > | _module_names |
| Trie< A, RouteRegister< A > * > | _ipregistry |
| RouteTable< A > * | _parent |
| RegisterServer & | _register_server |
| bool | _multicast |
RouteTable which stores routing protocols' registration of interest in changes to certain routes.
RegisterTable is a RouteTable that is plumbed into the RIB after all the MergedTable and ExtIntTable instances. Thus it seems all winning route updates that will be propagated to the forwarding engine.
It's purpose is to track route changes that affect specific addresses in which routing protocols have expressed an interest, and to notify these routing protocols of any changes.
| RegisterTable< A >::RegisterTable | ( | const string & | tablename, |
| RegisterServer & | register_server, | ||
| bool | multicast | ||
| ) |
RegisterTable constructor.
Unlike other RouteTable constructors, this doesn't plumb itself into the table graph because it is set up before any origin tables, so it doesn't yet have a parent. RIB::initialize_register will do the plumbing later on.
| tablename | human-readable name for this table for debugging purposes. |
| register_server | a reference to the RIB's RegisterServer instance. The RegisterServer handles IPC requests and responses related to registration of interest. |
| multicast | indicates whether or not this RegisterTable is in a multicast RIB. The information is needed when notifying a routing protocol of a change, because the same route might be in both unicast and multicast RIBs. |
| int RegisterTable< A >::add_route | ( | const IPRouteEntry< A > & | route, |
| RouteTable< A > * | caller | ||
| ) | [virtual] |
This will be propagated downstream to the next table, but may also cause the RegisterTable to invalidate a RouteRegister because the new route overlaps an existing registration.
| route | the new route. |
| caller | this must be this table's parent table. |
Implements RouteTable< A >.
| int RegisterTable< A >::delete_route | ( | const IPRouteEntry< A > * | route, |
| RouteTable< A > * | caller | ||
| ) | [virtual] |
This will be propagated downstream to the next table, but may also cause the RegisterTable to invalidate a RouteRegister referencing this route.
| route | the route being deleted. |
| caller | this must be this table's parent table. |
Implements RouteTable< A >.
| int RegisterTable< A >::deregister_route_range | ( | const IPNet< A > & | subnet, |
| const string & | module | ||
| ) |
deregister_route_range is called to de-register interest in routing changes following a prior call to register_route_range.
| valid_subnet | the subnet of validity from the RouteRegister returned by a prior call to register_route_range. |
| module | the XRL target name of the module that is no longer interested in being notified. |
| const IPRouteEntry<A>* RegisterTable< A >::lookup_route | ( | const A & | addr | ) | const [inline, virtual] |
This request will be propagated to the parent table unchanged.
Implements RouteTable< A >.
| const IPRouteEntry<A>* RegisterTable< A >::lookup_route | ( | const IPNet< A > & | net | ) | const [inline, virtual] |
This request will be propagated to the parent table unchanged.
Implements RouteTable< A >.
| RouteRange<A>* RegisterTable< A >::lookup_route_range | ( | const A & | addr | ) | const [inline, virtual] |
Lookup a route_range in the RIB.
This request will be propagated to the parent table unchanged. It is not expected this will be called, but not prohibited.
Implements RouteTable< A >.
| RouteTable<A>* RegisterTable< A >::parent | ( | ) | [inline, virtual] |
Reimplemented from RouteTable< A >.
| RouteRegister< A > * RegisterTable< A >::register_route_range | ( | const A & | addr, |
| const string & | module | ||
| ) |
register_route_range is called to register interest in routing changes that affect a specific IP address.
| addr | the IP address of interest. |
| module | the XRL target name of the module (typically a routing protocol) that is interested in being notified about changes to this address. |
| void RegisterTable< A >::replumb | ( | RouteTable< A > * | old_parent, |
| RouteTable< A > * | new_parent | ||
| ) | [virtual] |
Replumb to replace the old parent of this table with a new parent.
| old_parent | the parent RouteTable being replaced (must be the same as the existing parent). |
| new_parent | the new parent RouteTable. |
Implements RouteTable< A >.
| string RegisterTable< A >::str | ( | ) | const [virtual] |
Implements RouteTable< A >.
| TableType RegisterTable< A >::type | ( | ) | const [inline, virtual] |
Implements RouteTable< A >.