|
xorp
|
Make requests of the RIB and get responses. More...
#include <next_hop_resolver.hh>
Public Member Functions | |
| NextHopRibRequest (XrlStdRouter *, NextHopResolver< A > &next_hop_resolver, NextHopCache< A > &next_hop_cache, BGPMain &bgp) | |
| bool | register_ribname (const string &r) |
| void | register_nexthop (A nexthop, IPNet< A > net, NhLookupTable< A > *requester) |
| Register interest with the RIB about this next hop. | |
| void | send_next_request () |
| Send the next queued request. | |
| void | register_interest (A nexthop) |
| Actually register interest with the RIB. | |
| void | register_interest_response (const XrlError &error, const bool *resolves, const A *addr, const uint32_t *prefix_len, const uint32_t *real_prefix_len, const A *actual_nexthop, const uint32_t *metric, const A nexthop_interest, const string comment) |
| XRL callback from register_interest. | |
| bool | premature_invalid (const A &addr, const uint32_t &prefix_len) |
| An unmatched invalidate has been received. | |
| bool | tardy_invalid (const A &addr, const uint32_t &prefix_len) |
| An invalidate has been received after we deregistered interest. | |
| bool | deregister_nexthop (A nexthop, IPNet< A > net, NhLookupTable< A > *requester) |
| Deregister interest with the RIB about this next hop. | |
| void | reregister_nexthop (A nexthop, uint32_t ref_cnt, bool resolvable, uint32_t metric) |
| Reregister interest with the RIB about this next hop. | |
| bool | lookup (const A &nexthop, bool &resolvable, uint32_t &metric) const |
| lookup next hop. | |
| void | deregister_from_rib (const A &nexthop, uint32_t prefix_len) |
| void | deregister_interest (A nexthop, uint32_t prefix_len) |
| void | deregister_interest_response (const XrlError &error, A addr, uint32_t prefix_len, string comment) |
| XRL response method. | |
Static Private Member Functions | |
| static void | zapper (RibRequestQueueEntry< A > *req) |
| Used by the destructor to delete all the "RibRequestQueueEntry" objects that have been allocated. | |
Private Attributes | |
| string | _ribname |
| XrlStdRouter * | _xrl_router |
| NextHopResolver< A > & | _next_hop_resolver |
| NextHopCache< A > & | _next_hop_cache |
| BGPMain & | _bgp |
| bool | _busy |
| Are we currently waiting for a response from the RIB. | |
| bool | _invalid |
| IPNet< A > | _invalid_net |
| bool | _tardy_invalid |
| IPNet< A > | _tardy_invalid_net |
| list< RibRequestQueueEntry< A > * > | _queue |
| The queue of outstanding requests. | |
Make requests of the RIB and get responses.
At any time there is only ever one outstanding request to the RIB. Firstly we don't want to overrun the RIB with requests. Secondly it is possible that different next hops in the queue of requests may resolve to the same address/prefix_len answer (see below).
| void NextHopRibRequest< A >::deregister_interest_response | ( | const XrlError & | error, |
| A | addr, | ||
| uint32_t | prefix_len, | ||
| string | comment | ||
| ) |
XRL response method.
| error | Error returned by xrl call. |
| comment | Comment string used for diagnostic purposes. |
| bool NextHopRibRequest< A >::deregister_nexthop | ( | A | nexthop, |
| IPNet< A > | net, | ||
| NhLookupTable< A > * | requester | ||
| ) |
Deregister interest with the RIB about this next hop.
| nexthop | The next hop that we are attempting to resolve. |
| net | The subnet that this next hop is associated with. |
| requester | The lookup table that wants to be notified when the response comes back. |
| bool NextHopRibRequest< A >::lookup | ( | const A & | nexthop, |
| bool & | resolvable, | ||
| uint32_t & | metric | ||
| ) | const |
| void NextHopRibRequest< A >::register_interest | ( | A | nexthop | ) |
| void NextHopRibRequest< A >::register_nexthop | ( | A | nexthop, |
| IPNet< A > | net, | ||
| NhLookupTable< A > * | requester | ||
| ) |
| void NextHopRibRequest< A >::reregister_nexthop | ( | A | nexthop, |
| uint32_t | ref_cnt, | ||
| bool | resolvable, | ||
| uint32_t | metric | ||
| ) |
Reregister interest with the RIB about this next hop.
This method is used when the RIB tells us that all previous registrations have become invalid. This forces us to re-request information. We save the old state (resolvable, metric) just in case the following events occur:
1) Register from next hop table. 2) route_info_invalid from RIB. 3) lookup from decision.
This ordering of events may not be possible just in case it is save the old result and return it in a lookup.