\hypertarget{classDecisionTable}{
\section{DecisionTable$<$ A $>$ Class Template Reference}
\label{classDecisionTable}\index{DecisionTable@{DecisionTable}}
}


\hyperlink{classBGPRouteTable}{BGPRouteTable} which receives routes from all peers and decided which routes win.  




{\ttfamily \#include $<$route\_\-table\_\-decision.hh$>$}

Inheritance diagram for DecisionTable$<$ A $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classDecisionTable}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classDecisionTable_a1a5c90e25fd652bb01534cd059e492ea}{
{\bfseries DecisionTable} (string tablename, Safi safi, \hyperlink{classNextHopResolver}{NextHopResolver}$<$ A $>$ \&next\_\-hop\_\-resolver)}
\label{classDecisionTable_a1a5c90e25fd652bb01534cd059e492ea}

\item 
\hypertarget{classDecisionTable_a4faf77a33ef2749c1a16a0f08a61ae68}{
int {\bfseries add\_\-parent} (\hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$parent, \hyperlink{classPeerHandler}{PeerHandler} $\ast$peer\_\-handler, uint32\_\-t genid)}
\label{classDecisionTable_a4faf77a33ef2749c1a16a0f08a61ae68}

\item 
\hypertarget{classDecisionTable_a4cc54bc9b41d49a94c5ddce29ddd0970}{
int {\bfseries remove\_\-parent} (\hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$parent)}
\label{classDecisionTable_a4cc54bc9b41d49a94c5ddce29ddd0970}

\item 
\hypertarget{classDecisionTable_a97ea3fdc92561f99756928bcefe34d70}{
int {\bfseries add\_\-route} (\hyperlink{classInternalMessage}{InternalMessage}$<$ A $>$ \&rtmsg, \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$caller)}
\label{classDecisionTable_a97ea3fdc92561f99756928bcefe34d70}

\item 
\hypertarget{classDecisionTable_a4fbb14cb6a7d54ac3786ed570de578ae}{
int {\bfseries replace\_\-route} (\hyperlink{classInternalMessage}{InternalMessage}$<$ A $>$ \&old\_\-rtmsg, \hyperlink{classInternalMessage}{InternalMessage}$<$ A $>$ \&new\_\-rtmsg, \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$caller)}
\label{classDecisionTable_a4fbb14cb6a7d54ac3786ed570de578ae}

\item 
\hypertarget{classDecisionTable_ac1974198f5cda51ebcda1aedf683522f}{
int {\bfseries delete\_\-route} (\hyperlink{classInternalMessage}{InternalMessage}$<$ A $>$ \&rtmsg, \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$caller)}
\label{classDecisionTable_ac1974198f5cda51ebcda1aedf683522f}

\item 
\hypertarget{classDecisionTable_afd149965c23ab95258b736ee97337cb0}{
int {\bfseries route\_\-dump} (\hyperlink{classInternalMessage}{InternalMessage}$<$ A $>$ \&rtmsg, \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$caller, const \hyperlink{classPeerHandler}{PeerHandler} $\ast$peer)}
\label{classDecisionTable_afd149965c23ab95258b736ee97337cb0}

\item 
\hypertarget{classDecisionTable_afcc342611f7d53630874b9518bbd5291}{
int {\bfseries push} (\hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$caller)}
\label{classDecisionTable_afcc342611f7d53630874b9518bbd5291}

\item 
\hypertarget{classDecisionTable_a17c55d82cfdffe5b8073c97351389818}{
const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ $\ast$ {\bfseries lookup\_\-route} (const \hyperlink{classIPNet}{IPNet}$<$ A $>$ \&net, uint32\_\-t \&genid, FPAListRef \&pa\_\-list) const }
\label{classDecisionTable_a17c55d82cfdffe5b8073c97351389818}

\item 
\hypertarget{classDecisionTable_a27c281e85b646122a76f9299f359267b}{
\hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$ {\bfseries parent} ()}
\label{classDecisionTable_a27c281e85b646122a76f9299f359267b}

\item 
\hypertarget{classDecisionTable_a4b11170e9fa6acfdd12171aebba87dba}{
RouteTableType {\bfseries type} () const }
\label{classDecisionTable_a4b11170e9fa6acfdd12171aebba87dba}

\item 
\hypertarget{classDecisionTable_a4052fa25466a294e81293151ec4dc600}{
string {\bfseries str} () const }
\label{classDecisionTable_a4052fa25466a294e81293151ec4dc600}

\item 
\hypertarget{classDecisionTable_adf75620255acf90dcba90cda3906ca34}{
bool {\bfseries get\_\-next\_\-message} (\hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$)}
\label{classDecisionTable_adf75620255acf90dcba90cda3906ca34}

\item 
\hypertarget{classDecisionTable_ac3156b67951fba0dad8d51f23893e3b5}{
bool {\bfseries dump\_\-next\_\-route} (\hyperlink{classDumpIterator}{DumpIterator}$<$ A $>$ \&dump\_\-iter)}
\label{classDecisionTable_ac3156b67951fba0dad8d51f23893e3b5}

\item 
virtual void \hyperlink{classDecisionTable_a8dc88a14f6847514a65f326968de6986}{igp\_\-nexthop\_\-changed} (const A \&bgp\_\-nexthop)
\begin{DoxyCompactList}\small\item\em Notification that \hyperlink{protocolthe-p}{the} status of this next hop has changed. \item\end{DoxyCompactList}\item 
\hypertarget{classDecisionTable_a4146d68b997f4d40f782e920a2c7678b}{
void {\bfseries peering\_\-went\_\-down} (const \hyperlink{classPeerHandler}{PeerHandler} $\ast$peer, uint32\_\-t genid, \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$caller)}
\label{classDecisionTable_a4146d68b997f4d40f782e920a2c7678b}

\item 
\hypertarget{classDecisionTable_ac331800abd86095c65170db0514bb09f}{
void {\bfseries peering\_\-down\_\-complete} (const \hyperlink{classPeerHandler}{PeerHandler} $\ast$peer, uint32\_\-t genid, \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$caller)}
\label{classDecisionTable_ac331800abd86095c65170db0514bb09f}

\item 
\hypertarget{classDecisionTable_a2a0e68d39f56b1cd84744242fbe675e5}{
void {\bfseries peering\_\-came\_\-up} (const \hyperlink{classPeerHandler}{PeerHandler} $\ast$peer, uint32\_\-t genid, \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$caller)}
\label{classDecisionTable_a2a0e68d39f56b1cd84744242fbe675e5}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ $\ast$ \hyperlink{classDecisionTable_a8b06f279f0d5f0b7466681d8d486bf43}{lookup\_\-route} (const \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$ignore\_\-parent, const \hyperlink{classIPNet}{IPNet}$<$ A $>$ \&net, const \hyperlink{classPeerHandler}{PeerHandler} $\ast$\&best\_\-routes\_\-peer, \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$\&best\_\-routes\_\-parent) const 
\begin{DoxyCompactList}\small\item\em This version of lookup\_\-route finds \hyperlink{protocolthe-p}{the} previous winner if there was one, else it finds \hyperlink{protocolthe-p}{the} best alternative. \item\end{DoxyCompactList}\item 
\hypertarget{classDecisionTable_acb6579d2df8234e3b453df95abfed219}{
\hyperlink{classRouteData}{RouteData}$<$ A $>$ $\ast$ {\bfseries find\_\-alternative\_\-routes} (const \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$caller, const \hyperlink{classIPNet}{IPNet}$<$ A $>$ \&net, list$<$ \hyperlink{classRouteData}{RouteData}$<$ A $>$ $>$ \&alternatives) const }
\label{classDecisionTable_acb6579d2df8234e3b453df95abfed219}

\item 
\hypertarget{classDecisionTable_a383e4d427cb32dcea94379780a16074d}{
uint32\_\-t {\bfseries local\_\-pref} (const FPAListRef \&pa\_\-list) const }
\label{classDecisionTable_a383e4d427cb32dcea94379780a16074d}

\item 
\hypertarget{classDecisionTable_ac0fd927b883874d2dde4fd0e150b6570}{
uint32\_\-t {\bfseries med} (const FPAListRef \&pa\_\-list) const }
\label{classDecisionTable_ac0fd927b883874d2dde4fd0e150b6570}

\item 
\hypertarget{classDecisionTable_a77aab056cb06fff5f660973b5dc217f6}{
bool {\bfseries resolvable} (const A) const }
\label{classDecisionTable_a77aab056cb06fff5f660973b5dc217f6}

\item 
\hypertarget{classDecisionTable_ab4d5e81aa01664337b343cabcae1fb8b}{
uint32\_\-t {\bfseries igp\_\-distance} (const A) const }
\label{classDecisionTable_ab4d5e81aa01664337b343cabcae1fb8b}

\item 
\hypertarget{classDecisionTable_a8254a23dc7a36a6ead7e82c05763d03e}{
\hyperlink{classRouteData}{RouteData}$<$ A $>$ $\ast$ {\bfseries find\_\-winner} (list$<$ \hyperlink{classRouteData}{RouteData}$<$ A $>$ $>$ \&alternatives) const }
\label{classDecisionTable_a8254a23dc7a36a6ead7e82c05763d03e}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classDecisionTable_ae874385522b1254286873e0d31318b99}{
map$<$ \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$, \hyperlink{classPeerTableInfo}{PeerTableInfo}$<$ A $>$ $\ast$ $>$ {\bfseries \_\-parents}}
\label{classDecisionTable_ae874385522b1254286873e0d31318b99}

\item 
\hypertarget{classDecisionTable_a7ea5bfc63fecedf93a78bbd8001e48fb}{
map$<$ uint32\_\-t, \hyperlink{classPeerTableInfo}{PeerTableInfo}$<$ A $>$ $\ast$ $>$ {\bfseries \_\-sorted\_\-parents}}
\label{classDecisionTable_a7ea5bfc63fecedf93a78bbd8001e48fb}

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

\end{DoxyCompactItemize}


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

\hyperlink{classBGPRouteTable}{BGPRouteTable} which receives routes from all peers and decided which routes win. The XORP BGP is internally implemented as a set of pipelines consisting of a series of BGPRouteTables. Each pipeline receives routes from a BGP peer, stores them, and applies filters to them to modify \hyperlink{protocolthe-p}{the} routes. Then \hyperlink{protocolthe-p}{the} pipelines converge on a single decision process, which decides which route wins amongst possible alternative routes.

\hyperlink{classDecisionTable}{DecisionTable} is a \hyperlink{classBGPRouteTable}{BGPRouteTable} which performs this decision process. It has many upstream BGPRouteTables and a single downstream \hyperlink{classBGPRouteTable}{BGPRouteTable}. Only \hyperlink{protocolthe-p}{the} winning routes according to \hyperlink{protocolthe-p}{the} BGP decision process are propagated downstream.

When a new route reaches \hyperlink{classDecisionTable}{DecisionTable} from one peer, we must lookup that route in all \hyperlink{protocolthe-p}{the} other upstream branches to see if this route wins, or even if it doesn't win, if it causes a change of winning route. Similarly for route deletions coming from a peer, etc. 

\subsection{Member Function Documentation}
\hypertarget{classDecisionTable_a8dc88a14f6847514a65f326968de6986}{
\index{DecisionTable@{DecisionTable}!igp\_\-nexthop\_\-changed@{igp\_\-nexthop\_\-changed}}
\index{igp\_\-nexthop\_\-changed@{igp\_\-nexthop\_\-changed}!DecisionTable@{DecisionTable}}
\subsubsection[{igp\_\-nexthop\_\-changed}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf DecisionTable}$<$ A $>$::igp\_\-nexthop\_\-changed (
\begin{DoxyParamCaption}
\item[{const A \&}]{bgp\_\-nexthop}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classDecisionTable_a8dc88a14f6847514a65f326968de6986}


Notification that \hyperlink{protocolthe-p}{the} status of this next hop has changed. 


\begin{DoxyParams}{Parameters}
{\em bgp\_\-nexthop} & The next hop that has changed. \\
\hline
\end{DoxyParams}


Reimplemented from \hyperlink{classBGPRouteTable_a2126e0a6eb87e2e8d5b8b79afa05359d}{BGPRouteTable$<$ A $>$}.



Reimplemented in \hyperlink{classDummyDecisionTable_a5ed3e0214430c6d92975484d213ef53a}{DummyDecisionTable$<$ A $>$}.

\hypertarget{classDecisionTable_a8b06f279f0d5f0b7466681d8d486bf43}{
\index{DecisionTable@{DecisionTable}!lookup\_\-route@{lookup\_\-route}}
\index{lookup\_\-route@{lookup\_\-route}!DecisionTable@{DecisionTable}}
\subsubsection[{lookup\_\-route}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ const {\bf SubnetRoute}$<$ A $>$ $\ast$ {\bf DecisionTable}$<$ A $>$::lookup\_\-route (
\begin{DoxyParamCaption}
\item[{const {\bf BGPRouteTable}$<$ A $>$ $\ast$}]{ignore\_\-parent, }
\item[{const {\bf IPNet}$<$ A $>$ \&}]{net, }
\item[{const {\bf PeerHandler} $\ast$\&}]{best\_\-routes\_\-peer, }
\item[{{\bf BGPRouteTable}$<$ A $>$ $\ast$\&}]{best\_\-routes\_\-parent}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classDecisionTable_a8b06f279f0d5f0b7466681d8d486bf43}


This version of lookup\_\-route finds \hyperlink{protocolthe-p}{the} previous winner if there was one, else it finds \hyperlink{protocolthe-p}{the} best alternative. 

Note that \hyperlink{protocolthe-p}{the} previous winner might not actually be \hyperlink{protocolthe-p}{the} best current winner, but in this context we need to be consistent -\/ if it won before, then it still wins until a delete\_\-route or replace\_\-route arrives to update our idea of \hyperlink{protocolthe-p}{the} winner 

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