\hypertarget{classExternalRoutes}{
\section{ExternalRoutes Class Reference}
\label{classExternalRoutes}\index{ExternalRoutes@{ExternalRoutes}}
}


Class which manages distribution of external routes throughout \hyperlink{protocolthe-p}{the} OLSR domain.  




{\ttfamily \#include $<$external.hh$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classExternalRoutes_af4602950657a90918984eb0c10040c0e}{
{\bfseries ExternalRoutes} (\hyperlink{classOlsr}{Olsr} \&olsr, \hyperlink{classEventLoop}{EventLoop} \&eventloop, \hyperlink{classFaceManager}{FaceManager} \&fm, \hyperlink{classNeighborhood}{Neighborhood} \&nh)}
\label{classExternalRoutes_af4602950657a90918984eb0c10040c0e}

\item 
\hypertarget{classExternalRoutes_a98248a47e93d38847e8ddac593eff88a}{
\hyperlink{classFaceManager}{FaceManager} \& {\bfseries face\_\-manager} ()}
\label{classExternalRoutes_a98248a47e93d38847e8ddac593eff88a}

\item 
\hypertarget{classExternalRoutes_a973fea2d317fd4ad7fa4ce034de28e1f}{
\hyperlink{classRouteManager}{RouteManager} $\ast$ {\bfseries route\_\-manager} ()}
\label{classExternalRoutes_a973fea2d317fd4ad7fa4ce034de28e1f}

\item 
\hypertarget{classExternalRoutes_a0dfb46396e5925cc544866b17d739299}{
void {\bfseries set\_\-route\_\-manager} (\hyperlink{classRouteManager}{RouteManager} $\ast$rm)}
\label{classExternalRoutes_a0dfb46396e5925cc544866b17d739299}

\item 
\hypertarget{classExternalRoutes_a7599b8b6417881ef079f8d38779fd361}{
\hyperlink{classTimeVal}{TimeVal} {\bfseries get\_\-hna\_\-interval} () const }
\label{classExternalRoutes_a7599b8b6417881ef079f8d38779fd361}

\item 
void \hyperlink{classExternalRoutes_a96e1203e7ca98fb2bbde34892b94dbb0}{set\_\-hna\_\-interval} (const \hyperlink{classTimeVal}{TimeVal} \&hna\_\-interval)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} HNA send timer. \item\end{DoxyCompactList}\item 
\hypertarget{classExternalRoutes_ad0ee3bfc5ac155a6723e694847d99334}{
\hyperlink{classTimeVal}{TimeVal} {\bfseries get\_\-hna\_\-hold\_\-time} () const }
\label{classExternalRoutes_ad0ee3bfc5ac155a6723e694847d99334}

\item 
\hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} \hyperlink{classExternalRoutes_a740de140006a40a5dd1dcac66fbfcae7}{update\_\-hna\_\-route\_\-in} (const \hyperlink{classIPNet}{IPv4Net} \&dest, const \hyperlink{classIPv4}{IPv4} \&lasthop, const uint16\_\-t distance, const \hyperlink{classTimeVal}{TimeVal} \&expiry\_\-time, bool \&is\_\-created)  throw (BadExternalRoute)
\begin{DoxyCompactList}\small\item\em Update or create a route entry learned from HNA. \item\end{DoxyCompactList}\item 
\hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} \hyperlink{classExternalRoutes_ad37acd466df8beb56b2e0705c7695a57}{add\_\-hna\_\-route\_\-in} (const \hyperlink{classIPNet}{IPv4Net} \&dest, const \hyperlink{classIPv4}{IPv4} \&lasthop, const uint16\_\-t distance, const \hyperlink{classTimeVal}{TimeVal} \&expiry\_\-time)  throw (BadExternalRoute)
\begin{DoxyCompactList}\small\item\em Create a route entry learned from HNA. \item\end{DoxyCompactList}\item 
bool \hyperlink{classExternalRoutes_afbb1efae6147f9f990b83a198e52e84b}{delete\_\-hna\_\-route\_\-in} (\hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} erid)
\begin{DoxyCompactList}\small\item\em Delete an HNA learned route entry given its ID. \item\end{DoxyCompactList}\item 
\hypertarget{classExternalRoutes_ae831eb1af000e5e0247654b59ec75cbf}{
void \hyperlink{classExternalRoutes_ae831eb1af000e5e0247654b59ec75cbf}{clear\_\-hna\_\-routes\_\-in} ()}
\label{classExternalRoutes_ae831eb1af000e5e0247654b59ec75cbf}

\begin{DoxyCompactList}\small\item\em Clear \hyperlink{protocolthe-p}{the} learned HNA routes. \item\end{DoxyCompactList}\item 
const \hyperlink{classExternalRoute}{ExternalRoute} $\ast$ \hyperlink{classExternalRoutes_aad975a794f239a84509bca4e7d18af23}{get\_\-hna\_\-route\_\-in} (const \hyperlink{classIPNet}{IPv4Net} \&dest, const \hyperlink{classIPv4}{IPv4} \&lasthop)  throw (BadExternalRoute)
\begin{DoxyCompactList}\small\item\em Look up an \hyperlink{classExternalRoute}{ExternalRoute} learned from HNA, given its origin and destination network prefix. \item\end{DoxyCompactList}\item 
\hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} \hyperlink{classExternalRoutes_a3b44aea5ce874453b0689b6d2f057f11}{get\_\-hna\_\-route\_\-in\_\-id} (const \hyperlink{classIPNet}{IPv4Net} \&dest, const \hyperlink{classIPv4}{IPv4} \&lasthop)  throw (BadExternalRoute)
\begin{DoxyCompactList}\small\item\em Look up \hyperlink{protocolthe-p}{the} ID of a learned HNA entry. \item\end{DoxyCompactList}\item 
const \hyperlink{classExternalRoute}{ExternalRoute} $\ast$ \hyperlink{classExternalRoutes_a1fc9df4345f70e8d5587f8ff7728cd99}{get\_\-hna\_\-route\_\-in\_\-by\_\-id} (const \hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} erid)  throw (BadExternalRoute)
\begin{DoxyCompactList}\small\item\em Look up a learned HNA route entry by its ID. \item\end{DoxyCompactList}\item 
size\_\-t \hyperlink{classExternalRoutes_a92bc779cd3b458405147ed2ee2c992d9}{hna\_\-origin\_\-count} () const 
\begin{DoxyCompactList}\small\item\em Calculate \hyperlink{protocolthe-p}{the} number of unique OLSR nodes with HNA entries in this node's HNA learned route database. \item\end{DoxyCompactList}\item 
size\_\-t \hyperlink{classExternalRoutes_a502d415d23fd9307e24304d36f91dc30}{hna\_\-dest\_\-count} () const 
\begin{DoxyCompactList}\small\item\em Calculate \hyperlink{protocolthe-p}{the} number of unique HNA prefixes which have been learned. \item\end{DoxyCompactList}\item 
size\_\-t \hyperlink{classExternalRoutes_ae4408d7619363443dbfac00380780c01}{hna\_\-entry\_\-count} () const 
\item 
void \hyperlink{classExternalRoutes_abeb6ead2f45fe59c42cc62a1919d8f97}{get\_\-hna\_\-route\_\-in\_\-list} (list$<$ \hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} $>$ \&hnalist)
\begin{DoxyCompactList}\small\item\em Fill out a list of all \hyperlink{protocolthe-p}{the} external learned route IDs. \item\end{DoxyCompactList}\item 
bool \hyperlink{classExternalRoutes_a23a5333b8ab49bdffd12e5e98114d437}{originate\_\-hna\_\-route\_\-out} (const \hyperlink{classIPNet}{IPv4Net} \&dest)  throw (BadExternalRoute)
\begin{DoxyCompactList}\small\item\em Originate an HNA route. \item\end{DoxyCompactList}\item 
void \hyperlink{classExternalRoutes_a98d74bd97293bc53b45f06127f8d8308}{withdraw\_\-hna\_\-route\_\-out} (const \hyperlink{classIPNet}{IPv4Net} \&dest)  throw (BadExternalRoute)
\begin{DoxyCompactList}\small\item\em Withdraw an HNA route. \item\end{DoxyCompactList}\item 
\hypertarget{classExternalRoutes_a894546c71d473baaf124d6c0c0a11015}{
void \hyperlink{classExternalRoutes_a894546c71d473baaf124d6c0c0a11015}{clear\_\-hna\_\-routes\_\-out} ()}
\label{classExternalRoutes_a894546c71d473baaf124d6c0c0a11015}

\begin{DoxyCompactList}\small\item\em Clear \hyperlink{protocolthe-p}{the} advertised HNA routes. \item\end{DoxyCompactList}\item 
\hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} \hyperlink{classExternalRoutes_a848988eed56173cf5c5bdac89bda56c5}{get\_\-hna\_\-route\_\-out\_\-id} (const \hyperlink{classIPNet}{IPv4Net} \&dest)  throw (BadExternalRoute)
\begin{DoxyCompactList}\small\item\em Look up \hyperlink{protocolthe-p}{the} ID of an originated HNA entry. \item\end{DoxyCompactList}\item 
void \hyperlink{classExternalRoutes_a154b7dbd3b7b20e4e9121dcf3a3afb15}{push\_\-external\_\-routes} ()
\begin{DoxyCompactList}\small\item\em \hyperlink{classPush}{Push} candidate HNA routes to \hyperlink{protocolthe-p}{the} \hyperlink{classRouteManager}{RouteManager}. \item\end{DoxyCompactList}\item 
\hypertarget{classExternalRoutes_a80ad4b65a33691258553a3e9332bf808}{
void {\bfseries start\_\-hna\_\-send\_\-timer} ()}
\label{classExternalRoutes_a80ad4b65a33691258553a3e9332bf808}

\item 
\hypertarget{classExternalRoutes_a462e96e5337ffc9838860f6bc9118d6b}{
void {\bfseries stop\_\-hna\_\-send\_\-timer} ()}
\label{classExternalRoutes_a462e96e5337ffc9838860f6bc9118d6b}

\item 
\hypertarget{classExternalRoutes_a0a089e503479d2294722463081954d84}{
void {\bfseries restart\_\-hna\_\-send\_\-timer} ()}
\label{classExternalRoutes_a0a089e503479d2294722463081954d84}

\item 
\hypertarget{classExternalRoutes_a2f072992c1e6a24861f876100048a865}{
void \hyperlink{classExternalRoutes_a2f072992c1e6a24861f876100048a865}{reschedule\_\-hna\_\-send\_\-timer} ()}
\label{classExternalRoutes_a2f072992c1e6a24861f876100048a865}

\begin{DoxyCompactList}\small\item\em Reschedule \hyperlink{protocolthe-p}{the} HNA send timer (if \hyperlink{protocolthe-p}{the} HNA interval has changed). \item\end{DoxyCompactList}\item 
\hypertarget{classExternalRoutes_ab564e41d6568f6535abdb1b39492576b}{
void \hyperlink{classExternalRoutes_ab564e41d6568f6535abdb1b39492576b}{reschedule\_\-immediate\_\-hna\_\-send\_\-timer} ()}
\label{classExternalRoutes_ab564e41d6568f6535abdb1b39492576b}

\begin{DoxyCompactList}\small\item\em Schedule \hyperlink{protocolthe-p}{the} HNA send timer to fire as soon as possible. \item\end{DoxyCompactList}\item 
bool \hyperlink{classExternalRoutes_ad4358e8940fb336f9548482fd6f55684}{event\_\-send\_\-hna} ()
\begin{DoxyCompactList}\small\item\em Callback method to: service \hyperlink{protocolthe-p}{the} HNA transmission timer. \item\end{DoxyCompactList}\item 
bool \hyperlink{classExternalRoutes_ad8ae98dd20525cfa573ef80e33fb0789}{event\_\-receive\_\-hna} (\hyperlink{classMessage}{Message} $\ast$msg, const \hyperlink{classIPv4}{IPv4} \&remote\_\-addr, const \hyperlink{classIPv4}{IPv4} \&local\_\-addr)
\begin{DoxyCompactList}\small\item\em Process incoming HNA message. \item\end{DoxyCompactList}\item 
void \hyperlink{classExternalRoutes_a22b18e6ff817769ee5bfb8d33616f494}{event\_\-hna\_\-route\_\-in\_\-expired} (const \hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} erid)
\begin{DoxyCompactList}\small\item\em Callback method to: delete a learned route entry when it expires. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classExternalRoutes_abef32cb98b3e8e9a9cb455eebfe2825b}{
typedef multimap$<$ \hyperlink{classIPNet}{IPv4Net}, \hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} $>$ \hyperlink{classExternalRoutes_abef32cb98b3e8e9a9cb455eebfe2825b}{ExternalDestInMap}}
\label{classExternalRoutes_abef32cb98b3e8e9a9cb455eebfe2825b}

\begin{DoxyCompactList}\small\item\em Map of learned routes by destination to route ID covering that destination. \item\end{DoxyCompactList}\item 
\hypertarget{classExternalRoutes_aa449f7ed27280b5738d50b1ecf7853f5}{
typedef map$<$ \hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID}, \hyperlink{classExternalRoute}{ExternalRoute} $\ast$ $>$ \hyperlink{classExternalRoutes_aa449f7ed27280b5738d50b1ecf7853f5}{ExternalRouteMap}}
\label{classExternalRoutes_aa449f7ed27280b5738d50b1ecf7853f5}

\begin{DoxyCompactList}\small\item\em HNA entries learned by this node. \item\end{DoxyCompactList}\item 
\hypertarget{classExternalRoutes_afb6d9692c52b929dce738d56dd7c39ba}{
typedef map$<$ \hyperlink{classIPNet}{IPv4Net}, \hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} $>$ \hyperlink{classExternalRoutes_afb6d9692c52b929dce738d56dd7c39ba}{ExternalDestOutMap}}
\label{classExternalRoutes_afb6d9692c52b929dce738d56dd7c39ba}

\begin{DoxyCompactList}\small\item\em Map of originated route IDs by destination. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classExternalRoutes_ae2243568ad427f447efebd6b25c1cbec}{
\hyperlink{classOlsr}{Olsr} \& {\bfseries \_\-olsr}}
\label{classExternalRoutes_ae2243568ad427f447efebd6b25c1cbec}

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

\item 
\hypertarget{classExternalRoutes_a79679d53ba096e94b80f645a1f413aa2}{
\hyperlink{classFaceManager}{FaceManager} \& {\bfseries \_\-fm}}
\label{classExternalRoutes_a79679d53ba096e94b80f645a1f413aa2}

\item 
\hypertarget{classExternalRoutes_af58f4e8af973d8e70356a74340c66703}{
\hyperlink{classNeighborhood}{Neighborhood} \& {\bfseries \_\-nh}}
\label{classExternalRoutes_af58f4e8af973d8e70356a74340c66703}

\item 
\hypertarget{classExternalRoutes_a7c0c1fb13b2a68fe6dcc62755f83e018}{
\hyperlink{classRouteManager}{RouteManager} $\ast$ {\bfseries \_\-rm}}
\label{classExternalRoutes_a7c0c1fb13b2a68fe6dcc62755f83e018}

\item 
\hypertarget{classExternalRoutes_ae83f55e3370ad274f8537a2a61b68a20}{
\hyperlink{structExternalRouteOrderPred}{ExternalRouteOrderPred} {\bfseries \_\-routes\_\-in\_\-order\_\-pred}}
\label{classExternalRoutes_ae83f55e3370ad274f8537a2a61b68a20}

\item 
\hypertarget{classExternalRoutes_abad9d6b6dcc3e7a021c17943b32352a5}{
bool {\bfseries \_\-is\_\-early\_\-hna\_\-enabled}}
\label{classExternalRoutes_abad9d6b6dcc3e7a021c17943b32352a5}

\item 
\hypertarget{classExternalRoutes_a32702fcbcaadc36238dd44f51ca6e9aa}{
\hyperlink{structOlsrTypes_a8f9558c89c7067886dac838b22385ad9}{OlsrTypes::ExternalID} {\bfseries \_\-next\_\-erid}}
\label{classExternalRoutes_a32702fcbcaadc36238dd44f51ca6e9aa}

\item 
\hypertarget{classExternalRoutes_aff0342cce8e949f464bbae2c49e159c0}{
\hyperlink{classTimeVal}{TimeVal} \hyperlink{classExternalRoutes_aff0342cce8e949f464bbae2c49e159c0}{\_\-hna\_\-interval}}
\label{classExternalRoutes_aff0342cce8e949f464bbae2c49e159c0}

\begin{DoxyCompactList}\small\item\em \hyperlink{protocolthe-p}{the} interval at which HNA broadcasts are flooded throughout \hyperlink{protocolthe-p}{the} OLSR domain by this node, if routes are originated. \item\end{DoxyCompactList}\item 
\hypertarget{classExternalRoutes_a21967705a2cf0c5d03eb1fc612597df3}{
\hyperlink{classXorpTimer}{XorpTimer} {\bfseries \_\-hna\_\-send\_\-timer}}
\label{classExternalRoutes_a21967705a2cf0c5d03eb1fc612597df3}

\item 
\hypertarget{classExternalRoutes_a6efc911337f62b9a36cba532dd1e8a3b}{
\hyperlink{classExternalRoutes_abef32cb98b3e8e9a9cb455eebfe2825b}{ExternalDestInMap} {\bfseries \_\-routes\_\-in\_\-by\_\-dest}}
\label{classExternalRoutes_a6efc911337f62b9a36cba532dd1e8a3b}

\item 
\hypertarget{classExternalRoutes_ae0b4b6cb58927a1507eb1ca41b119177}{
\hyperlink{classExternalRoutes_aa449f7ed27280b5738d50b1ecf7853f5}{ExternalRouteMap} {\bfseries \_\-routes\_\-in}}
\label{classExternalRoutes_ae0b4b6cb58927a1507eb1ca41b119177}

\item 
\hypertarget{classExternalRoutes_a913183128a2db876ad1595e1226c79b2}{
\hyperlink{classExternalRoutes_afb6d9692c52b929dce738d56dd7c39ba}{ExternalDestOutMap} {\bfseries \_\-routes\_\-out\_\-by\_\-dest}}
\label{classExternalRoutes_a913183128a2db876ad1595e1226c79b2}

\item 
\hypertarget{classExternalRoutes_a76eae5e3154372dfe4a7c82fde8c95d3}{
\hyperlink{classExternalRoutes_aa449f7ed27280b5738d50b1ecf7853f5}{ExternalRouteMap} \hyperlink{classExternalRoutes_a76eae5e3154372dfe4a7c82fde8c95d3}{\_\-routes\_\-out}}
\label{classExternalRoutes_a76eae5e3154372dfe4a7c82fde8c95d3}

\begin{DoxyCompactList}\small\item\em HNA entries originated by this node. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Class which manages distribution of external routes throughout \hyperlink{protocolthe-p}{the} OLSR domain. 

\subsection{Member Function Documentation}
\hypertarget{classExternalRoutes_ad37acd466df8beb56b2e0705c7695a57}{
\index{ExternalRoutes@{ExternalRoutes}!add\_\-hna\_\-route\_\-in@{add\_\-hna\_\-route\_\-in}}
\index{add\_\-hna\_\-route\_\-in@{add\_\-hna\_\-route\_\-in}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{add\_\-hna\_\-route\_\-in}]{\setlength{\rightskip}{0pt plus 5cm}{\bf OlsrTypes::ExternalID} ExternalRoutes::add\_\-hna\_\-route\_\-in (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4Net} \&}]{dest, }
\item[{const {\bf IPv4} \&}]{lasthop, }
\item[{const uint16\_\-t}]{distance, }
\item[{const {\bf TimeVal} \&}]{expiry\_\-time}
\end{DoxyParamCaption}
)  throw ({\bf BadExternalRoute})}}
\label{classExternalRoutes_ad37acd466df8beb56b2e0705c7695a57}


Create a route entry learned from HNA. 


\begin{DoxyParams}{Parameters}
{\em dest} & The destination being updated. \\
\hline
{\em lasthop} & The last-\/hop to reach \hyperlink{protocolthe-p}{the} destination; usually this is \hyperlink{protocolthe-p}{the} origin of \hyperlink{protocolthe-p}{the} route. \\
\hline
{\em distance} & \hyperlink{protocolthe-p}{the} number of hops to reach lasthop. \\
\hline
{\em expiry\_\-time} & The time at which \hyperlink{protocolthe-p}{the} entry will expire.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The ID of \hyperlink{protocolthe-p}{the} created route entry. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadExternalRoute}{BadExternalRoute}} & if \hyperlink{protocolthe-p}{the} route could not be created. \\
\hline
\end{DoxyExceptions}
\hypertarget{classExternalRoutes_afbb1efae6147f9f990b83a198e52e84b}{
\index{ExternalRoutes@{ExternalRoutes}!delete\_\-hna\_\-route\_\-in@{delete\_\-hna\_\-route\_\-in}}
\index{delete\_\-hna\_\-route\_\-in@{delete\_\-hna\_\-route\_\-in}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{delete\_\-hna\_\-route\_\-in}]{\setlength{\rightskip}{0pt plus 5cm}bool ExternalRoutes::delete\_\-hna\_\-route\_\-in (
\begin{DoxyParamCaption}
\item[{{\bf OlsrTypes::ExternalID}}]{erid}
\end{DoxyParamCaption}
)}}
\label{classExternalRoutes_afbb1efae6147f9f990b83a198e52e84b}


Delete an HNA learned route entry given its ID. 


\begin{DoxyParams}{Parameters}
{\em erid} & The ID of \hyperlink{protocolthe-p}{the} external route to delete. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} entry was found and deleted. 
\end{DoxyReturn}
\hypertarget{classExternalRoutes_a22b18e6ff817769ee5bfb8d33616f494}{
\index{ExternalRoutes@{ExternalRoutes}!event\_\-hna\_\-route\_\-in\_\-expired@{event\_\-hna\_\-route\_\-in\_\-expired}}
\index{event\_\-hna\_\-route\_\-in\_\-expired@{event\_\-hna\_\-route\_\-in\_\-expired}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{event\_\-hna\_\-route\_\-in\_\-expired}]{\setlength{\rightskip}{0pt plus 5cm}void ExternalRoutes::event\_\-hna\_\-route\_\-in\_\-expired (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::ExternalID}}]{erid}
\end{DoxyParamCaption}
)}}
\label{classExternalRoutes_a22b18e6ff817769ee5bfb8d33616f494}


Callback method to: delete a learned route entry when it expires. 


\begin{DoxyParams}{Parameters}
{\em erid} & The ID of \hyperlink{protocolthe-p}{the} external route to delete. \\
\hline
\end{DoxyParams}
\hypertarget{classExternalRoutes_ad8ae98dd20525cfa573ef80e33fb0789}{
\index{ExternalRoutes@{ExternalRoutes}!event\_\-receive\_\-hna@{event\_\-receive\_\-hna}}
\index{event\_\-receive\_\-hna@{event\_\-receive\_\-hna}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{event\_\-receive\_\-hna}]{\setlength{\rightskip}{0pt plus 5cm}bool ExternalRoutes::event\_\-receive\_\-hna (
\begin{DoxyParamCaption}
\item[{{\bf Message} $\ast$}]{msg, }
\item[{const {\bf IPv4} \&}]{remote\_\-addr, }
\item[{const {\bf IPv4} \&}]{local\_\-addr}
\end{DoxyParamCaption}
)}}
\label{classExternalRoutes_ad8ae98dd20525cfa573ef80e33fb0789}


Process incoming HNA message. 

Section 12.5: HNA \hyperlink{classMessage}{Message} Processing.


\begin{DoxyParams}{Parameters}
{\em msg} & \hyperlink{protocolthe-p}{the} message to process. \\
\hline
{\em remote\_\-addr} & \hyperlink{protocolthe-p}{the} source address of \hyperlink{protocolthe-p}{the} \hyperlink{classPacket}{Packet} containing msg. \\
\hline
{\em local\_\-addr} & \hyperlink{protocolthe-p}{the} address of \hyperlink{protocolthe-p}{the} OLSR interface where \hyperlink{protocolthe-p}{the} \hyperlink{classPacket}{Packet} containing msg was received. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if msg was consumed by this method, otherwise false. 
\end{DoxyReturn}
\hypertarget{classExternalRoutes_ad4358e8940fb336f9548482fd6f55684}{
\index{ExternalRoutes@{ExternalRoutes}!event\_\-send\_\-hna@{event\_\-send\_\-hna}}
\index{event\_\-send\_\-hna@{event\_\-send\_\-hna}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{event\_\-send\_\-hna}]{\setlength{\rightskip}{0pt plus 5cm}bool ExternalRoutes::event\_\-send\_\-hna (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classExternalRoutes_ad4358e8940fb336f9548482fd6f55684}


Callback method to: service \hyperlink{protocolthe-p}{the} HNA transmission timer. 

Section 12: Non-\/OLSR Interfaces.

Flood a HNA message to \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} OLSR domain which contains this node's Host and Network Associations.

\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} callback should be rescheduled, otherwise false. 
\end{DoxyReturn}
\hypertarget{classExternalRoutes_aad975a794f239a84509bca4e7d18af23}{
\index{ExternalRoutes@{ExternalRoutes}!get\_\-hna\_\-route\_\-in@{get\_\-hna\_\-route\_\-in}}
\index{get\_\-hna\_\-route\_\-in@{get\_\-hna\_\-route\_\-in}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{get\_\-hna\_\-route\_\-in}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf ExternalRoute} $\ast$ ExternalRoutes::get\_\-hna\_\-route\_\-in (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4Net} \&}]{dest, }
\item[{const {\bf IPv4} \&}]{lasthop}
\end{DoxyParamCaption}
)  throw ({\bf BadExternalRoute})}}
\label{classExternalRoutes_aad975a794f239a84509bca4e7d18af23}


Look up an \hyperlink{classExternalRoute}{ExternalRoute} learned from HNA, given its origin and destination network prefix. 


\begin{DoxyParams}{Parameters}
{\em dest} & \hyperlink{protocolthe-p}{the} destination network prefix. \\
\hline
{\em lasthop} & \hyperlink{protocolthe-p}{the} origin. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to \hyperlink{protocolthe-p}{the} \hyperlink{classExternalRoute}{ExternalRoute}. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadExternalRoute}{BadExternalRoute}} & if \hyperlink{protocolthe-p}{the} route could not be found. \\
\hline
\end{DoxyExceptions}
\hypertarget{classExternalRoutes_a1fc9df4345f70e8d5587f8ff7728cd99}{
\index{ExternalRoutes@{ExternalRoutes}!get\_\-hna\_\-route\_\-in\_\-by\_\-id@{get\_\-hna\_\-route\_\-in\_\-by\_\-id}}
\index{get\_\-hna\_\-route\_\-in\_\-by\_\-id@{get\_\-hna\_\-route\_\-in\_\-by\_\-id}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{get\_\-hna\_\-route\_\-in\_\-by\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf ExternalRoute} $\ast$ ExternalRoutes::get\_\-hna\_\-route\_\-in\_\-by\_\-id (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::ExternalID}}]{erid}
\end{DoxyParamCaption}
)  throw ({\bf BadExternalRoute})}}
\label{classExternalRoutes_a1fc9df4345f70e8d5587f8ff7728cd99}


Look up a learned HNA route entry by its ID. 


\begin{DoxyParams}{Parameters}
{\em erid} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} learned \hyperlink{classExternalRoute}{ExternalRoute}. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} pointer to \hyperlink{protocolthe-p}{the} learned \hyperlink{classExternalRoute}{ExternalRoute}. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadExternalRoute}{BadExternalRoute}} & if \hyperlink{protocolthe-p}{the} route could not be found. \\
\hline
\end{DoxyExceptions}
\hypertarget{classExternalRoutes_a3b44aea5ce874453b0689b6d2f057f11}{
\index{ExternalRoutes@{ExternalRoutes}!get\_\-hna\_\-route\_\-in\_\-id@{get\_\-hna\_\-route\_\-in\_\-id}}
\index{get\_\-hna\_\-route\_\-in\_\-id@{get\_\-hna\_\-route\_\-in\_\-id}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{get\_\-hna\_\-route\_\-in\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}{\bf OlsrTypes::ExternalID} ExternalRoutes::get\_\-hna\_\-route\_\-in\_\-id (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4Net} \&}]{dest, }
\item[{const {\bf IPv4} \&}]{lasthop}
\end{DoxyParamCaption}
)  throw ({\bf BadExternalRoute})}}
\label{classExternalRoutes_a3b44aea5ce874453b0689b6d2f057f11}


Look up \hyperlink{protocolthe-p}{the} ID of a learned HNA entry. 

Both \hyperlink{protocolthe-p}{the} destination and \hyperlink{protocolthe-p}{the} OLSR last-\/hop must be specified to match.


\begin{DoxyParams}{Parameters}
{\em dest} & The destination address. \\
\hline
{\em lasthop} & The last-\/hop advertised for \hyperlink{protocolthe-p}{the} destination.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} learned external route. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadExternalRoute}{BadExternalRoute}} & if \hyperlink{protocolthe-p}{the} route could not be found. \\
\hline
\end{DoxyExceptions}
\hypertarget{classExternalRoutes_abeb6ead2f45fe59c42cc62a1919d8f97}{
\index{ExternalRoutes@{ExternalRoutes}!get\_\-hna\_\-route\_\-in\_\-list@{get\_\-hna\_\-route\_\-in\_\-list}}
\index{get\_\-hna\_\-route\_\-in\_\-list@{get\_\-hna\_\-route\_\-in\_\-list}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{get\_\-hna\_\-route\_\-in\_\-list}]{\setlength{\rightskip}{0pt plus 5cm}void ExternalRoutes::get\_\-hna\_\-route\_\-in\_\-list (
\begin{DoxyParamCaption}
\item[{list$<$ {\bf OlsrTypes::ExternalID} $>$ \&}]{hnalist}
\end{DoxyParamCaption}
)}}
\label{classExternalRoutes_abeb6ead2f45fe59c42cc62a1919d8f97}


Fill out a list of all \hyperlink{protocolthe-p}{the} external learned route IDs. 


\begin{DoxyParams}{Parameters}
{\em hnalist} & \hyperlink{protocolthe-p}{the} list to fill out. \\
\hline
\end{DoxyParams}
\hypertarget{classExternalRoutes_a848988eed56173cf5c5bdac89bda56c5}{
\index{ExternalRoutes@{ExternalRoutes}!get\_\-hna\_\-route\_\-out\_\-id@{get\_\-hna\_\-route\_\-out\_\-id}}
\index{get\_\-hna\_\-route\_\-out\_\-id@{get\_\-hna\_\-route\_\-out\_\-id}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{get\_\-hna\_\-route\_\-out\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}{\bf OlsrTypes::ExternalID} ExternalRoutes::get\_\-hna\_\-route\_\-out\_\-id (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4Net} \&}]{dest}
\end{DoxyParamCaption}
)  throw ({\bf BadExternalRoute})}}
\label{classExternalRoutes_a848988eed56173cf5c5bdac89bda56c5}


Look up \hyperlink{protocolthe-p}{the} ID of an originated HNA entry. 

Both \hyperlink{protocolthe-p}{the} destination and \hyperlink{protocolthe-p}{the} OLSR last-\/hop must be specified to match.


\begin{DoxyParams}{Parameters}
{\em dest} & The destination address. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} originated external route. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadExternalRoute}{BadExternalRoute}} & if \hyperlink{protocolthe-p}{the} route could not be found. \\
\hline
\end{DoxyExceptions}
\hypertarget{classExternalRoutes_a502d415d23fd9307e24304d36f91dc30}{
\index{ExternalRoutes@{ExternalRoutes}!hna\_\-dest\_\-count@{hna\_\-dest\_\-count}}
\index{hna\_\-dest\_\-count@{hna\_\-dest\_\-count}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{hna\_\-dest\_\-count}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t ExternalRoutes::hna\_\-dest\_\-count (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classExternalRoutes_a502d415d23fd9307e24304d36f91dc30}


Calculate \hyperlink{protocolthe-p}{the} number of unique HNA prefixes which have been learned. 

Used only by \hyperlink{protocolthe-p}{the} protocol simulator.

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} number of unique destinations in \hyperlink{protocolthe-p}{the} HNA route-\/in map. 
\end{DoxyReturn}
\hypertarget{classExternalRoutes_ae4408d7619363443dbfac00380780c01}{
\index{ExternalRoutes@{ExternalRoutes}!hna\_\-entry\_\-count@{hna\_\-entry\_\-count}}
\index{hna\_\-entry\_\-count@{hna\_\-entry\_\-count}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{hna\_\-entry\_\-count}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t ExternalRoutes::hna\_\-entry\_\-count (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classExternalRoutes_ae4408d7619363443dbfac00380780c01}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} number of entries in \hyperlink{protocolthe-p}{the} learned HNA route database. 
\end{DoxyReturn}
\hypertarget{classExternalRoutes_a92bc779cd3b458405147ed2ee2c992d9}{
\index{ExternalRoutes@{ExternalRoutes}!hna\_\-origin\_\-count@{hna\_\-origin\_\-count}}
\index{hna\_\-origin\_\-count@{hna\_\-origin\_\-count}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{hna\_\-origin\_\-count}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t ExternalRoutes::hna\_\-origin\_\-count (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classExternalRoutes_a92bc779cd3b458405147ed2ee2c992d9}


Calculate \hyperlink{protocolthe-p}{the} number of unique OLSR nodes with HNA entries in this node's HNA learned route database. 

Used only by \hyperlink{protocolthe-p}{the} protocol simulator.

As we don't currently maintain a list of origins for HNA, this is a more computationally expensive invariant than for TC or MID.

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} number of unique origins in \hyperlink{protocolthe-p}{the} HNA route-\/in map. 
\end{DoxyReturn}
\hypertarget{classExternalRoutes_a23a5333b8ab49bdffd12e5e98114d437}{
\index{ExternalRoutes@{ExternalRoutes}!originate\_\-hna\_\-route\_\-out@{originate\_\-hna\_\-route\_\-out}}
\index{originate\_\-hna\_\-route\_\-out@{originate\_\-hna\_\-route\_\-out}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{originate\_\-hna\_\-route\_\-out}]{\setlength{\rightskip}{0pt plus 5cm}bool ExternalRoutes::originate\_\-hna\_\-route\_\-out (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4Net} \&}]{dest}
\end{DoxyParamCaption}
)  throw ({\bf BadExternalRoute})}}
\label{classExternalRoutes_a23a5333b8ab49bdffd12e5e98114d437}


Originate an HNA route. 


\begin{DoxyParams}{Parameters}
{\em dest} & \hyperlink{protocolthe-p}{the} network for which to originate HNA broadcasts. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} route was originated successfully. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadExternalRoute}{BadExternalRoute}} & if \hyperlink{protocolthe-p}{the} route could not be originated. \\
\hline
\end{DoxyExceptions}
\hypertarget{classExternalRoutes_a154b7dbd3b7b20e4e9121dcf3a3afb15}{
\index{ExternalRoutes@{ExternalRoutes}!push\_\-external\_\-routes@{push\_\-external\_\-routes}}
\index{push\_\-external\_\-routes@{push\_\-external\_\-routes}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{push\_\-external\_\-routes}]{\setlength{\rightskip}{0pt plus 5cm}void ExternalRoutes::push\_\-external\_\-routes (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classExternalRoutes_a154b7dbd3b7b20e4e9121dcf3a3afb15}


\hyperlink{classPush}{Push} candidate HNA routes to \hyperlink{protocolthe-p}{the} \hyperlink{classRouteManager}{RouteManager}. 

12.6: The distance to \hyperlink{protocolthe-p}{the} last-\/hop, as measured from \hyperlink{protocolthe-p}{the} HNA message, is used as \hyperlink{protocolthe-p}{the} current discriminator; this is what's specified in \hyperlink{protocolthe-p}{the} RFC.

TODO: Deal with \hyperlink{protocolthe-p}{the} metric here rather than in \hyperlink{protocolthe-p}{the} \hyperlink{classRouteManager}{RouteManager}. For now, \hyperlink{classRouteManager}{RouteManager} will invent a metric before plumbing to \hyperlink{protocolthe-p}{the} \hyperlink{classRIB}{RIB}. \hypertarget{classExternalRoutes_a96e1203e7ca98fb2bbde34892b94dbb0}{
\index{ExternalRoutes@{ExternalRoutes}!set\_\-hna\_\-interval@{set\_\-hna\_\-interval}}
\index{set\_\-hna\_\-interval@{set\_\-hna\_\-interval}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{set\_\-hna\_\-interval}]{\setlength{\rightskip}{0pt plus 5cm}void ExternalRoutes::set\_\-hna\_\-interval (
\begin{DoxyParamCaption}
\item[{const {\bf TimeVal} \&}]{hna\_\-interval}
\end{DoxyParamCaption}
)}}
\label{classExternalRoutes_a96e1203e7ca98fb2bbde34892b94dbb0}


Set \hyperlink{protocolthe-p}{the} HNA send timer. 


\begin{DoxyParams}{Parameters}
{\em hna\_\-interval} & \hyperlink{protocolthe-p}{the} interval between HNA advertisements.\\
\hline
\end{DoxyParams}
The timer will only be restarted if previously scheduled. If \hyperlink{protocolthe-p}{the} period of \hyperlink{protocolthe-p}{the} HNA broadcasts is changed, a HNA broadcast MAY be scheduled to take place immediately. \hypertarget{classExternalRoutes_a740de140006a40a5dd1dcac66fbfcae7}{
\index{ExternalRoutes@{ExternalRoutes}!update\_\-hna\_\-route\_\-in@{update\_\-hna\_\-route\_\-in}}
\index{update\_\-hna\_\-route\_\-in@{update\_\-hna\_\-route\_\-in}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{update\_\-hna\_\-route\_\-in}]{\setlength{\rightskip}{0pt plus 5cm}{\bf OlsrTypes::ExternalID} ExternalRoutes::update\_\-hna\_\-route\_\-in (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4Net} \&}]{dest, }
\item[{const {\bf IPv4} \&}]{lasthop, }
\item[{const uint16\_\-t}]{distance, }
\item[{const {\bf TimeVal} \&}]{expiry\_\-time, }
\item[{bool \&}]{is\_\-created}
\end{DoxyParamCaption}
)  throw ({\bf BadExternalRoute})}}
\label{classExternalRoutes_a740de140006a40a5dd1dcac66fbfcae7}


Update or create a route entry learned from HNA. 

If \hyperlink{protocolthe-p}{the} origin of \hyperlink{protocolthe-p}{the} HNA route is not reachable in \hyperlink{protocolthe-p}{the} OLSR SPT, \hyperlink{protocolthe-p}{the} route will be rejected; see NOTES. TODO: In future distance may also be treated as an advertised metric.


\begin{DoxyParams}{Parameters}
{\em dest} & The destination being updated. \\
\hline
{\em lasthop} & The last-\/hop to reach \hyperlink{protocolthe-p}{the} destination. \\
\hline
{\em distance} & \hyperlink{protocolthe-p}{the} number of hops to reach lasthop. \\
\hline
{\em expiry\_\-time} & The time at which \hyperlink{protocolthe-p}{the} entry will expire. \\
\hline
{\em is\_\-created} & reference to a boolean which is set to true iff a new entry was created by this method.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The ID of \hyperlink{protocolthe-p}{the} created or updated route entry. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadExternalRoute}{BadExternalRoute}} & if \hyperlink{protocolthe-p}{the} route could not be created. \\
\hline
\end{DoxyExceptions}
\hypertarget{classExternalRoutes_a98d74bd97293bc53b45f06127f8d8308}{
\index{ExternalRoutes@{ExternalRoutes}!withdraw\_\-hna\_\-route\_\-out@{withdraw\_\-hna\_\-route\_\-out}}
\index{withdraw\_\-hna\_\-route\_\-out@{withdraw\_\-hna\_\-route\_\-out}!ExternalRoutes@{ExternalRoutes}}
\subsubsection[{withdraw\_\-hna\_\-route\_\-out}]{\setlength{\rightskip}{0pt plus 5cm}void ExternalRoutes::withdraw\_\-hna\_\-route\_\-out (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4Net} \&}]{dest}
\end{DoxyParamCaption}
)  throw ({\bf BadExternalRoute})}}
\label{classExternalRoutes_a98d74bd97293bc53b45f06127f8d8308}


Withdraw an HNA route. 


\begin{DoxyParams}{Parameters}
{\em dest} & \hyperlink{protocolthe-p}{the} network to withdraw from HNA broadcasts. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadExternalRoute}{BadExternalRoute}} & if no route to \hyperlink{protocolthe-p}{the} given destination could be found. \\
\hline
\end{DoxyExceptions}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/contrib/olsr/external.hh\item 
/home/greearb/git/xorp.ct.github/xorp/contrib/olsr/external.cc\end{DoxyCompactItemize}
