xorp

RegisterTable< A > Class Template Reference

RouteTable which stores routing protocols' registration of interest in changes to certain routes. More...

#include <rt_tab_register.hh>

Inheritance diagram for RegisterTable< A >:
RouteTable< A >

List of all members.

Public Member Functions

 RegisterTable (const string &tablename, RegisterServer &register_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

Detailed Description

template<class A>
class RegisterTable< A >

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.


Constructor & Destructor Documentation

template<class A >
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.

Parameters:
tablenamehuman-readable name for this table for debugging purposes.
register_servera reference to the RIB's RegisterServer instance. The RegisterServer handles IPC requests and responses related to registration of interest.
multicastindicates 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.

Member Function Documentation

template<class A>
int RegisterTable< A >::add_route ( const IPRouteEntry< A > &  route,
RouteTable< A > *  caller 
) [virtual]

Add a new route to the RIB.

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.

Parameters:
routethe new route.
callerthis must be this table's parent table.
Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements RouteTable< A >.

template<class A>
int RegisterTable< A >::delete_route ( const IPRouteEntry< A > *  route,
RouteTable< A > *  caller 
) [virtual]

Delete a route from the RIB.

This will be propagated downstream to the next table, but may also cause the RegisterTable to invalidate a RouteRegister referencing this route.

Parameters:
routethe route being deleted.
callerthis must be this table's parent table.
Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements RouteTable< A >.

template<class 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.

Parameters:
valid_subnetthe subnet of validity from the RouteRegister returned by a prior call to register_route_range.
modulethe XRL target name of the module that is no longer interested in being notified.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
template<class A>
const IPRouteEntry<A>* RegisterTable< A >::lookup_route ( const A &  addr) const [inline, virtual]

Lookup a route in the RIB.

This request will be propagated to the parent table unchanged.

Implements RouteTable< A >.

template<class A>
const IPRouteEntry<A>* RegisterTable< A >::lookup_route ( const IPNet< A > &  net) const [inline, virtual]

Lookup a route in the RIB.

This request will be propagated to the parent table unchanged.

Implements RouteTable< A >.

template<class 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 >.

template<class A>
RouteTable<A>* RegisterTable< A >::parent ( ) [inline, virtual]
Returns:
the parent RouteTable of this RegisterTable.

Reimplemented from RouteTable< A >.

template<class 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.

Parameters:
addrthe IP address of interest.
modulethe XRL target name of the module (typically a routing protocol) that is interested in being notified about changes to this address.
Returns:
a RouteRegister instance detailing the route that is currently being used to route packets to this address and the subset of this route (including the address of interest) for which this answer also applies.
template<class A>
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.

Parameters:
old_parentthe parent RouteTable being replaced (must be the same as the existing parent).
new_parentthe new parent RouteTable.

Implements RouteTable< A >.

template<class A >
string RegisterTable< A >::str ( ) const [virtual]
Returns:
this RegisterTable as a string for debugging purposes.

Implements RouteTable< A >.

template<class A>
TableType RegisterTable< A >::type ( ) const [inline, virtual]
Returns:
the table type (TableType).

Implements RouteTable< A >.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations