class NextHopResolver

Next hop resolvability and IGP distances are accessed through this class. More...

Definition#include <next_hop_resolver.hh>
Template formNextHopResolver<class A>
Inherited byDummyNextHopResolver
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Members


Detailed Description

Next hop resolvability and IGP distances are accessed through this class.

Next hop resolvability and IGP distances are retrieved from the RIB and cached here in BGP. This retrieval process implicitly registers interest with the RIB regarding these next hops. Thus any changes in these next hops is signalled by the RIB to BGP via callbacks.

If the state of a next hop changes (resolvable/unresolvable), or an IGP distance changes, then it is possible that a new route may now win the decision process. The decision process must therefore be re-run for all routes that are affected by a next hop change. This re-run of the decision process is achieved calling "igp_nexthop_changed" on the decision process.

What questions can be asked about next hops? Is a next hop resolvable and if it is, what is the IGP distance.

To answer questions about next hops three interfaces are supported: 1) An asynchronous interface that registers a callback which will be called when a response becomes available. For use by the (next hop) route table before decision. By the time a route gets to decision it *must* be known if the route is resolvable. 2) A synchronous interface for use by decision. It is a fatal error if this interface is called and the next hop is not in the cache. As by the time decision is called the cache should have been populated by use of the asynchronous interface. 3) A synchronous debugging interface.

Cache maintainance: Every stored SubnetRoute in every rib in has a next hop. Every unique next hop has an entry in the cache. If a next hop lookup through the asynchronous interface causes a cache miss then an entry is created with a reference count of 1. Subsequent lookups through the next hop interface will cause the reference count to be incremented by 1. An interface to increase the reference count by more than one also exists. All route deletions should explicitly call a routine in here to decrement the reference count.

 NextHopResolver (XrlStdRouter *xrl_router, EventLoop& eventloop)

NextHopResolver

 ~NextHopResolver ()

~NextHopResolver

[virtual]

void  add_decision (DecisionTable<A> *decision)

add_decision

Add decision.

Pass a pointer to the decision table into the next hop resolver. This pointer is used to notify the decision table when a next hop metric changes.

Parameters:
decisionPointer to the decision table.

bool  register_ribname (const string& r)

register_ribname

Set the rib's name, allows for having a dummy rib or not having a RIB at all.

bool  register_nexthop (A nexthop, IPNet<A> net_from_route, NhLookupTable<A> *requester)

register_nexthop

[virtual]

Register interest in this nexthop.

Parameters:
nexthopNexthop.
net_from_routeThe net that is associated with this nexthop in the NextHopLookupTable. Treated as an opaque id.
requesterOnce the registration with the RIB suceeds the requester is called back.

Returns: True if the registration succeed.

void  deregister_nexthop (A nexthop, IPNet<A> net_from_route, NhLookupTable<A> *requester)

deregister_nexthop

[virtual]

De-Register interest in this nexthop.

Parameters:
nexthopNexthop.
net_from_routeThe net that is associated with this nexthop in the NextHopLookupTable. Treated as an opaque id.
requesterOriginal requester, not used.

Returns: True if the registration succeed.

bool  lookup (const A nexthop, bool& resolvable, uint32_t& metric)

lookup

[const virtual]

Lookup next hop.

If a "register_nexthop" request has been made and callback has taken place via the "requester" pointer, then the lookup is guaranteed to work.

Parameters:
nexthopNext hop.
resolvableIs this route resolvable.
metricIf this route is resolvable the metric of this route.

Returns: True if this next hop is found.

bool  rib_client_route_info_changed (const A& addr, const uint32_t& real_prefix_len, const A& nexthop, const uint32_t& metric)

rib_client_route_info_changed

Call from the RIB to notify us that a metric has changed.

bool  rib_client_route_info_invalid (const A& addr, const uint32_t& prefix_len)

rib_client_route_info_invalid

Call from the RIB to notify us that any registrations with this address and prefix_len are now invalid.

void  next_hop_changed (A nexthop)

next_hop_changed

Next hop changed.

Whenever a next hop changes this method should be called and the change will be rippled up to the decision process.

Parameters:
nexthopThe next hop that has changed.

void  next_hop_changed (A nexthop, bool old_resolves, uint32_t old_metric)

next_hop_changed

Next hop changed.

Whenever a next hop changes this method should be called and the change will be rippled up to the decision process. However if a change occurs but the metrics don't change don't bother to ripple up the change there is no point.

Parameters:
nexthopThe next hop that has changed.
old_resolvesThe old resolve value.
old_metricThe old metric value.

NextHopRibRequest<A> * get_next_hop_rib_request ()

get_next_hop_rib_request

Get NextHopRibRequest pointer.

Used for testing.

EventLoop&  eventloop ()

eventloop

Get a reference to the main timer list

bool  status (string& reason)

status

[const]

Get the status of the NextHopResolver

Parameters:
reasonthe human-readable reason for any failure

Returns: false if NextHopResolver has suffered a fatal error, true otherwise

DecisionTable<A> * _decision

_decision

[protected]


Generated by: pavlin on possum.icir.org on Mon Jun 9 13:23:59 2003, using kdoc 2.0a54+XORP.