|
|
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".
RouteRegister (const IPNet<A>& valid_subnet,
const IPRouteEntry<A>* route,
const ModuleData* module)
| RouteRegister |
RouteRegister Constructor
Parameters:
net | the subset of the route for which this registration is valid. |
route | the route in which interest was registered. |
module | the ModuleData instance refering to the routing protocol that registered interest. |
~RouteRegister ()
| ~RouteRegister |
int add_registrant (const ModuleData* module)
| add_registrant |
add_registrant is called when an additional routing protocol expresses interest in the routing information already held by this RouteRegister instance.
Parameters:
module | the ModuleData instance refering to the additional routing protocol that just registered interest. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_registrant (const ModuleData* module)
| delete_registrant |
delete_registrant is called when a routing protocol that was previously interested in this RouteRegister de-registers itself.
Parameters:
module | the ModuleData instance of the routing protocol that de-registered. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
void mark_modules ()
| mark_modules |
[const]
mark_modules is called when the routing information matching this registration changes. It marks the original instances of the ModuleData as needing nitification.
int size ()
| size |
[const]
Returns: the number of modules interested in this RouteRegister.
const IPNet<A>& valid_subnet ()
| valid_subnet |
[const]
Returns: the subnet of this RouteRegister's route for which this registration is valid.
const IPRouteEntry<A>* route ()
| route |
[const]
Returns: the RouteRegister's route.
list<string> module_names ()
| module_names |
[const]
Returns: the module names interested in this RouteRegister as a list of strings.
string str ()
| str |
[const]
Returns: this RouteRegister as a string for debugging purposes.