\hypertarget{classNextHopRibRequest}{
\section{NextHopRibRequest$<$ A $>$ Class Template Reference}
\label{classNextHopRibRequest}\index{NextHopRibRequest@{NextHopRibRequest}}
}


Make requests of \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} and get responses.  




{\ttfamily \#include $<$next\_\-hop\_\-resolver.hh$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classNextHopRibRequest_a56e0770a5ade09cf2bb5129b6709c2bb}{
{\bfseries NextHopRibRequest} (\hyperlink{classXrlStdRouter}{XrlStdRouter} $\ast$, \hyperlink{classNextHopResolver}{NextHopResolver}$<$ A $>$ \&next\_\-hop\_\-resolver, \hyperlink{classNextHopCache}{NextHopCache}$<$ A $>$ \&next\_\-hop\_\-cache, \hyperlink{classBGPMain}{BGPMain} \&bgp)}
\label{classNextHopRibRequest_a56e0770a5ade09cf2bb5129b6709c2bb}

\item 
\hypertarget{classNextHopRibRequest_a356ea027076ecc8744449f6d1f6aa3e4}{
bool {\bfseries register\_\-ribname} (const string \&r)}
\label{classNextHopRibRequest_a356ea027076ecc8744449f6d1f6aa3e4}

\item 
void \hyperlink{classNextHopRibRequest_ac5110febb472eb6a86af1d58a65edab0}{register\_\-nexthop} (A nexthop, \hyperlink{classIPNet}{IPNet}$<$ A $>$ net, \hyperlink{classNhLookupTable}{NhLookupTable}$<$ A $>$ $\ast$requester)
\begin{DoxyCompactList}\small\item\em Register interest with \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} about this next hop. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopRibRequest_a098434405a1b25bdc4f1eaef7ad89254}{
void \hyperlink{classNextHopRibRequest_a098434405a1b25bdc4f1eaef7ad89254}{send\_\-next\_\-request} ()}
\label{classNextHopRibRequest_a098434405a1b25bdc4f1eaef7ad89254}

\begin{DoxyCompactList}\small\item\em \hyperlink{structSend}{Send} \hyperlink{protocolthe-p}{the} next queued request. \item\end{DoxyCompactList}\item 
void \hyperlink{classNextHopRibRequest_a8eacb8880df3c175b0cb3a43bee06e1b}{register\_\-interest} (A nexthop)
\begin{DoxyCompactList}\small\item\em Actually register interest with \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB}. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopRibRequest_a3584b6a0c0a0e6de98dca89196e4b864}{
void \hyperlink{classNextHopRibRequest_a3584b6a0c0a0e6de98dca89196e4b864}{register\_\-interest\_\-response} (const \hyperlink{classXrlError}{XrlError} \&error, const bool $\ast$resolves, const A $\ast$addr, const uint32\_\-t $\ast$prefix\_\-len, const uint32\_\-t $\ast$real\_\-prefix\_\-len, const A $\ast$actual\_\-nexthop, const uint32\_\-t $\ast$metric, const A nexthop\_\-interest, const string comment)}
\label{classNextHopRibRequest_a3584b6a0c0a0e6de98dca89196e4b864}

\begin{DoxyCompactList}\small\item\em XRL callback from register\_\-interest. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopRibRequest_a3a840e6cc548d685c107a9eef6691f28}{
bool \hyperlink{classNextHopRibRequest_a3a840e6cc548d685c107a9eef6691f28}{premature\_\-invalid} (const A \&addr, const uint32\_\-t \&prefix\_\-len)}
\label{classNextHopRibRequest_a3a840e6cc548d685c107a9eef6691f28}

\begin{DoxyCompactList}\small\item\em An unmatched invalidate has been received. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopRibRequest_ad26720ee9cdd9cf2cdb4c5a13422508f}{
bool \hyperlink{classNextHopRibRequest_ad26720ee9cdd9cf2cdb4c5a13422508f}{tardy\_\-invalid} (const A \&addr, const uint32\_\-t \&prefix\_\-len)}
\label{classNextHopRibRequest_ad26720ee9cdd9cf2cdb4c5a13422508f}

\begin{DoxyCompactList}\small\item\em An invalidate has been received after we deregistered interest. \item\end{DoxyCompactList}\item 
bool \hyperlink{classNextHopRibRequest_ae411e2ac59fb5a3551ce52e4c8f36323}{deregister\_\-nexthop} (A nexthop, \hyperlink{classIPNet}{IPNet}$<$ A $>$ net, \hyperlink{classNhLookupTable}{NhLookupTable}$<$ A $>$ $\ast$requester)
\begin{DoxyCompactList}\small\item\em Deregister interest with \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} about this next hop. \item\end{DoxyCompactList}\item 
void \hyperlink{classNextHopRibRequest_a3666609baffe9c178d99664f6350a4be}{reregister\_\-nexthop} (A nexthop, uint32\_\-t ref\_\-cnt, bool resolvable, uint32\_\-t metric)
\begin{DoxyCompactList}\small\item\em Reregister interest with \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} about this next hop. \item\end{DoxyCompactList}\item 
bool \hyperlink{classNextHopRibRequest_a5898270b0ae7966253781e1a6bd73f46}{lookup} (const A \&nexthop, bool \&resolvable, uint32\_\-t \&metric) const 
\begin{DoxyCompactList}\small\item\em lookup next hop. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopRibRequest_ac3bb63381cc33247c049de0d74387865}{
void {\bfseries deregister\_\-from\_\-rib} (const A \&nexthop, uint32\_\-t prefix\_\-len)}
\label{classNextHopRibRequest_ac3bb63381cc33247c049de0d74387865}

\item 
\hypertarget{classNextHopRibRequest_a542ed9359941c7e6714662302da8f090}{
void {\bfseries deregister\_\-interest} (A nexthop, uint32\_\-t prefix\_\-len)}
\label{classNextHopRibRequest_a542ed9359941c7e6714662302da8f090}

\item 
void \hyperlink{classNextHopRibRequest_a8b232fd6f41d77d2055598c07f5a52c8}{deregister\_\-interest\_\-response} (const \hyperlink{classXrlError}{XrlError} \&error, A addr, uint32\_\-t prefix\_\-len, string comment)
\begin{DoxyCompactList}\small\item\em XRL response method. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classNextHopRibRequest_a7d90c127a4eda7a22f1e46d4e46f9154}{
static void \hyperlink{classNextHopRibRequest_a7d90c127a4eda7a22f1e46d4e46f9154}{zapper} (\hyperlink{classRibRequestQueueEntry}{RibRequestQueueEntry}$<$ A $>$ $\ast$req)}
\label{classNextHopRibRequest_a7d90c127a4eda7a22f1e46d4e46f9154}

\begin{DoxyCompactList}\small\item\em Used by \hyperlink{protocolthe-p}{the} destructor to delete all \hyperlink{protocolthe-p}{the} \char`\"{}RibRequestQueueEntry\char`\"{} objects that have been allocated. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classNextHopRibRequest_a530f161050a9c537082ca9ce246253b3}{
string {\bfseries \_\-ribname}}
\label{classNextHopRibRequest_a530f161050a9c537082ca9ce246253b3}

\item 
\hypertarget{classNextHopRibRequest_a3dc8bf8a5338a6a427196929a76a70bd}{
\hyperlink{classXrlStdRouter}{XrlStdRouter} $\ast$ {\bfseries \_\-xrl\_\-router}}
\label{classNextHopRibRequest_a3dc8bf8a5338a6a427196929a76a70bd}

\item 
\hypertarget{classNextHopRibRequest_a86a58509b8066608949f74d7df2da080}{
\hyperlink{classNextHopResolver}{NextHopResolver}$<$ A $>$ \& {\bfseries \_\-next\_\-hop\_\-resolver}}
\label{classNextHopRibRequest_a86a58509b8066608949f74d7df2da080}

\item 
\hypertarget{classNextHopRibRequest_a7ef27ab218a93321523dbe297ba1b9ab}{
\hyperlink{classNextHopCache}{NextHopCache}$<$ A $>$ \& {\bfseries \_\-next\_\-hop\_\-cache}}
\label{classNextHopRibRequest_a7ef27ab218a93321523dbe297ba1b9ab}

\item 
\hypertarget{classNextHopRibRequest_ae6302fb17d66bf77de6c66107353bcb1}{
\hyperlink{classBGPMain}{BGPMain} \& {\bfseries \_\-bgp}}
\label{classNextHopRibRequest_ae6302fb17d66bf77de6c66107353bcb1}

\item 
\hypertarget{classNextHopRibRequest_a11a7229d5e66280c1f699c818ca4d53b}{
bool \hyperlink{classNextHopRibRequest_a11a7229d5e66280c1f699c818ca4d53b}{\_\-busy}}
\label{classNextHopRibRequest_a11a7229d5e66280c1f699c818ca4d53b}

\begin{DoxyCompactList}\small\item\em Are we currently waiting for a response from \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB}. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopRibRequest_ad6c2bd73c879206de98c19b3c514e351}{
bool {\bfseries \_\-invalid}}
\label{classNextHopRibRequest_ad6c2bd73c879206de98c19b3c514e351}

\item 
\hypertarget{classNextHopRibRequest_ac422449b9944c2bca35968ebde3f8984}{
\hyperlink{classIPNet}{IPNet}$<$ A $>$ {\bfseries \_\-invalid\_\-net}}
\label{classNextHopRibRequest_ac422449b9944c2bca35968ebde3f8984}

\item 
\hypertarget{classNextHopRibRequest_aa5dcfb960e47a3c0a2452d081964374d}{
bool {\bfseries \_\-tardy\_\-invalid}}
\label{classNextHopRibRequest_aa5dcfb960e47a3c0a2452d081964374d}

\item 
\hypertarget{classNextHopRibRequest_adfe82111d1ae4e097aab51a415b03930}{
\hyperlink{classIPNet}{IPNet}$<$ A $>$ {\bfseries \_\-tardy\_\-invalid\_\-net}}
\label{classNextHopRibRequest_adfe82111d1ae4e097aab51a415b03930}

\item 
\hypertarget{classNextHopRibRequest_a0c9b5c00ee3fdce91b68008f89012fa9}{
list$<$ \hyperlink{classRibRequestQueueEntry}{RibRequestQueueEntry}$<$ A $>$ $\ast$ $>$ \hyperlink{classNextHopRibRequest_a0c9b5c00ee3fdce91b68008f89012fa9}{\_\-queue}}
\label{classNextHopRibRequest_a0c9b5c00ee3fdce91b68008f89012fa9}

\begin{DoxyCompactList}\small\item\em The queue of outstanding requests. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class A$>$ class NextHopRibRequest$<$ A $>$}

Make requests of \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} and get responses. At any time there is only ever one outstanding request to \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB}. Firstly we don't want to overrun \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} with requests. Secondly it is possible that different next hops in \hyperlink{protocolthe-p}{the} queue of requests may resolve to \hyperlink{protocolthe-p}{the} same address/prefix\_\-len answer (see below). 

\subsection{Member Function Documentation}
\hypertarget{classNextHopRibRequest_a8b232fd6f41d77d2055598c07f5a52c8}{
\index{NextHopRibRequest@{NextHopRibRequest}!deregister\_\-interest\_\-response@{deregister\_\-interest\_\-response}}
\index{deregister\_\-interest\_\-response@{deregister\_\-interest\_\-response}!NextHopRibRequest@{NextHopRibRequest}}
\subsubsection[{deregister\_\-interest\_\-response}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf NextHopRibRequest}$<$ A $>$::deregister\_\-interest\_\-response (
\begin{DoxyParamCaption}
\item[{const {\bf XrlError} \&}]{error, }
\item[{A}]{addr, }
\item[{uint32\_\-t}]{prefix\_\-len, }
\item[{string}]{comment}
\end{DoxyParamCaption}
)}}
\label{classNextHopRibRequest_a8b232fd6f41d77d2055598c07f5a52c8}


XRL response method. 


\begin{DoxyParams}{Parameters}
{\em error} & Error returned by xrl call. \\
\hline
{\em comment} & Comment string used for diagnostic purposes. \\
\hline
\end{DoxyParams}
\hypertarget{classNextHopRibRequest_ae411e2ac59fb5a3551ce52e4c8f36323}{
\index{NextHopRibRequest@{NextHopRibRequest}!deregister\_\-nexthop@{deregister\_\-nexthop}}
\index{deregister\_\-nexthop@{deregister\_\-nexthop}!NextHopRibRequest@{NextHopRibRequest}}
\subsubsection[{deregister\_\-nexthop}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ bool {\bf NextHopRibRequest}$<$ A $>$::deregister\_\-nexthop (
\begin{DoxyParamCaption}
\item[{A}]{nexthop, }
\item[{{\bf IPNet}$<$ A $>$}]{net, }
\item[{{\bf NhLookupTable}$<$ A $>$ $\ast$}]{requester}
\end{DoxyParamCaption}
)}}
\label{classNextHopRibRequest_ae411e2ac59fb5a3551ce52e4c8f36323}


Deregister interest with \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} about this next hop. 


\begin{DoxyParams}{Parameters}
{\em nexthop} & The next hop that we are attempting to resolve. \\
\hline
{\em net} & The subnet that this next hop is associated with. \\
\hline
{\em requester} & The lookup table that wants to be notified when \hyperlink{protocolthe-p}{the} response comes back. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
True if an entry was found to remove. 
\end{DoxyReturn}
\hypertarget{classNextHopRibRequest_a5898270b0ae7966253781e1a6bd73f46}{
\index{NextHopRibRequest@{NextHopRibRequest}!lookup@{lookup}}
\index{lookup@{lookup}!NextHopRibRequest@{NextHopRibRequest}}
\subsubsection[{lookup}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ bool {\bf NextHopRibRequest}$<$ A $>$::lookup (
\begin{DoxyParamCaption}
\item[{const A \&}]{nexthop, }
\item[{bool \&}]{resolvable, }
\item[{uint32\_\-t \&}]{metric}
\end{DoxyParamCaption}
) const}}
\label{classNextHopRibRequest_a5898270b0ae7966253781e1a6bd73f46}


lookup next hop. 


\begin{DoxyParams}{Parameters}
{\em nexthop} & \hyperlink{classNext}{Next} hop. \\
\hline
{\em resolvable} & Is this route resolvable. \\
\hline
{\em metric} & If this route is resolvable \hyperlink{protocolthe-p}{the} metric of this route. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
True if this next hop is found. 
\end{DoxyReturn}
\hypertarget{classNextHopRibRequest_a8eacb8880df3c175b0cb3a43bee06e1b}{
\index{NextHopRibRequest@{NextHopRibRequest}!register\_\-interest@{register\_\-interest}}
\index{register\_\-interest@{register\_\-interest}!NextHopRibRequest@{NextHopRibRequest}}
\subsubsection[{register\_\-interest}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf NextHopRibRequest}$<$ A $>$::register\_\-interest (
\begin{DoxyParamCaption}
\item[{A}]{nexthop}
\end{DoxyParamCaption}
)}}
\label{classNextHopRibRequest_a8eacb8880df3c175b0cb3a43bee06e1b}


Actually register interest with \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB}. 

A small method that will be specialized to differentiate between \hyperlink{classIPv4}{IPv4} and \hyperlink{classIPv6}{IPv6}.


\begin{DoxyParams}{Parameters}
{\em nexthop} & The next hop that we are attempting to resolve. \\
\hline
\end{DoxyParams}
\hypertarget{classNextHopRibRequest_ac5110febb472eb6a86af1d58a65edab0}{
\index{NextHopRibRequest@{NextHopRibRequest}!register\_\-nexthop@{register\_\-nexthop}}
\index{register\_\-nexthop@{register\_\-nexthop}!NextHopRibRequest@{NextHopRibRequest}}
\subsubsection[{register\_\-nexthop}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf NextHopRibRequest}$<$ A $>$::register\_\-nexthop (
\begin{DoxyParamCaption}
\item[{A}]{nexthop, }
\item[{{\bf IPNet}$<$ A $>$}]{net, }
\item[{{\bf NhLookupTable}$<$ A $>$ $\ast$}]{requester}
\end{DoxyParamCaption}
)}}
\label{classNextHopRibRequest_ac5110febb472eb6a86af1d58a65edab0}


Register interest with \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} about this next hop. 


\begin{DoxyParams}{Parameters}
{\em nexthop} & The next hop that we are attempting to resolve. \\
\hline
{\em net} & The subnet that this next hop is associated with. \\
\hline
{\em requester} & The lookup table that wants to be notified when \hyperlink{protocolthe-p}{the} response comes back. \\
\hline
\end{DoxyParams}
\hypertarget{classNextHopRibRequest_a3666609baffe9c178d99664f6350a4be}{
\index{NextHopRibRequest@{NextHopRibRequest}!reregister\_\-nexthop@{reregister\_\-nexthop}}
\index{reregister\_\-nexthop@{reregister\_\-nexthop}!NextHopRibRequest@{NextHopRibRequest}}
\subsubsection[{reregister\_\-nexthop}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf NextHopRibRequest}$<$ A $>$::reregister\_\-nexthop (
\begin{DoxyParamCaption}
\item[{A}]{nexthop, }
\item[{uint32\_\-t}]{ref\_\-cnt, }
\item[{bool}]{resolvable, }
\item[{uint32\_\-t}]{metric}
\end{DoxyParamCaption}
)}}
\label{classNextHopRibRequest_a3666609baffe9c178d99664f6350a4be}


Reregister interest with \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} about this next hop. 

This method is used when \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} tells us that all previous registrations have become invalid. This forces us to re-\/request information. We save \hyperlink{protocolthe-p}{the} old state (resolvable, metric) just in case \hyperlink{protocolthe-p}{the} following events occur: 
\begin{DoxyPre}
 1) Register from next hop table.
 2) route\_info\_invalid from \hyperlink{classRIB}{RIB}.
 3) lookup from decision.
 \end{DoxyPre}
 This ordering of events may not be possible just in case it is save \hyperlink{protocolthe-p}{the} old result and return it in a lookup.


\begin{DoxyParams}{Parameters}
{\em nexthop} & The next hop that we are attempting to resolve. \\
\hline
{\em ref\_\-cnt} & The number of subnets using this nexthop. \\
\hline
{\em resolvable} & Was \hyperlink{protocolthe-p}{the} previous result resolvable. \\
\hline
{\em metric} & If \hyperlink{protocolthe-p}{the} previous result was resolvable \hyperlink{protocolthe-p}{the} metric. \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/bgp/next\_\-hop\_\-resolver.hh\item 
/home/greearb/git/xorp.ct.github/xorp/bgp/next\_\-hop\_\-resolver.cc\end{DoxyCompactItemize}
