|
xorp
|
RouteTable that receives and stores raw routes sent by routing protocols. More...
#include <rt_tab_origin.hh>
Public Types | |
|
typedef Trie< A, const IPRouteEntry< A > * > | RouteContainer |
Public Member Functions | |
| OriginTable (const string &tablename, uint32_t admin_distance, ProtocolType protocol_type, EventLoop &eventloop) | |
| OriginTable constructor. | |
| ~OriginTable () | |
| OriginTable destructor. | |
| int | add_route (const IPRouteEntry< A > &route) |
| Add a route to the OriginTable. | |
| int | add_route (const IPRouteEntry< A > &, RouteTable< A > *) |
| Generic RouteTable method that is not used on OriginTable. | |
| int | delete_route (const IPNet< A > &net) |
| Delete a route from the OriginTable. | |
| int | delete_route (const IPRouteEntry< A > *, RouteTable< A > *) |
| Generic RouteTable method that is not used on OriginTable. | |
| void | delete_all_routes () |
| Delete all the routes that are in this OriginTable. | |
| void | routing_protocol_shutdown () |
| Delete all the routes that are in this OriginTable, and propagate the deletions downstream. | |
| const IPRouteEntry< A > * | lookup_route (const IPNet< A > &net) const |
| Lookup a specific subnet to see if it is in this OriginTable. | |
| const IPRouteEntry< A > * | lookup_route (const A &addr) const |
| Lookup an IP address to get the most specific (longest prefix length) route in the OriginTable that matches this address. | |
| RouteRange< A > * | lookup_route_range (const A &addr) const |
| Lookup an IP addressto get the most specific (longest prefix length) route in the OriginTable that matches this address, along with the RouteRange information for this address and route. | |
| uint32_t | admin_distance () const |
| int | protocol_type () const |
| TableType | type () const |
| void | replumb (RouteTable< A > *, RouteTable< A > *) |
| Generic RouteTable method that is not used on OriginTable. | |
| string | str () const |
| Render the OriginTable as a string for debugging purposes. | |
| uint32_t | generation () const |
| Get the number of times routing protocol has been shutdown and restarted. | |
| uint32_t | route_count () const |
| Get the number of routes held internally. | |
| const RouteContainer & | route_container () const |
| Get the trie. | |
Private Attributes | |
| uint32_t | _admin_distance |
| ProtocolType | _protocol_type |
| EventLoop & | _eventloop |
| RouteContainer * | _ip_route_table |
| uint32_t | _gen |
RouteTable that receives and stores raw routes sent by routing protocols.
OriginTable is a RouteTable that accepts route_add requests from a single routing protocol, stores the route, and propagates it downstream. It also answers lookup_route and lookup_route_range requests from downstream using the routes it has stored.
Its template class, A, must be either the IPv4 class of the IPv6 class.
| OriginTable< A >::OriginTable | ( | const string & | tablename, |
| uint32_t | admin_distance, | ||
| ProtocolType | protocol_type, | ||
| EventLoop & | eventloop | ||
| ) |
OriginTable constructor.
| tablename | typically the name of the routing protocol that supplies routes to this origin table, or "connected" for the OriginTable that holds directly connected routes, or "static" for the OriginTable that holds locally configured static routes. |
| admin_distance | the default administrative distance for routes in this table. |
| protocol_type | the routing protocol type (ProtocolType). |
| eventloop | the main event loop. |
| int OriginTable< A >::add_route | ( | const IPRouteEntry< A > & | route | ) |
Add a route to the OriginTable.
The route must not already be in the OriginTable.
| route | the route entry to be added. |
| int OriginTable< A >::add_route | ( | const IPRouteEntry< A > & | , |
| RouteTable< A > * | |||
| ) | [virtual] |
Generic RouteTable method that is not used on OriginTable.
Implements RouteTable< A >.
| uint32_t OriginTable< A >::admin_distance | ( | ) | const [inline] |
| void OriginTable< A >::delete_all_routes | ( | ) |
Delete all the routes that are in this OriginTable.
The deletion is not propagated downstream, so this is only useful when shutting down the RIB.
| int OriginTable< A >::delete_route | ( | const IPRouteEntry< A > * | , |
| RouteTable< A > * | |||
| ) | [virtual] |
Generic RouteTable method that is not used on OriginTable.
Implements RouteTable< A >.
| int OriginTable< A >::delete_route | ( | const IPNet< A > & | net | ) |
Delete a route from the OriginTable.
| const IPRouteEntry< A > * OriginTable< A >::lookup_route | ( | const IPNet< A > & | net | ) | const [virtual] |
Lookup a specific subnet to see if it is in this OriginTable.
| net | the subnet to look up. |
Implements RouteTable< A >.
| const IPRouteEntry< A > * OriginTable< A >::lookup_route | ( | const A & | addr | ) | const [virtual] |
Lookup an IP address to get the most specific (longest prefix length) route in the OriginTable that matches this address.
| addr | the IP address to look up. |
Implements RouteTable< A >.
| RouteRange< A > * OriginTable< A >::lookup_route_range | ( | const A & | addr | ) | const [virtual] |
Lookup an IP addressto get the most specific (longest prefix length) route in the OriginTable that matches this address, along with the RouteRange information for this address and route.
| addr | the IP address to look up. |
Implements RouteTable< A >.
| int OriginTable< A >::protocol_type | ( | ) | const [inline] |
| TableType OriginTable< A >::type | ( | ) | const [inline, virtual] |
Implements RouteTable< A >.