Public Member Functions |
|
| SubnetRoute (const SubnetRoute< A > &route_to_clone) |
| | SubnetRoute copy constructor.
|
| | SubnetRoute (const IPNet< A > &net, PAListRef< A > attributes, const SubnetRoute< A > *parent_route) |
| | SubnetRoute constructor.
|
| | SubnetRoute (const IPNet< A > &net, PAListRef< A > attributes, const SubnetRoute< A > *parent_route, uint32_t igp_metric) |
| | SubnetRoute constructor.
|
| bool | operator== (const SubnetRoute< A > &them) const |
| | Equality comparison for SubnetRoutes.
|
| const IPNet< A > & | net () const |
| PAListRef< A > | attributes () const |
| bool | in_use () const |
| void | set_in_use (bool used) const |
| | Record whether or not this route is in use.
|
| bool | is_winner () const |
| | returns true if the route was chosen by the routing decision process as the winning route for this subnet.
|
| void | set_is_winner (uint32_t igp_metric) const |
| | when a route is chosen by the routing decision process as the winning route for this subnet, set_is_winner should be called to record this fact and to record the igp_metric at the time the route was chosen.
|
|
void | set_is_not_winner () const |
| | when a route fails to be chosen by the routing decision process as the winning route for this subnet, set_is_not_winner should be called to record this fact.
|
|
void | set_nexthop_resolved (bool resolved) const |
| | record whether or not a route's nexthop resolved
|
|
bool | nexthop_resolved () const |
| | did the route's nexthop resolve when it was passed through the NextHop resolver table.
|
| bool | is_filtered () const |
| | is_filtered returns true if the route was filtered out by the incoming filter bank, false otherwise.
|
| void | set_filtered (bool filtered) const |
| | set_filtered record whether or not the route was filtered out by the incoming filter bank.
|
|
bool | is_deleted () const |
| | is_deleted returns true if the route has already been deleted (but the class instance representing it has not been because it's reference count is non-zero)
|
| string | str () const |
| uint32_t | igp_metric () const |
| const SubnetRoute< A > * | original_route () const |
| const SubnetRoute< A > * | parent_route () const |
| void | set_parent_route (const SubnetRoute< A > *parent) |
| | record the original version of this route, before any filters were applied.
|
| void | unref () const |
| | delete this route
|
|
uint16_t | refcount () const |
| const PolicyTags & | policytags () const |
| void | set_policytags (const PolicyTags &tags) const |
| | Replaced policy tags of route.
|
|
const RefPf & | policyfilter (uint32_t i) const |
|
void | set_policyfilter (uint32_t i, const RefPf &pf) const |
|
void | set_aggr_brief_mode () const |
| | Set the "brief" mode flag on an candidate for aggregation.
|
|
void | clear_aggr_brief_mode () const |
| | Clear the "brief" mode flag on an candidate for aggregation.
|
|
bool | aggr_brief_mode () const |
| | Read the "brief" aggregation mode flag.
|
| void | set_aggr_prefix_len (uint32_t preflen) |
| | Set the target prefix length on an candidate for aggregation.
|
| uint32_t | aggr_prefix_len () const |
| | Read the aggregation prefix length marker.
|
Protected Member Functions |
| | ~SubnetRoute () |
| | protected SubnetRoute destructor.
|
Private Member Functions |
|
void | bump_refcount (int delta) const |
|
const SubnetRoute< A > & | operator= (const SubnetRoute< A > &) |
Private Attributes |
|
IPNet< A > | _net |
| | _net is the subnet (address and prefix) for this route.
|
| PAListRef< A > | _attributes |
| | _attributes is a pointer to the path attribute list for this route.
|
| const SubnetRoute< A > * | _parent_route |
| | _parent_route is a pointer to the original version of this route, before any filters modified it.
|
|
RouteMetaData | _metadata |
Friends |
|
class | SubnetRouteRef< A > |
|
class | SubnetRouteConstRef< A > |
template<class A>
class SubnetRoute< A >
SubnetRoute holds a BGP routing table entry.
SubnetRoute is the basic class used to hold a BGP routing table entry in BGP's internal representation. It's templated so the same code can be used to hold IPv4 or IPv6 routes - their representation is essentially the same internally, even though they're encoded differently on the wire by the BGP protocol. A route essentially consists of the subnet (address and prefix) referred to by the route, a BGP path attribute list, and some metadata for our own use. When a route update from BGP comes it, it is split into multiple subnet routes, one for each NLRI (IPv4) or MP_REACH (IPv6) attribute. SubnetRoute is also the principle way routing information is passed around internally in our BGP implementation.
SubnetRoute is reference-counted - delete should NOT normally be called directly on a SubnetRoute; instead unref should be called, which will decrement the reference count, and delete the instance if the reference count has reached zero.