xorp

NextHopResolver< A > Class Template Reference

Inheritance diagram for NextHopResolver< A >:
DummyNextHopResolver< A > DummyNextHopResolver2< A > DummyResolver< A >

List of all members.

Public Member Functions

 NextHopResolver (XrlStdRouter *xrl_router, EventLoop &eventloop, BGPMain &bgp)
void add_decision (DecisionTable< A > *decision)
 Add decision.
bool register_ribname (const string &r)
 Set the rib's name, allows for having a dummy rib or not having a RIB at all.
virtual bool register_nexthop (A nexthop, IPNet< A > net_from_route, NhLookupTable< A > *requester)
 Register interest in this nexthop.
virtual void deregister_nexthop (A nexthop, IPNet< A > net_from_route, NhLookupTable< A > *requester)
 De-Register interest in this nexthop.
virtual bool lookup (const A nexthop, bool &resolvable, uint32_t &metric) const
 Lookup next hop.
bool rib_client_route_info_changed (const A &addr, const uint32_t &prefix_len, const A &nexthop, const uint32_t &metric)
 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)
 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.
void next_hop_changed (A nexthop, bool old_resolves, uint32_t old_metric)
 Next hop changed.
NextHopRibRequest< A > * get_next_hop_rib_request ()
 Get NextHopRibRequest pointer.
EventLoopeventloop ()
 Get a reference to the main timer list.

Protected Attributes

list< DecisionTable< A > * > _decision

Private Attributes

string _ribname
XrlStdRouter_xrl_router
EventLoop_eventloop
BGPMain_bgp
NextHopCache< A > _next_hop_cache
NextHopRibRequest< A > _next_hop_rib_request

template<class A>
class NextHopResolver< A >


Member Function Documentation

template<class A>
void NextHopResolver< A >::add_decision ( DecisionTable< A > *  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.
template<class A>
void NextHopResolver< A >::deregister_nexthop ( nexthop,
IPNet< A >  net_from_route,
NhLookupTable< A > *  requester 
) [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.

Reimplemented in DummyResolver< A >.

template<class A>
NextHopRibRequest<A>* NextHopResolver< A >::get_next_hop_rib_request ( ) [inline]

Get NextHopRibRequest pointer.

Used for testing.

template<class A>
bool NextHopResolver< A >::lookup ( const A  nexthop,
bool &  resolvable,
uint32_t &  metric 
) 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.

Reimplemented in DummyNextHopResolver< A >.

template<class A>
void NextHopResolver< A >::next_hop_changed ( nexthop)

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.
template<class A>
void NextHopResolver< A >::next_hop_changed ( nexthop,
bool  old_resolves,
uint32_t  old_metric 
)

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.
template<class A>
bool NextHopResolver< A >::register_nexthop ( nexthop,
IPNet< A >  net_from_route,
NhLookupTable< A > *  requester 
) [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.

Reimplemented in DummyResolver< A >.


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