\hypertarget{classNextHopResolver}{
\section{NextHopResolver$<$ A $>$ Class Template Reference}
\label{classNextHopResolver}\index{NextHopResolver@{NextHopResolver}}
}
Inheritance diagram for NextHopResolver$<$ A $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=1.876047cm]{classNextHopResolver}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classNextHopResolver_a974b8d2a55f626613e23dea2230cdfa8}{
{\bfseries NextHopResolver} (\hyperlink{classXrlStdRouter}{XrlStdRouter} $\ast$xrl\_\-router, \hyperlink{classEventLoop}{EventLoop} \&eventloop, \hyperlink{classBGPMain}{BGPMain} \&bgp)}
\label{classNextHopResolver_a974b8d2a55f626613e23dea2230cdfa8}

\item 
void \hyperlink{classNextHopResolver_a1c282eef9890ba464d035b460794c0bc}{add\_\-decision} (\hyperlink{classDecisionTable}{DecisionTable}$<$ A $>$ $\ast$decision)
\begin{DoxyCompactList}\small\item\em Add decision. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopResolver_a308e81a10c078af0309b4ae888952b8a}{
bool \hyperlink{classNextHopResolver_a308e81a10c078af0309b4ae888952b8a}{register\_\-ribname} (const string \&r)}
\label{classNextHopResolver_a308e81a10c078af0309b4ae888952b8a}

\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} rib's name, allows for having a dummy rib or not having a \hyperlink{classRIB}{RIB} at all. \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{classNextHopResolver_a0284f09910a44ec9a91aa1c96a4f395a}{register\_\-nexthop} (A nexthop, \hyperlink{classIPNet}{IPNet}$<$ A $>$ net\_\-from\_\-route, \hyperlink{classNhLookupTable}{NhLookupTable}$<$ A $>$ $\ast$requester)
\begin{DoxyCompactList}\small\item\em Register interest in this nexthop. \item\end{DoxyCompactList}\item 
virtual void \hyperlink{classNextHopResolver_af51d76035eeac999e66dd87e56cdddd3}{deregister\_\-nexthop} (A nexthop, \hyperlink{classIPNet}{IPNet}$<$ A $>$ net\_\-from\_\-route, \hyperlink{classNhLookupTable}{NhLookupTable}$<$ A $>$ $\ast$requester)
\begin{DoxyCompactList}\small\item\em De-\/Register interest in this nexthop. \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{classNextHopResolver_a90a58a51ab4697a68757fd74517082ab}{lookup} (const A nexthop, bool \&resolvable, uint32\_\-t \&metric) const 
\begin{DoxyCompactList}\small\item\em Lookup next hop. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopResolver_a3074523ce31710c2ddd9a714c88921f8}{
bool \hyperlink{classNextHopResolver_a3074523ce31710c2ddd9a714c88921f8}{rib\_\-client\_\-route\_\-info\_\-changed} (const A \&addr, const uint32\_\-t \&prefix\_\-len, const A \&nexthop, const uint32\_\-t \&metric)}
\label{classNextHopResolver_a3074523ce31710c2ddd9a714c88921f8}

\begin{DoxyCompactList}\small\item\em Call from \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} to notify us that a metric has changed. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopResolver_a3a3eae42c6057f0315e9eccc741aca0f}{
bool \hyperlink{classNextHopResolver_a3a3eae42c6057f0315e9eccc741aca0f}{rib\_\-client\_\-route\_\-info\_\-invalid} (const A \&addr, const uint32\_\-t \&prefix\_\-len)}
\label{classNextHopResolver_a3a3eae42c6057f0315e9eccc741aca0f}

\begin{DoxyCompactList}\small\item\em Call from \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} to notify us that any registrations with this address and prefix\_\-len are now invalid. \item\end{DoxyCompactList}\item 
void \hyperlink{classNextHopResolver_a9c90cc008aad27ccb5429860db9d73c0}{next\_\-hop\_\-changed} (A nexthop)
\begin{DoxyCompactList}\small\item\em \hyperlink{classNext}{Next} hop changed. \item\end{DoxyCompactList}\item 
void \hyperlink{classNextHopResolver_adaf0ee86e4a0eee4e332d1230537d7e9}{next\_\-hop\_\-changed} (A nexthop, bool old\_\-resolves, uint32\_\-t old\_\-metric)
\begin{DoxyCompactList}\small\item\em \hyperlink{classNext}{Next} hop changed. \item\end{DoxyCompactList}\item 
\hyperlink{classNextHopRibRequest}{NextHopRibRequest}$<$ A $>$ $\ast$ \hyperlink{classNextHopResolver_a98fa78675a52d8448acf14c8a959c4af}{get\_\-next\_\-hop\_\-rib\_\-request} ()
\begin{DoxyCompactList}\small\item\em Get \hyperlink{classNextHopRibRequest}{NextHopRibRequest} pointer. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopResolver_a1c7b5ded2f5eb34f48295d80654b7db8}{
\hyperlink{classEventLoop}{EventLoop} \& \hyperlink{classNextHopResolver_a1c7b5ded2f5eb34f48295d80654b7db8}{eventloop} ()}
\label{classNextHopResolver_a1c7b5ded2f5eb34f48295d80654b7db8}

\begin{DoxyCompactList}\small\item\em Get a reference to \hyperlink{protocolthe-p}{the} main timer list. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classNextHopResolver_a35d47a05b61d0e19ea5528b0367e920a}{
list$<$ \hyperlink{classDecisionTable}{DecisionTable}$<$ A $>$ $\ast$ $>$ {\bfseries \_\-decision}}
\label{classNextHopResolver_a35d47a05b61d0e19ea5528b0367e920a}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classNextHopResolver_a3d39d9f324b2c041a8112ab261612e3f}{
string {\bfseries \_\-ribname}}
\label{classNextHopResolver_a3d39d9f324b2c041a8112ab261612e3f}

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

\item 
\hypertarget{classNextHopResolver_a64235945b3b1756beab3805d010e440a}{
\hyperlink{classEventLoop}{EventLoop} \& {\bfseries \_\-eventloop}}
\label{classNextHopResolver_a64235945b3b1756beab3805d010e440a}

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

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

\item 
\hypertarget{classNextHopResolver_ab205e46f0ddc21b39c536e5b90374d46}{
\hyperlink{classNextHopRibRequest}{NextHopRibRequest}$<$ A $>$ {\bfseries \_\-next\_\-hop\_\-rib\_\-request}}
\label{classNextHopResolver_ab205e46f0ddc21b39c536e5b90374d46}

\end{DoxyCompactItemize}
\subsubsection*{template$<$class A$>$ class NextHopResolver$<$ A $>$}



\subsection{Member Function Documentation}
\hypertarget{classNextHopResolver_a1c282eef9890ba464d035b460794c0bc}{
\index{NextHopResolver@{NextHopResolver}!add\_\-decision@{add\_\-decision}}
\index{add\_\-decision@{add\_\-decision}!NextHopResolver@{NextHopResolver}}
\subsubsection[{add\_\-decision}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf NextHopResolver}$<$ A $>$::add\_\-decision (
\begin{DoxyParamCaption}
\item[{{\bf DecisionTable}$<$ A $>$ $\ast$}]{decision}
\end{DoxyParamCaption}
)}}
\label{classNextHopResolver_a1c282eef9890ba464d035b460794c0bc}


Add decision. 

Pass a pointer to \hyperlink{protocolthe-p}{the} decision table into \hyperlink{protocolthe-p}{the} next hop resolver. This pointer is used to notify \hyperlink{protocolthe-p}{the} decision table when a next hop metric changes.


\begin{DoxyParams}{Parameters}
{\em decision} & Pointer to \hyperlink{protocolthe-p}{the} decision table. \\
\hline
\end{DoxyParams}
\hypertarget{classNextHopResolver_af51d76035eeac999e66dd87e56cdddd3}{
\index{NextHopResolver@{NextHopResolver}!deregister\_\-nexthop@{deregister\_\-nexthop}}
\index{deregister\_\-nexthop@{deregister\_\-nexthop}!NextHopResolver@{NextHopResolver}}
\subsubsection[{deregister\_\-nexthop}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf NextHopResolver}$<$ A $>$::deregister\_\-nexthop (
\begin{DoxyParamCaption}
\item[{A}]{nexthop, }
\item[{{\bf IPNet}$<$ A $>$}]{net\_\-from\_\-route, }
\item[{{\bf NhLookupTable}$<$ A $>$ $\ast$}]{requester}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classNextHopResolver_af51d76035eeac999e66dd87e56cdddd3}


De-\/Register interest in this nexthop. 


\begin{DoxyParams}{Parameters}
{\em nexthop} & Nexthop. \\
\hline
{\em net\_\-from\_\-route} & The net that is associated with this nexthop in \hyperlink{protocolthe-p}{the} NextHopLookupTable. Treated as an opaque id. \\
\hline
{\em requester} & Original requester, not used. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
True if \hyperlink{protocolthe-p}{the} registration succeed. 
\end{DoxyReturn}


Reimplemented in \hyperlink{classDummyResolver_ad179571b4e43a1c713360dfdc97250a1}{DummyResolver$<$ A $>$}.

\hypertarget{classNextHopResolver_a98fa78675a52d8448acf14c8a959c4af}{
\index{NextHopResolver@{NextHopResolver}!get\_\-next\_\-hop\_\-rib\_\-request@{get\_\-next\_\-hop\_\-rib\_\-request}}
\index{get\_\-next\_\-hop\_\-rib\_\-request@{get\_\-next\_\-hop\_\-rib\_\-request}!NextHopResolver@{NextHopResolver}}
\subsubsection[{get\_\-next\_\-hop\_\-rib\_\-request}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ {\bf NextHopRibRequest}$<$A$>$$\ast$ {\bf NextHopResolver}$<$ A $>$::get\_\-next\_\-hop\_\-rib\_\-request (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classNextHopResolver_a98fa78675a52d8448acf14c8a959c4af}


Get \hyperlink{classNextHopRibRequest}{NextHopRibRequest} pointer. 

Used for testing. \hypertarget{classNextHopResolver_a90a58a51ab4697a68757fd74517082ab}{
\index{NextHopResolver@{NextHopResolver}!lookup@{lookup}}
\index{lookup@{lookup}!NextHopResolver@{NextHopResolver}}
\subsubsection[{lookup}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ bool {\bf NextHopResolver}$<$ A $>$::lookup (
\begin{DoxyParamCaption}
\item[{const A}]{nexthop, }
\item[{bool \&}]{resolvable, }
\item[{uint32\_\-t \&}]{metric}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classNextHopResolver_a90a58a51ab4697a68757fd74517082ab}


Lookup next hop. 

If a \char`\"{}register\_\-nexthop\char`\"{} request has been made and callback has taken place via \hyperlink{protocolthe-p}{the} \char`\"{}requester\char`\"{} pointer, then \hyperlink{protocolthe-p}{the} lookup is guaranteed to work.


\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}


Reimplemented in \hyperlink{classDummyNextHopResolver_a3772eb5ae82c9ad3cf5219ef95da861d}{DummyNextHopResolver$<$ A $>$}.

\hypertarget{classNextHopResolver_a9c90cc008aad27ccb5429860db9d73c0}{
\index{NextHopResolver@{NextHopResolver}!next\_\-hop\_\-changed@{next\_\-hop\_\-changed}}
\index{next\_\-hop\_\-changed@{next\_\-hop\_\-changed}!NextHopResolver@{NextHopResolver}}
\subsubsection[{next\_\-hop\_\-changed}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf NextHopResolver}$<$ A $>$::next\_\-hop\_\-changed (
\begin{DoxyParamCaption}
\item[{A}]{nexthop}
\end{DoxyParamCaption}
)}}
\label{classNextHopResolver_a9c90cc008aad27ccb5429860db9d73c0}


\hyperlink{classNext}{Next} hop changed. 

Whenever a next hop changes this method should be called and \hyperlink{protocolthe-p}{the} change will be rippled up to \hyperlink{protocolthe-p}{the} decision process.


\begin{DoxyParams}{Parameters}
{\em nexthop} & The next hop that has changed. \\
\hline
\end{DoxyParams}
\hypertarget{classNextHopResolver_adaf0ee86e4a0eee4e332d1230537d7e9}{
\index{NextHopResolver@{NextHopResolver}!next\_\-hop\_\-changed@{next\_\-hop\_\-changed}}
\index{next\_\-hop\_\-changed@{next\_\-hop\_\-changed}!NextHopResolver@{NextHopResolver}}
\subsubsection[{next\_\-hop\_\-changed}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf NextHopResolver}$<$ A $>$::next\_\-hop\_\-changed (
\begin{DoxyParamCaption}
\item[{A}]{nexthop, }
\item[{bool}]{old\_\-resolves, }
\item[{uint32\_\-t}]{old\_\-metric}
\end{DoxyParamCaption}
)}}
\label{classNextHopResolver_adaf0ee86e4a0eee4e332d1230537d7e9}


\hyperlink{classNext}{Next} hop changed. 

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


\begin{DoxyParams}{Parameters}
{\em nexthop} & The next hop that has changed. \\
\hline
{\em old\_\-resolves} & The old resolve value. \\
\hline
{\em old\_\-metric} & The old metric value. \\
\hline
\end{DoxyParams}
\hypertarget{classNextHopResolver_a0284f09910a44ec9a91aa1c96a4f395a}{
\index{NextHopResolver@{NextHopResolver}!register\_\-nexthop@{register\_\-nexthop}}
\index{register\_\-nexthop@{register\_\-nexthop}!NextHopResolver@{NextHopResolver}}
\subsubsection[{register\_\-nexthop}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ bool {\bf NextHopResolver}$<$ A $>$::register\_\-nexthop (
\begin{DoxyParamCaption}
\item[{A}]{nexthop, }
\item[{{\bf IPNet}$<$ A $>$}]{net\_\-from\_\-route, }
\item[{{\bf NhLookupTable}$<$ A $>$ $\ast$}]{requester}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classNextHopResolver_a0284f09910a44ec9a91aa1c96a4f395a}


Register interest in this nexthop. 


\begin{DoxyParams}{Parameters}
{\em nexthop} & Nexthop. \\
\hline
{\em net\_\-from\_\-route} & The net that is associated with this nexthop in \hyperlink{protocolthe-p}{the} NextHopLookupTable. Treated as an opaque id. \\
\hline
{\em requester} & Once \hyperlink{protocolthe-p}{the} registration with \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB} suceeds \hyperlink{protocolthe-p}{the} requester is called back. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
True if \hyperlink{protocolthe-p}{the} registration succeed. 
\end{DoxyReturn}


Reimplemented in \hyperlink{classDummyResolver_a66181a8e58adc768a0f8d6795c722981}{DummyResolver$<$ A $>$}.



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}
