\hypertarget{classSubnetRoute}{
\section{SubnetRoute$<$ A $>$ Class Template Reference}
\label{classSubnetRoute}\index{SubnetRoute@{SubnetRoute}}
}


\hyperlink{classSubnetRoute}{SubnetRoute} holds a BGP routing table entry.  




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

Inheritance diagram for SubnetRoute$<$ A $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classSubnetRoute}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classSubnetRoute_af6423c6d7b0934a9dd3878a68b91756c}{
\hyperlink{classSubnetRoute_af6423c6d7b0934a9dd3878a68b91756c}{SubnetRoute} (const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ \&route\_\-to\_\-clone)}
\label{classSubnetRoute_af6423c6d7b0934a9dd3878a68b91756c}

\begin{DoxyCompactList}\small\item\em \hyperlink{classSubnetRoute}{SubnetRoute} copy constructor. \item\end{DoxyCompactList}\item 
\hyperlink{classSubnetRoute_a3a12e7aeb46e00fa19e2acfce7dff12b}{SubnetRoute} (const \hyperlink{classIPNet}{IPNet}$<$ A $>$ \&net, \hyperlink{classPAListRef}{PAListRef}$<$ A $>$ attributes, const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ $\ast$parent\_\-route)
\begin{DoxyCompactList}\small\item\em \hyperlink{classSubnetRoute}{SubnetRoute} constructor. \item\end{DoxyCompactList}\item 
\hyperlink{classSubnetRoute_a8e8ced1bd007326c56cb4a27b64bf92f}{SubnetRoute} (const \hyperlink{classIPNet}{IPNet}$<$ A $>$ \&net, \hyperlink{classPAListRef}{PAListRef}$<$ A $>$ attributes, const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ $\ast$parent\_\-route, uint32\_\-t igp\_\-metric)
\begin{DoxyCompactList}\small\item\em \hyperlink{classSubnetRoute}{SubnetRoute} constructor. \item\end{DoxyCompactList}\item 
bool \hyperlink{classSubnetRoute_a550b8796e9260466aaf74857a66b2531}{operator==} (const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ \&them) const 
\begin{DoxyCompactList}\small\item\em Equality comparison for SubnetRoutes. \item\end{DoxyCompactList}\item 
const \hyperlink{classIPNet}{IPNet}$<$ A $>$ \& \hyperlink{classSubnetRoute_ae8a2629d4b88cf7786662b5471bfc14a}{net} () const 
\item 
\hyperlink{classPAListRef}{PAListRef}$<$ A $>$ \hyperlink{classSubnetRoute_a7a66c6f4768dd4508baf7b0d97dae047}{attributes} () const 
\item 
bool \hyperlink{classSubnetRoute_a2b84c8a79b5bc63f6ed4de6c50260747}{in\_\-use} () const 
\item 
void \hyperlink{classSubnetRoute_aee4c9f46f2db427d9fbc82cda1979707}{set\_\-in\_\-use} (bool used) const 
\begin{DoxyCompactList}\small\item\em Record whether or not this route is in use. \item\end{DoxyCompactList}\item 
bool \hyperlink{classSubnetRoute_a0b9f35084af5a9865790fc3fd7670a91}{is\_\-winner} () const 
\begin{DoxyCompactList}\small\item\em returns true if \hyperlink{protocolthe-p}{the} route was chosen by \hyperlink{protocolthe-p}{the} routing decision process as \hyperlink{protocolthe-p}{the} winning route for this subnet. \item\end{DoxyCompactList}\item 
void \hyperlink{classSubnetRoute_ae8b388d5862e4ea8a79a4f6bc115d68f}{set\_\-is\_\-winner} (uint32\_\-t igp\_\-metric) const 
\begin{DoxyCompactList}\small\item\em when a route is chosen by \hyperlink{protocolthe-p}{the} routing decision process as \hyperlink{protocolthe-p}{the} winning route for this subnet, set\_\-is\_\-winner should be called to record this fact and to record \hyperlink{protocolthe-p}{the} igp\_\-metric at \hyperlink{protocolthe-p}{the} time \hyperlink{protocolthe-p}{the} route was chosen. \item\end{DoxyCompactList}\item 
\hypertarget{classSubnetRoute_ac2644e5af13e43b25676f2b50b4dcd5a}{
void \hyperlink{classSubnetRoute_ac2644e5af13e43b25676f2b50b4dcd5a}{set\_\-is\_\-not\_\-winner} () const }
\label{classSubnetRoute_ac2644e5af13e43b25676f2b50b4dcd5a}

\begin{DoxyCompactList}\small\item\em when a route fails to be chosen by \hyperlink{protocolthe-p}{the} routing decision process as \hyperlink{protocolthe-p}{the} winning route for this subnet, set\_\-is\_\-not\_\-winner should be called to record this fact. \item\end{DoxyCompactList}\item 
\hypertarget{classSubnetRoute_acdc89c787e4b3d6dcd0d6ba886087c52}{
void \hyperlink{classSubnetRoute_acdc89c787e4b3d6dcd0d6ba886087c52}{set\_\-nexthop\_\-resolved} (bool resolved) const }
\label{classSubnetRoute_acdc89c787e4b3d6dcd0d6ba886087c52}

\begin{DoxyCompactList}\small\item\em record whether or not a route's nexthop resolved \item\end{DoxyCompactList}\item 
\hypertarget{classSubnetRoute_a87ad06a171d238ab434a1055cba6c4fd}{
bool \hyperlink{classSubnetRoute_a87ad06a171d238ab434a1055cba6c4fd}{nexthop\_\-resolved} () const }
\label{classSubnetRoute_a87ad06a171d238ab434a1055cba6c4fd}

\begin{DoxyCompactList}\small\item\em did \hyperlink{protocolthe-p}{the} route's nexthop resolve when it was passed through \hyperlink{protocolthe-p}{the} \hyperlink{classNextHop}{NextHop} resolver table. \item\end{DoxyCompactList}\item 
bool \hyperlink{classSubnetRoute_a8b1187ddaaac7f13d3de24dceb803cd2}{is\_\-filtered} () const 
\begin{DoxyCompactList}\small\item\em is\_\-filtered returns true if \hyperlink{protocolthe-p}{the} route was filtered out by \hyperlink{protocolthe-p}{the} incoming filter bank, false otherwise. \item\end{DoxyCompactList}\item 
void \hyperlink{classSubnetRoute_a6810220461cf84bb4106275211d5a07d}{set\_\-filtered} (bool filtered) const 
\begin{DoxyCompactList}\small\item\em set\_\-filtered record whether or not \hyperlink{protocolthe-p}{the} route was filtered out by \hyperlink{protocolthe-p}{the} incoming filter bank. \item\end{DoxyCompactList}\item 
\hypertarget{classSubnetRoute_a3d451c1cbb2167fa8cc434a5b5d40b3c}{
bool \hyperlink{classSubnetRoute_a3d451c1cbb2167fa8cc434a5b5d40b3c}{is\_\-deleted} () const }
\label{classSubnetRoute_a3d451c1cbb2167fa8cc434a5b5d40b3c}

\begin{DoxyCompactList}\small\item\em is\_\-deleted returns true if \hyperlink{protocolthe-p}{the} route has already been deleted (but \hyperlink{protocolthe-p}{the} class instance representing it has not been because it's reference count is non-\/zero) \item\end{DoxyCompactList}\item 
string \hyperlink{classSubnetRoute_ac79ea7858c1e43577f47a4a1a1266123}{str} () const 
\item 
uint32\_\-t \hyperlink{classSubnetRoute_a4c804889a98f65093cdaca3a93c98200}{igp\_\-metric} () const 
\item 
const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ $\ast$ \hyperlink{classSubnetRoute_ab0df1f6b7a99df43463167191e160702}{original\_\-route} () const 
\item 
const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ $\ast$ \hyperlink{classSubnetRoute_a11cb4dc2a6aaa19caa183cad0305beeb}{parent\_\-route} () const 
\item 
void \hyperlink{classSubnetRoute_abdab59ade2ea7da1c42a3d0f5e6f4c0d}{set\_\-parent\_\-route} (const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ $\ast$parent)
\begin{DoxyCompactList}\small\item\em record \hyperlink{protocolthe-p}{the} original version of this route, before any filters were applied. \item\end{DoxyCompactList}\item 
void \hyperlink{classSubnetRoute_a82e1a04c36338d39a495b8bbc11e3213}{unref} () const 
\begin{DoxyCompactList}\small\item\em delete this route \item\end{DoxyCompactList}\item 
\hypertarget{classSubnetRoute_ac33ea72550c0d09869aedb99ec69280b}{
uint16\_\-t {\bfseries refcount} () const }
\label{classSubnetRoute_ac33ea72550c0d09869aedb99ec69280b}

\item 
const \hyperlink{classPolicyTags}{PolicyTags} \& \hyperlink{classSubnetRoute_a44b56952cf36dd68509a7996ebd87790}{policytags} () const 
\item 
void \hyperlink{classSubnetRoute_a0640b9f1947feb7a15617d41bbf23364}{set\_\-policytags} (const \hyperlink{classPolicyTags}{PolicyTags} \&tags) const 
\begin{DoxyCompactList}\small\item\em Replaced policy tags of route. \item\end{DoxyCompactList}\item 
\hypertarget{classSubnetRoute_a352343c99025605ac9992fac0f402eba}{
const \hyperlink{classref__ptr}{RefPf} \& {\bfseries policyfilter} (uint32\_\-t i) const }
\label{classSubnetRoute_a352343c99025605ac9992fac0f402eba}

\item 
\hypertarget{classSubnetRoute_a3c54dc209032e372317cd20b9235b00b}{
void {\bfseries set\_\-policyfilter} (uint32\_\-t i, const \hyperlink{classref__ptr}{RefPf} \&pf) const }
\label{classSubnetRoute_a3c54dc209032e372317cd20b9235b00b}

\item 
\hypertarget{classSubnetRoute_a68b9cc290878fb841902e396bbcff454}{
void \hyperlink{classSubnetRoute_a68b9cc290878fb841902e396bbcff454}{set\_\-aggr\_\-brief\_\-mode} () const }
\label{classSubnetRoute_a68b9cc290878fb841902e396bbcff454}

\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} \char`\"{}brief\char`\"{} mode flag on an candidate for aggregation. \item\end{DoxyCompactList}\item 
\hypertarget{classSubnetRoute_aecbf24548f6485d51d82b3e976e81f3a}{
void \hyperlink{classSubnetRoute_aecbf24548f6485d51d82b3e976e81f3a}{clear\_\-aggr\_\-brief\_\-mode} () const }
\label{classSubnetRoute_aecbf24548f6485d51d82b3e976e81f3a}

\begin{DoxyCompactList}\small\item\em Clear \hyperlink{protocolthe-p}{the} \char`\"{}brief\char`\"{} mode flag on an candidate for aggregation. \item\end{DoxyCompactList}\item 
\hypertarget{classSubnetRoute_a327abe0e3a76a78e77c3f51dfefcf954}{
bool \hyperlink{classSubnetRoute_a327abe0e3a76a78e77c3f51dfefcf954}{aggr\_\-brief\_\-mode} () const }
\label{classSubnetRoute_a327abe0e3a76a78e77c3f51dfefcf954}

\begin{DoxyCompactList}\small\item\em Read \hyperlink{protocolthe-p}{the} \char`\"{}brief\char`\"{} aggregation mode flag. \item\end{DoxyCompactList}\item 
void \hyperlink{classSubnetRoute_aa7dc1815cbd6cb8d94ee7ec770e3a498}{set\_\-aggr\_\-prefix\_\-len} (uint32\_\-t preflen)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} target prefix length on an candidate for aggregation. \item\end{DoxyCompactList}\item 
uint32\_\-t \hyperlink{classSubnetRoute_ad17ee3e0aeb0f28d29bd8e5bcefd6944}{aggr\_\-prefix\_\-len} () const 
\begin{DoxyCompactList}\small\item\em Read \hyperlink{protocolthe-p}{the} aggregation prefix length marker. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classSubnetRoute_ac8b4169e628d5beeb26bf0c9b1c0adab}{$\sim$SubnetRoute} ()
\begin{DoxyCompactList}\small\item\em protected \hyperlink{classSubnetRoute}{SubnetRoute} destructor. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classSubnetRoute_a76e36c631cfe2af954341a124e24ddd6}{
void {\bfseries bump\_\-refcount} (int delta) const }
\label{classSubnetRoute_a76e36c631cfe2af954341a124e24ddd6}

\item 
\hypertarget{classSubnetRoute_a41a408503d5598f2bdb512968ea26955}{
const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ \& {\bfseries operator=} (const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ \&)}
\label{classSubnetRoute_a41a408503d5598f2bdb512968ea26955}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classSubnetRoute_abee22e405b58bf6d1b75f0813aa80fa7}{
\hyperlink{classIPNet}{IPNet}$<$ A $>$ \hyperlink{classSubnetRoute_abee22e405b58bf6d1b75f0813aa80fa7}{\_\-net}}
\label{classSubnetRoute_abee22e405b58bf6d1b75f0813aa80fa7}

\begin{DoxyCompactList}\small\item\em \_\-net is \hyperlink{protocolthe-p}{the} subnet (address and prefix) for this route. \item\end{DoxyCompactList}\item 
\hyperlink{classPAListRef}{PAListRef}$<$ A $>$ \hyperlink{classSubnetRoute_afc4b543b73521a3a487b408282cf5f2a}{\_\-attributes}
\begin{DoxyCompactList}\small\item\em \_\-attributes is a pointer to \hyperlink{protocolthe-p}{the} path attribute list for this route. \item\end{DoxyCompactList}\item 
const \hyperlink{classSubnetRoute}{SubnetRoute}$<$ A $>$ $\ast$ \hyperlink{classSubnetRoute_aee7506748d5aae82431a6283ee8bd5d9}{\_\-parent\_\-route}
\begin{DoxyCompactList}\small\item\em \_\-parent\_\-route is a pointer to \hyperlink{protocolthe-p}{the} original version of this route, before any filters modified it. \item\end{DoxyCompactList}\item 
\hypertarget{classSubnetRoute_a986b9257b1c648036469bb6c48c44490}{
\hyperlink{classRouteMetaData}{RouteMetaData} {\bfseries \_\-metadata}}
\label{classSubnetRoute_a986b9257b1c648036469bb6c48c44490}

\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classSubnetRoute_ac46f5725b3afd200915964fef8a5eade}{
class \hyperlink{classSubnetRoute_ac46f5725b3afd200915964fef8a5eade}{SubnetRouteRef$<$ A $>$}}
\label{classSubnetRoute_ac46f5725b3afd200915964fef8a5eade}

\item 
\hypertarget{classSubnetRoute_a77678275457f1fc4e3a4a7a7216941eb}{
class \hyperlink{classSubnetRoute_a77678275457f1fc4e3a4a7a7216941eb}{SubnetRouteConstRef$<$ A $>$}}
\label{classSubnetRoute_a77678275457f1fc4e3a4a7a7216941eb}

\end{DoxyCompactItemize}


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

\hyperlink{classSubnetRoute}{SubnetRoute} holds a BGP routing table entry. \hyperlink{classSubnetRoute}{SubnetRoute} is \hyperlink{protocolthe-p}{the} basic class used to hold a BGP routing table entry in BGP's internal representation. It's templated so \hyperlink{protocolthe-p}{the} same code can be used to hold \hyperlink{classIPv4}{IPv4} or \hyperlink{classIPv6}{IPv6} routes -\/ their representation is essentially \hyperlink{protocolthe-p}{the} same internally, even though they're encoded differently on \hyperlink{protocolthe-p}{the} wire by \hyperlink{protocolthe-p}{the} BGP protocol. A route essentially consists of \hyperlink{protocolthe-p}{the} subnet (address and prefix) referred to by \hyperlink{protocolthe-p}{the} route, a BGP path attribute list, and some metadata for our own use. When a route update from BGP comes it, it is split into multiple subnet routes, one for each NLRI (\hyperlink{classIPv4}{IPv4}) or MP\_\-REACH (\hyperlink{classIPv6}{IPv6}) attribute. \hyperlink{classSubnetRoute}{SubnetRoute} is also \hyperlink{protocolthe-p}{the} principle way routing information is passed around internally in our BGP implementation.

\hyperlink{classSubnetRoute}{SubnetRoute} is reference-\/counted -\/ delete should NOT normally be called directly on a \hyperlink{classSubnetRoute}{SubnetRoute}; instead unref should be called, which will decrement \hyperlink{protocolthe-p}{the} reference count, and delete \hyperlink{protocolthe-p}{the} instance if \hyperlink{protocolthe-p}{the} reference count has reached zero. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classSubnetRoute_a3a12e7aeb46e00fa19e2acfce7dff12b}{
\index{SubnetRoute@{SubnetRoute}!SubnetRoute@{SubnetRoute}}
\index{SubnetRoute@{SubnetRoute}!SubnetRoute@{SubnetRoute}}
\subsubsection[{SubnetRoute}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ {\bf SubnetRoute}$<$ A $>$::{\bf SubnetRoute} (
\begin{DoxyParamCaption}
\item[{const {\bf IPNet}$<$ A $>$ \&}]{net, }
\item[{{\bf PAListRef}$<$ A $>$}]{attributes, }
\item[{const {\bf SubnetRoute}$<$ A $>$ $\ast$}]{parent\_\-route}
\end{DoxyParamCaption}
)}}
\label{classSubnetRoute_a3a12e7aeb46e00fa19e2acfce7dff12b}


\hyperlink{classSubnetRoute}{SubnetRoute} constructor. 


\begin{DoxyParams}{Parameters}
{\em net} & \hyperlink{protocolthe-p}{the} subnet (address and prefix) this route refers to. \\
\hline
{\em attributes} & pointer to \hyperlink{protocolthe-p}{the} path attribute list associated with $\ast$ this route. \\
\hline
{\em parent\_\-route} & \hyperlink{protocolthe-p}{the} \hyperlink{classSubnetRoute}{SubnetRoute} that this route was derived from. For example, if a filter takes one \hyperlink{classSubnetRoute}{SubnetRoute} and generates a modified version, \hyperlink{protocolthe-p}{the} parent\_\-route of \hyperlink{protocolthe-p}{the} new one should point to \hyperlink{protocolthe-p}{the} original. If this is set to non-\/NULL, care must be taken to ensure \hyperlink{protocolthe-p}{the} original route is never deleted before \hyperlink{protocolthe-p}{the} derived route. \\
\hline
\end{DoxyParams}
\hypertarget{classSubnetRoute_a8e8ced1bd007326c56cb4a27b64bf92f}{
\index{SubnetRoute@{SubnetRoute}!SubnetRoute@{SubnetRoute}}
\index{SubnetRoute@{SubnetRoute}!SubnetRoute@{SubnetRoute}}
\subsubsection[{SubnetRoute}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ {\bf SubnetRoute}$<$ A $>$::{\bf SubnetRoute} (
\begin{DoxyParamCaption}
\item[{const {\bf IPNet}$<$ A $>$ \&}]{net, }
\item[{{\bf PAListRef}$<$ A $>$}]{attributes, }
\item[{const {\bf SubnetRoute}$<$ A $>$ $\ast$}]{parent\_\-route, }
\item[{uint32\_\-t}]{igp\_\-metric}
\end{DoxyParamCaption}
)}}
\label{classSubnetRoute_a8e8ced1bd007326c56cb4a27b64bf92f}


\hyperlink{classSubnetRoute}{SubnetRoute} constructor. 


\begin{DoxyParams}{Parameters}
{\em net} & \hyperlink{protocolthe-p}{the} subnet (address and prefix) this route refers to. \\
\hline
{\em attributes} & pointer to \hyperlink{protocolthe-p}{the} path attribute list associated with $\ast$ this route. \\
\hline
{\em parent\_\-route} & \hyperlink{protocolthe-p}{the} \hyperlink{classSubnetRoute}{SubnetRoute} that this route was derived from. For example, if a filter takes one \hyperlink{classSubnetRoute}{SubnetRoute} and generates a modified version, \hyperlink{protocolthe-p}{the} parent\_\-route of \hyperlink{protocolthe-p}{the} new one should point to \hyperlink{protocolthe-p}{the} original. If this is set to non-\/NULL, care must be taken to ensure \hyperlink{protocolthe-p}{the} original route is never deleted before \hyperlink{protocolthe-p}{the} derived route. \\
\hline
{\em igp\_\-metric} & \hyperlink{protocolthe-p}{the} IGP routing protocol metric to reach \hyperlink{protocolthe-p}{the} nexthop obtained from \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB}. \\
\hline
\end{DoxyParams}
\hypertarget{classSubnetRoute_ac8b4169e628d5beeb26bf0c9b1c0adab}{
\index{SubnetRoute@{SubnetRoute}!$\sim$SubnetRoute@{$\sim$SubnetRoute}}
\index{$\sim$SubnetRoute@{$\sim$SubnetRoute}!SubnetRoute@{SubnetRoute}}
\subsubsection[{$\sim$SubnetRoute}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A $>$ {\bf SubnetRoute}$<$ A $>$::$\sim${\bf SubnetRoute} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classSubnetRoute_ac8b4169e628d5beeb26bf0c9b1c0adab}


protected \hyperlink{classSubnetRoute}{SubnetRoute} destructor. 

The destructor is protected because you are not supposed to directly delete a \hyperlink{classSubnetRoute}{SubnetRoute}. Instead you should call \hyperlink{classSubnetRoute_a82e1a04c36338d39a495b8bbc11e3213}{unref()} and \hyperlink{protocolthe-p}{the} \hyperlink{classSubnetRoute}{SubnetRoute} will be deleted when it's reference count reaches zero. 

\subsection{Member Function Documentation}
\hypertarget{classSubnetRoute_ad17ee3e0aeb0f28d29bd8e5bcefd6944}{
\index{SubnetRoute@{SubnetRoute}!aggr\_\-prefix\_\-len@{aggr\_\-prefix\_\-len}}
\index{aggr\_\-prefix\_\-len@{aggr\_\-prefix\_\-len}!SubnetRoute@{SubnetRoute}}
\subsubsection[{aggr\_\-prefix\_\-len}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ uint32\_\-t {\bf SubnetRoute}$<$ A $>$::aggr\_\-prefix\_\-len (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_ad17ee3e0aeb0f28d29bd8e5bcefd6944}


Read \hyperlink{protocolthe-p}{the} aggregation prefix length marker. 

The field is also used for storing aggregation markers. \hypertarget{classSubnetRoute_a7a66c6f4768dd4508baf7b0d97dae047}{
\index{SubnetRoute@{SubnetRoute}!attributes@{attributes}}
\index{attributes@{attributes}!SubnetRoute@{SubnetRoute}}
\subsubsection[{attributes}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ {\bf PAListRef}$<$A$>$ {\bf SubnetRoute}$<$ A $>$::attributes (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_a7a66c6f4768dd4508baf7b0d97dae047}
\begin{DoxyReturn}{Returns}
a pointer to \hyperlink{protocolthe-p}{the} path attribute list for this route. 
\end{DoxyReturn}
\hypertarget{classSubnetRoute_a4c804889a98f65093cdaca3a93c98200}{
\index{SubnetRoute@{SubnetRoute}!igp\_\-metric@{igp\_\-metric}}
\index{igp\_\-metric@{igp\_\-metric}!SubnetRoute@{SubnetRoute}}
\subsubsection[{igp\_\-metric}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ uint32\_\-t {\bf SubnetRoute}$<$ A $>$::igp\_\-metric (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_a4c804889a98f65093cdaca3a93c98200}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} IGP routing protocol metric that applied when \hyperlink{protocolthe-p}{the} route won \hyperlink{protocolthe-p}{the} decision process. If \hyperlink{protocolthe-p}{the} route has not won, this value is undefined. 
\end{DoxyReturn}
\hypertarget{classSubnetRoute_a2b84c8a79b5bc63f6ed4de6c50260747}{
\index{SubnetRoute@{SubnetRoute}!in\_\-use@{in\_\-use}}
\index{in\_\-use@{in\_\-use}!SubnetRoute@{SubnetRoute}}
\subsubsection[{in\_\-use}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ bool {\bf SubnetRoute}$<$ A $>$::in\_\-use (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_a2b84c8a79b5bc63f6ed4de6c50260747}
\begin{DoxyReturn}{Returns}
whether or not this route is in use. \char`\"{}in use\char`\"{} here does not mean \hyperlink{protocolthe-p}{the} route won \hyperlink{protocolthe-p}{the} decision process, but rather that it was at least a contender for decision, and was not filtered in \hyperlink{protocolthe-p}{the} incoming filter bank. 
\end{DoxyReturn}
\hypertarget{classSubnetRoute_a8b1187ddaaac7f13d3de24dceb803cd2}{
\index{SubnetRoute@{SubnetRoute}!is\_\-filtered@{is\_\-filtered}}
\index{is\_\-filtered@{is\_\-filtered}!SubnetRoute@{SubnetRoute}}
\subsubsection[{is\_\-filtered}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ bool {\bf SubnetRoute}$<$ A $>$::is\_\-filtered (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_a8b1187ddaaac7f13d3de24dceb803cd2}


is\_\-filtered returns true if \hyperlink{protocolthe-p}{the} route was filtered out by \hyperlink{protocolthe-p}{the} incoming filter bank, false otherwise. 

As such it only makes sense calling this on routes that are stored in \hyperlink{protocolthe-p}{the} RibIn. \hypertarget{classSubnetRoute_a0b9f35084af5a9865790fc3fd7670a91}{
\index{SubnetRoute@{SubnetRoute}!is\_\-winner@{is\_\-winner}}
\index{is\_\-winner@{is\_\-winner}!SubnetRoute@{SubnetRoute}}
\subsubsection[{is\_\-winner}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ bool {\bf SubnetRoute}$<$ A $>$::is\_\-winner (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_a0b9f35084af5a9865790fc3fd7670a91}


returns true if \hyperlink{protocolthe-p}{the} route was chosen by \hyperlink{protocolthe-p}{the} routing decision process as \hyperlink{protocolthe-p}{the} winning route for this subnet. 

is\_\-winner should NOT be called by anything other than \hyperlink{protocolthe-p}{the} \hyperlink{classDecisionTable}{DecisionTable} because caching means that it may not return \hyperlink{protocolthe-p}{the} right answer anywhere else \hypertarget{classSubnetRoute_ae8a2629d4b88cf7786662b5471bfc14a}{
\index{SubnetRoute@{SubnetRoute}!net@{net}}
\index{net@{net}!SubnetRoute@{SubnetRoute}}
\subsubsection[{net}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ const {\bf IPNet}$<$A$>$\& {\bf SubnetRoute}$<$ A $>$::net (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_ae8a2629d4b88cf7786662b5471bfc14a}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} subnet this route refers to. 
\end{DoxyReturn}
\hypertarget{classSubnetRoute_a550b8796e9260466aaf74857a66b2531}{
\index{SubnetRoute@{SubnetRoute}!operator==@{operator==}}
\index{operator==@{operator==}!SubnetRoute@{SubnetRoute}}
\subsubsection[{operator==}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ bool {\bf SubnetRoute}$<$ A $>$::operator== (
\begin{DoxyParamCaption}
\item[{const {\bf SubnetRoute}$<$ A $>$ \&}]{them}
\end{DoxyParamCaption}
) const}}
\label{classSubnetRoute_a550b8796e9260466aaf74857a66b2531}


Equality comparison for SubnetRoutes. 

Equality comparison for SubnetRoutes. Only \hyperlink{protocolthe-p}{the} subnet and attributes are compared, not \hyperlink{protocolthe-p}{the} metadata such as flags, igp\_\-metric, etc


\begin{DoxyParams}{Parameters}
{\em them} & \hyperlink{classRoute}{Route} to be compared against. \\
\hline
\end{DoxyParams}
\hypertarget{classSubnetRoute_ab0df1f6b7a99df43463167191e160702}{
\index{SubnetRoute@{SubnetRoute}!original\_\-route@{original\_\-route}}
\index{original\_\-route@{original\_\-route}!SubnetRoute@{SubnetRoute}}
\subsubsection[{original\_\-route}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ const {\bf SubnetRoute}$<$A$>$$\ast$ {\bf SubnetRoute}$<$ A $>$::original\_\-route (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_ab0df1f6b7a99df43463167191e160702}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} original version of this route, before any filters were applied to it to modify it. If no filters have been applied, this may be this route itself. 
\end{DoxyReturn}
\hypertarget{classSubnetRoute_a11cb4dc2a6aaa19caa183cad0305beeb}{
\index{SubnetRoute@{SubnetRoute}!parent\_\-route@{parent\_\-route}}
\index{parent\_\-route@{parent\_\-route}!SubnetRoute@{SubnetRoute}}
\subsubsection[{parent\_\-route}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ const {\bf SubnetRoute}$<$A$>$$\ast$ {\bf SubnetRoute}$<$ A $>$::parent\_\-route (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_a11cb4dc2a6aaa19caa183cad0305beeb}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} original version of this route, before any filters were applied to it to modify it. If no filters have been applied, NULL will be returned. 
\end{DoxyReturn}
\hypertarget{classSubnetRoute_a44b56952cf36dd68509a7996ebd87790}{
\index{SubnetRoute@{SubnetRoute}!policytags@{policytags}}
\index{policytags@{policytags}!SubnetRoute@{SubnetRoute}}
\subsubsection[{policytags}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ const {\bf PolicyTags}\& {\bf SubnetRoute}$<$ A $>$::policytags (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_a44b56952cf36dd68509a7996ebd87790}
\begin{DoxyReturn}{Returns}
policy tags associated with route. 
\end{DoxyReturn}
\hypertarget{classSubnetRoute_aa7dc1815cbd6cb8d94ee7ec770e3a498}{
\index{SubnetRoute@{SubnetRoute}!set\_\-aggr\_\-prefix\_\-len@{set\_\-aggr\_\-prefix\_\-len}}
\index{set\_\-aggr\_\-prefix\_\-len@{set\_\-aggr\_\-prefix\_\-len}!SubnetRoute@{SubnetRoute}}
\subsubsection[{set\_\-aggr\_\-prefix\_\-len}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf SubnetRoute}$<$ A $>$::set\_\-aggr\_\-prefix\_\-len (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{preflen}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_aa7dc1815cbd6cb8d94ee7ec770e3a498}


Set \hyperlink{protocolthe-p}{the} target prefix length on an candidate for aggregation. 

The field is also used for storing aggregation markers.


\begin{DoxyParams}{Parameters}
{\em preflen} & prefix length of \hyperlink{protocolthe-p}{the} requested aggregate route. \\
\hline
\end{DoxyParams}
\hypertarget{classSubnetRoute_a6810220461cf84bb4106275211d5a07d}{
\index{SubnetRoute@{SubnetRoute}!set\_\-filtered@{set\_\-filtered}}
\index{set\_\-filtered@{set\_\-filtered}!SubnetRoute@{SubnetRoute}}
\subsubsection[{set\_\-filtered}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A $>$ void {\bf SubnetRoute}$<$ A $>$::set\_\-filtered (
\begin{DoxyParamCaption}
\item[{bool}]{filtered}
\end{DoxyParamCaption}
) const}}
\label{classSubnetRoute_a6810220461cf84bb4106275211d5a07d}


set\_\-filtered record whether or not \hyperlink{protocolthe-p}{the} route was filtered out by \hyperlink{protocolthe-p}{the} incoming filter bank. 

As such it only makes sense calling this on routes that are stored in \hyperlink{protocolthe-p}{the} RibIn.


\begin{DoxyParams}{Parameters}
{\em filtered} & true if \hyperlink{protocolthe-p}{the} route was filtered, false otherwise. \\
\hline
\end{DoxyParams}
\hypertarget{classSubnetRoute_aee4c9f46f2db427d9fbc82cda1979707}{
\index{SubnetRoute@{SubnetRoute}!set\_\-in\_\-use@{set\_\-in\_\-use}}
\index{set\_\-in\_\-use@{set\_\-in\_\-use}!SubnetRoute@{SubnetRoute}}
\subsubsection[{set\_\-in\_\-use}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A $>$ void {\bf SubnetRoute}$<$ A $>$::set\_\-in\_\-use (
\begin{DoxyParamCaption}
\item[{bool}]{used}
\end{DoxyParamCaption}
) const}}
\label{classSubnetRoute_aee4c9f46f2db427d9fbc82cda1979707}


Record whether or not this route is in use. 

\char`\"{}in use\char`\"{} here does not mean \hyperlink{protocolthe-p}{the} route won \hyperlink{protocolthe-p}{the} decision process, but rather that it was at least a contender for decision, and was not filtered in \hyperlink{protocolthe-p}{the} incoming filter bank.


\begin{DoxyParams}{Parameters}
{\em used} & true if \hyperlink{protocolthe-p}{the} route is \char`\"{}in use\char`\"{}. \\
\hline
\end{DoxyParams}
\hypertarget{classSubnetRoute_ae8b388d5862e4ea8a79a4f6bc115d68f}{
\index{SubnetRoute@{SubnetRoute}!set\_\-is\_\-winner@{set\_\-is\_\-winner}}
\index{set\_\-is\_\-winner@{set\_\-is\_\-winner}!SubnetRoute@{SubnetRoute}}
\subsubsection[{set\_\-is\_\-winner}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A $>$ void {\bf SubnetRoute}$<$ A $>$::set\_\-is\_\-winner (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{igp\_\-metric}
\end{DoxyParamCaption}
) const}}
\label{classSubnetRoute_ae8b388d5862e4ea8a79a4f6bc115d68f}


when a route is chosen by \hyperlink{protocolthe-p}{the} routing decision process as \hyperlink{protocolthe-p}{the} winning route for this subnet, set\_\-is\_\-winner should be called to record this fact and to record \hyperlink{protocolthe-p}{the} igp\_\-metric at \hyperlink{protocolthe-p}{the} time \hyperlink{protocolthe-p}{the} route was chosen. 

set\_\-is\_\-winner should NOT be called by anything other than \hyperlink{protocolthe-p}{the} \hyperlink{classDecisionTable}{DecisionTable} because caching means that it may not return \hyperlink{protocolthe-p}{the} right answer anywhere else \hypertarget{classSubnetRoute_abdab59ade2ea7da1c42a3d0f5e6f4c0d}{
\index{SubnetRoute@{SubnetRoute}!set\_\-parent\_\-route@{set\_\-parent\_\-route}}
\index{set\_\-parent\_\-route@{set\_\-parent\_\-route}!SubnetRoute@{SubnetRoute}}
\subsubsection[{set\_\-parent\_\-route}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf SubnetRoute}$<$ A $>$::set\_\-parent\_\-route (
\begin{DoxyParamCaption}
\item[{const {\bf SubnetRoute}$<$ A $>$ $\ast$}]{parent}
\end{DoxyParamCaption}
)}}
\label{classSubnetRoute_abdab59ade2ea7da1c42a3d0f5e6f4c0d}


record \hyperlink{protocolthe-p}{the} original version of this route, before any filters were applied. 


\begin{DoxyParams}{Parameters}
{\em parent} & \hyperlink{protocolthe-p}{the} original version of this route. \\
\hline
\end{DoxyParams}
\hypertarget{classSubnetRoute_a0640b9f1947feb7a15617d41bbf23364}{
\index{SubnetRoute@{SubnetRoute}!set\_\-policytags@{set\_\-policytags}}
\index{set\_\-policytags@{set\_\-policytags}!SubnetRoute@{SubnetRoute}}
\subsubsection[{set\_\-policytags}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ void {\bf SubnetRoute}$<$ A $>$::set\_\-policytags (
\begin{DoxyParamCaption}
\item[{const {\bf PolicyTags} \&}]{tags}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classSubnetRoute_a0640b9f1947feb7a15617d41bbf23364}


Replaced policy tags of route. 


\begin{DoxyParams}{Parameters}
{\em tags} & new policy tags for route. \\
\hline
\end{DoxyParams}
\hypertarget{classSubnetRoute_ac79ea7858c1e43577f47a4a1a1266123}{
\index{SubnetRoute@{SubnetRoute}!str@{str}}
\index{str@{str}!SubnetRoute@{SubnetRoute}}
\subsubsection[{str}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A $>$ string {\bf SubnetRoute}$<$ A $>$::str (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classSubnetRoute_ac79ea7858c1e43577f47a4a1a1266123}
\begin{DoxyReturn}{Returns}
a string representation of \hyperlink{protocolthe-p}{the} route for debugging purposes 
\end{DoxyReturn}
\hypertarget{classSubnetRoute_a82e1a04c36338d39a495b8bbc11e3213}{
\index{SubnetRoute@{SubnetRoute}!unref@{unref}}
\index{unref@{unref}!SubnetRoute@{SubnetRoute}}
\subsubsection[{unref}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A $>$ void {\bf SubnetRoute}$<$ A $>$::unref (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classSubnetRoute_a82e1a04c36338d39a495b8bbc11e3213}


delete this route 

unref is called to delete a \hyperlink{classSubnetRoute}{SubnetRoute}, and should be called instead of calling delete on \hyperlink{protocolthe-p}{the} route. SubnetRoutes are reference-\/counted, so unref decrements \hyperlink{protocolthe-p}{the} reference count and deletes \hyperlink{protocolthe-p}{the} storage only if \hyperlink{protocolthe-p}{the} reference count reaches zero. 

\subsection{Member Data Documentation}
\hypertarget{classSubnetRoute_afc4b543b73521a3a487b408282cf5f2a}{
\index{SubnetRoute@{SubnetRoute}!\_\-attributes@{\_\-attributes}}
\index{\_\-attributes@{\_\-attributes}!SubnetRoute@{SubnetRoute}}
\subsubsection[{\_\-attributes}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ {\bf PAListRef}$<$A$>$ {\bf SubnetRoute}$<$ A $>$::{\bf \_\-attributes}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classSubnetRoute_afc4b543b73521a3a487b408282cf5f2a}


\_\-attributes is a pointer to \hyperlink{protocolthe-p}{the} path attribute list for this route. 

The actual data storage for \hyperlink{protocolthe-p}{the} path attribute list is handled inside \hyperlink{protocolthe-p}{the} attribute manager \hypertarget{classSubnetRoute_aee7506748d5aae82431a6283ee8bd5d9}{
\index{SubnetRoute@{SubnetRoute}!\_\-parent\_\-route@{\_\-parent\_\-route}}
\index{\_\-parent\_\-route@{\_\-parent\_\-route}!SubnetRoute@{SubnetRoute}}
\subsubsection[{\_\-parent\_\-route}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ const {\bf SubnetRoute}$<$A$>$$\ast$ {\bf SubnetRoute}$<$ A $>$::{\bf \_\-parent\_\-route}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classSubnetRoute_aee7506748d5aae82431a6283ee8bd5d9}


\_\-parent\_\-route is a pointer to \hyperlink{protocolthe-p}{the} original version of this route, before any filters modified it. 

It may be NULL, indicating this is \hyperlink{protocolthe-p}{the} original version. 

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