\hypertarget{classCacheTable}{
\section{CacheTable$<$ A $>$ Class Template Reference}
\label{classCacheTable}\index{CacheTable@{CacheTable}}
}


specialized \hyperlink{classBGPRouteTable}{BGPRouteTable} that stores routes modified by a \hyperlink{classFilterTable}{FilterTable}.  




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

Inheritance diagram for CacheTable$<$ A $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classCacheTable}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classCacheTable_a637840ac0288d1918127c11c24822b81}{
{\bfseries CacheTable} (string tablename, Safi safi, \hyperlink{classBGPRouteTable}{BGPRouteTable}$<$ A $>$ $\ast$parent, const \hyperlink{classPeerHandler}{PeerHandler} $\ast$peer)}
\label{classCacheTable_a637840ac0288d1918127c11c24822b81}

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

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

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

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

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

\item 
\hypertarget{classCacheTable_a1862f8d80df6900c5bf718f1c08fb54c}{
void {\bfseries flush\_\-cache} ()}
\label{classCacheTable_a1862f8d80df6900c5bf718f1c08fb54c}

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

\item 
\hypertarget{classCacheTable_a7a0ff0c0f5d81ca5b293b5f43ded807f}{
void {\bfseries route\_\-used} (const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ $\ast$route, bool in\_\-use)}
\label{classCacheTable_a7a0ff0c0f5d81ca5b293b5f43ded807f}

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

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

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

\item 
\hypertarget{classCacheTable_abd7853d46f5b047ea6d273f954da5780}{
int {\bfseries route\_\-count} () const }
\label{classCacheTable_abd7853d46f5b047ea6d273f954da5780}

\item 
\hypertarget{classCacheTable_a80f6ebd543fed7e64086580fe0f03aa2}{
string {\bfseries dump\_\-state} () const }
\label{classCacheTable_a80f6ebd543fed7e64086580fe0f03aa2}

\item 
\hypertarget{classCacheTable_a66d902771bdae3348da654cd6096db6b}{
\hyperlink{classEventLoop}{EventLoop} \& {\bfseries eventloop} () const }
\label{classCacheTable_a66d902771bdae3348da654cd6096db6b}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classCacheTable_ab863b6a7f6e57e9e49d8d66525c97630}{
\hyperlink{classRefTrie}{RefTrie}$<$ A, const \hyperlink{classCacheRoute}{CacheRoute}$<$ A $>$ $>$ $\ast$ {\bfseries \_\-route\_\-table}}
\label{classCacheTable_ab863b6a7f6e57e9e49d8d66525c97630}

\item 
\hypertarget{classCacheTable_a03b9256b115bae4c4a5ad689da8b1df4}{
const \hyperlink{classPeerHandler}{PeerHandler} $\ast$ {\bfseries \_\-peer}}
\label{classCacheTable_a03b9256b115bae4c4a5ad689da8b1df4}

\item 
\hypertarget{classCacheTable_a300596fed45a38e9570410ac32e37265}{
int {\bfseries \_\-unchanged\_\-added}}
\label{classCacheTable_a300596fed45a38e9570410ac32e37265}

\item 
\hypertarget{classCacheTable_af88ace6de9f0ad9c9d978ca35984eba0}{
int {\bfseries \_\-unchanged\_\-deleted}}
\label{classCacheTable_af88ace6de9f0ad9c9d978ca35984eba0}

\item 
\hypertarget{classCacheTable_a95873768c9fcd71853deac3ced314ccf}{
int {\bfseries \_\-changed\_\-added}}
\label{classCacheTable_a95873768c9fcd71853deac3ced314ccf}

\item 
\hypertarget{classCacheTable_aa3501e8fd9c905e9b08fdef534b35e0e}{
int {\bfseries \_\-changed\_\-deleted}}
\label{classCacheTable_aa3501e8fd9c905e9b08fdef534b35e0e}

\end{DoxyCompactItemize}


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

specialized \hyperlink{classBGPRouteTable}{BGPRouteTable} that stores routes modified by a \hyperlink{classFilterTable}{FilterTable}. 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. After decision, \hyperlink{protocolthe-p}{the} winning routes fanout again along a set of pipelines, again being filtered, before being transmitted to peers.

Typically there are two FilterTables for each peer which modify routes passing down \hyperlink{protocolthe-p}{the} pipeline, one in \hyperlink{protocolthe-p}{the} input branch from that peer, and one in \hyperlink{protocolthe-p}{the} output branch to that peer. A \hyperlink{classFilterTable}{FilterTable} does not store \hyperlink{protocolthe-p}{the} routes it modifies, so a \hyperlink{classCacheTable}{CacheTable} is placed downstream of a \hyperlink{classFilterTable}{FilterTable} to store routes that are modified.

In \hyperlink{protocolthe-p}{the} current code, a \hyperlink{classCacheTable}{CacheTable} isn't strictly necessary, but it simplifies life for all downstream tables, because they know that all routes they receive are stored in stable storage and won't go away without explicit notification.

In \hyperlink{protocolthe-p}{the} future, it is likely that \hyperlink{protocolthe-p}{the} CacheTables in \hyperlink{protocolthe-p}{the} outgoing branches will be removed, as they waste quite a bit of memory for very little gain. However, they have not yet been removed because their internal sanity checks have served as a valuable debugging device to ensure consistency in \hyperlink{protocolthe-p}{the} messages travelling down \hyperlink{protocolthe-p}{the} outgoing branches. 

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