xorp

RouteRegister< A > Class Template Reference

RouteRegister stores a registration of interest in a subset of a route. More...

#include <rt_tab_register.hh>

List of all members.

Public Member Functions

 RouteRegister (const IPNet< A > &valid_subnet, const IPRouteEntry< A > *route, const ModuleData &module)
 RouteRegister Constructor.
 ~RouteRegister ()
 Destructor.
int add_registrant (const ModuleData &module)
 add_registrant is called when an additional routing protocol expresses interest in the routing information already held by this RouteRegister instance.
int delete_registrant (const ModuleData &module)
 delete_registrant is called when a routing protocol that was previously interested in this RouteRegister de-registers itself.
void mark_modules () const
 mark_modules is called when the routing information matching this registration changes.
int size () const
const IPNet< A > & valid_subnet () const
const IPRouteEntry< A > * route () const
list< string > module_names () const
string str () const

Private Attributes

map< string, ModuleData_modules
IPNet< A > _valid_subnet
const IPRouteEntry< A > * _route

Detailed Description

template<class A>
class RouteRegister< A >

RouteRegister stores a registration of interest in a subset of a route.

A RouteRegister instance is used to store the registration of interest in a route. Suppose there are two overlapping routes: 1.0.0.0/16 and 1.0.1.0/24. Now a routing protocol "bgp" expresses interest in route changes that affect 1.0.0.27, which is routed using 1.0.0.0/16. The relevant RouteRegister would then hold: route: route entry for 1.0.0.0/16 valid_subnet: 1.0.0.0/24 moduledata: {"bgp"} The valid_subnet is 1.0.0.0/24 because this is the largest subset of 1.0.0.0/16 that encompasses 1.0.0.27 and doesn't overlap any other route.

If a subsequent request from routing protocol "pim" were to come along for 1.0.0.54, then this would be stored on the same RouteRegister instance, but the ModuleData would be expanded to include "pim".


Constructor & Destructor Documentation

template<class A>
RouteRegister< A >::RouteRegister ( const IPNet< A > &  valid_subnet,
const IPRouteEntry< A > *  route,
const ModuleData module 
) [inline]

RouteRegister Constructor.

Parameters:
netthe subset of the route for which this registration is valid.
routethe route in which interest was registered.
modulethe ModuleData instance refering to the routing protocol that registered interest.

Member Function Documentation

template<class A>
int RouteRegister< A >::add_registrant ( const ModuleData module) [inline]

add_registrant is called when an additional routing protocol expresses interest in the routing information already held by this RouteRegister instance.

Parameters:
modulethe ModuleData instance refering to the additional routing protocol that just registered interest.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
template<class A >
int RouteRegister< A >::delete_registrant ( const ModuleData module)

delete_registrant is called when a routing protocol that was previously interested in this RouteRegister de-registers itself.

Parameters:
modulethe ModuleData instance of the routing protocol that de-registered.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
template<class A>
void RouteRegister< A >::mark_modules ( ) const [inline]

mark_modules is called when the routing information matching this registration changes.

It marks the original instances of the ModuleData as needing nitification.

template<class A>
list<string> RouteRegister< A >::module_names ( ) const [inline]
Returns:
the module names interested in this RouteRegister as a list of strings.
template<class A>
const IPRouteEntry<A>* RouteRegister< A >::route ( ) const [inline]
Returns:
the RouteRegister's route.
template<class A>
int RouteRegister< A >::size ( ) const [inline]
Returns:
the number of modules interested in this RouteRegister.
template<class A >
string RouteRegister< A >::str ( ) const
Returns:
this RouteRegister as a string for debugging purposes.
template<class A>
const IPNet<A>& RouteRegister< A >::valid_subnet ( ) const [inline]
Returns:
the subnet of this RouteRegister's route for which this registration is valid.

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