|
|
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).
NextHopRibRequest (XrlStdRouter *,
NextHopResolver<A>& next_hop_resolver,
NextHopCache<A>& next_hop_cache,
BGPMain& bgp)
| NextHopRibRequest |
~NextHopRibRequest ()
| ~NextHopRibRequest |
bool register_ribname (const string& r)
| register_ribname |
void register_nexthop (A nexthop, IPNet<A> net,
NhLookupTable<A> *requester)
| register_nexthop |
Register interest with the RIB about this next hop.
Parameters:
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. |
void send_next_request ()
| send_next_request |
void register_interest (A nexthop)
| register_interest |
Actually register interest with the RIB.
A small method that will be specialized to differentiate between IPv4 and IPv6.
Parameters:
nexthop | The next hop that we are attempting to resolve. |
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)
| register_interest_response |
XRL callback from register_interest.
bool premature_invalid (const A& addr, const uint32_t& prefix_len)
| premature_invalid |
An unmatched invalidate has been received.
bool deregister_nexthop (A nexthop, IPNet<A> net,
NhLookupTable<A> *requester)
| deregister_nexthop |
Deregister interest with the RIB about this next hop.
Parameters:
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. |
Returns: True if an entry was found to remove.
void reregister_nexthop (A nexthop, uint32_t ref_cnt, bool resolvable,
uint32_t metric)
| reregister_nexthop |
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.
Parameters:
nexthop | The next hop that we are attempting to resolve. |
ref_cnt | The number of subnets using this nexthop. |
resolvable | Was the previous result resolvable. |
metric | If the previous result was resolvable the metric. |
bool lookup (const A& nexthop, bool& resolvable, uint32_t& metric)
| lookup |
[const]
lookup next hop.
Parameters:
nexthop | Next hop. |
resolvable | Is this route resolvable. |
metric | If this route is resolvable the metric of this route. |
Returns: True if this next hop is found.
void deregister_from_rib (const A& nexthop, uint32_t prefix_len)
| deregister_from_rib |
void deregister_interest (A nexthop, uint32_t prefix_len)
| deregister_interest |
void deregister_interest_response (const XrlError& error,
A addr,
uint32_t prefix_len,
string comment)
| deregister_interest_response |
XRL response method.
Parameters:
error | Error returned by xrl call. |
comment | Comment string used for diagnostic purposes. |