\hypertarget{classTopologyManager}{
\section{TopologyManager Class Reference}
\label{classTopologyManager}\index{TopologyManager@{TopologyManager}}
}


Class which manages topology outside of \hyperlink{protocolthe-p}{the} one-\/hop and two-\/hop neighborhood in \hyperlink{protocolthe-p}{the} OLSR domain.  




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

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

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

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

\item 
void \hyperlink{classTopologyManager_a4136de52b12928b9cbc3b0b17ab70cae}{update\_\-tc\_\-entry} (const \hyperlink{classIPv4}{IPv4} \&dest\_\-addr, const \hyperlink{classIPv4}{IPv4} \&origin\_\-addr, const uint16\_\-t distance, const uint16\_\-t ansn, const \hyperlink{classTimeVal}{TimeVal} \&vtime, bool \&is\_\-created)  throw (BadTopologyEntry)
\begin{DoxyCompactList}\small\item\em Update or create a topology entry in \hyperlink{protocolthe-p}{the} TC database. \item\end{DoxyCompactList}\item 
\hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} \hyperlink{classTopologyManager_a53d4df6d66825a29957bbeff5acaaa57}{add\_\-tc\_\-entry} (const \hyperlink{classIPv4}{IPv4} \&dest\_\-addr, const \hyperlink{classIPv4}{IPv4} \&origin\_\-addr, const uint16\_\-t distance, const uint16\_\-t ansn, const \hyperlink{classTimeVal}{TimeVal} \&expiry\_\-time)  throw (BadTopologyEntry)
\begin{DoxyCompactList}\small\item\em Add a topology entry to \hyperlink{protocolthe-p}{the} database. \item\end{DoxyCompactList}\item 
bool \hyperlink{classTopologyManager_ae631cfd8c1ccdeaf19fdb0b59d989afa}{delete\_\-tc\_\-entry} (const \hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} tcid)
\begin{DoxyCompactList}\small\item\em Delete a topology entry by ID. \item\end{DoxyCompactList}\item 
\hypertarget{classTopologyManager_a083f3592789b9afdbe24ffff994b15ae}{
void \hyperlink{classTopologyManager_a083f3592789b9afdbe24ffff994b15ae}{clear\_\-tc\_\-entries} ()}
\label{classTopologyManager_a083f3592789b9afdbe24ffff994b15ae}

\begin{DoxyCompactList}\small\item\em Clear \hyperlink{protocolthe-p}{the} TC database. \item\end{DoxyCompactList}\item 
bool \hyperlink{classTopologyManager_adff998210a599d86f3976e478ec2d73d}{apply\_\-tc\_\-ansn} (const uint16\_\-t ansn, const \hyperlink{classIPv4}{IPv4} \&origin\_\-addr)
\begin{DoxyCompactList}\small\item\em Apply \hyperlink{protocolthe-p}{the} Advertised \hyperlink{classNeighbor}{Neighbor} Sequence Number in \hyperlink{protocolthe-p}{the} given TC message to \hyperlink{protocolthe-p}{the} Topology Set. \item\end{DoxyCompactList}\item 
\hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} \hyperlink{classTopologyManager_a91a7f74ad8fcf00febbe6dfc599f2b9a}{get\_\-topologyid} (const \hyperlink{classIPv4}{IPv4} \&dest\_\-addr, const \hyperlink{classIPv4}{IPv4} \&lasthop\_\-addr)  throw (BadTopologyEntry)
\begin{DoxyCompactList}\small\item\em Return a topology entry ID given its destination and origin. \item\end{DoxyCompactList}\item 
const \hyperlink{classTopologyEntry}{TopologyEntry} $\ast$ \hyperlink{classTopologyManager_aa77aa532266b3ba35264369f0609588c}{get\_\-topology\_\-entry\_\-by\_\-id} (const \hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} tcid) const   throw (BadTopologyEntry)
\begin{DoxyCompactList}\small\item\em Get a pointer to a topology entry given its ID. \item\end{DoxyCompactList}\item 
void \hyperlink{classTopologyManager_afa014f852f2b21c39a50421fce8f9e2b}{get\_\-topology\_\-list} (list$<$ \hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} $>$ \&tclist) const 
\begin{DoxyCompactList}\small\item\em Fill out a list of all topology entry IDs. \item\end{DoxyCompactList}\item 
vector$<$ \hyperlink{classIPv4}{IPv4} $>$ \hyperlink{classTopologyManager_a3f4e545a9e144a0ab4dabb74b7515bfe}{get\_\-tc\_\-neighbor\_\-set} (const \hyperlink{classIPv4}{IPv4} \&origin\_\-addr, uint16\_\-t \&ansn)  throw (BadTopologyEntry)
\begin{DoxyCompactList}\small\item\em Retrieve \hyperlink{protocolthe-p}{the} Advertised \hyperlink{classNeighbor}{Neighbor} Set (ANS) for a given OLSR peer. \item\end{DoxyCompactList}\item 
\hypertarget{classTopologyManager_a59830870cf44a25b400331815051c5f6}{
uint16\_\-t {\bfseries get\_\-tc\_\-distance} (const \hyperlink{classIPv4}{IPv4} \&origin\_\-addr, const \hyperlink{classIPv4}{IPv4} \&dest\_\-addr)  throw (BadTopologyEntry)}
\label{classTopologyManager_a59830870cf44a25b400331815051c5f6}

\item 
size\_\-t \hyperlink{classTopologyManager_a824535b5d358727dc44b861f31503ce0}{get\_\-tc\_\-lasthop\_\-count\_\-by\_\-dest} (const \hyperlink{classIPv4}{IPv4} \&dest\_\-addr)
\begin{DoxyCompactList}\small\item\em Count \hyperlink{protocolthe-p}{the} number of TC entries which point to a given destination. \item\end{DoxyCompactList}\item 
size\_\-t \hyperlink{classTopologyManager_adcfd552b9feabc64961851c407bf9476}{tc\_\-node\_\-count} () const 
\begin{DoxyCompactList}\small\item\em Calculate \hyperlink{protocolthe-p}{the} number of unique OLSR nodes with TC entries in this node's TC database. \item\end{DoxyCompactList}\item 
void \hyperlink{classTopologyManager_acfa9623a87e742572e8fab588b83d687}{update\_\-mid\_\-entry} (const \hyperlink{classIPv4}{IPv4} \&main\_\-addr, const \hyperlink{classIPv4}{IPv4} \&iface\_\-addr, const uint16\_\-t distance, const \hyperlink{classTimeVal}{TimeVal} \&vtime, bool \&is\_\-mid\_\-created)  throw (BadMidEntry)
\begin{DoxyCompactList}\small\item\em Update a Multiple Interface Declaration (MID) entry. \item\end{DoxyCompactList}\item 
void \hyperlink{classTopologyManager_ab03ddc026229f3c5f3389bd24f603081}{add\_\-mid\_\-entry} (const \hyperlink{classIPv4}{IPv4} \&main\_\-addr, const \hyperlink{classIPv4}{IPv4} \&iface\_\-addr, const uint16\_\-t distance, const \hyperlink{classTimeVal}{TimeVal} \&vtime)  throw (BadMidEntry)
\begin{DoxyCompactList}\small\item\em Create a new entry in \hyperlink{protocolthe-p}{the} MID database. \item\end{DoxyCompactList}\item 
bool \hyperlink{classTopologyManager_a357aa76775585f3799ff5f45a977a1ef}{delete\_\-mid\_\-entry} (const \hyperlink{structOlsrTypes_a3f8d2bee6d4dd2200eb86e3de60c261d}{OlsrTypes::MidEntryID} mid\_\-id)
\begin{DoxyCompactList}\small\item\em Delete a MID entry by ID. \item\end{DoxyCompactList}\item 
\hypertarget{classTopologyManager_af22553c34be53d1888bf026f3b0fa683}{
void \hyperlink{classTopologyManager_af22553c34be53d1888bf026f3b0fa683}{clear\_\-mid\_\-entries} ()}
\label{classTopologyManager_af22553c34be53d1888bf026f3b0fa683}

\begin{DoxyCompactList}\small\item\em Clear MID entries. \item\end{DoxyCompactList}\item 
vector$<$ \hyperlink{classIPv4}{IPv4} $>$ \hyperlink{classTopologyManager_a337e9206c8673c8a42b72ef40929768b}{get\_\-mid\_\-addresses} (const \hyperlink{classIPv4}{IPv4} \&main\_\-addr)
\begin{DoxyCompactList}\small\item\em Given \hyperlink{protocolthe-p}{the} main address of an OLSR node, return a vector containing all other interface addresses for it, as learned via \hyperlink{protocolthe-p}{the} MID part of \hyperlink{protocolthe-p}{the} OLSR protocol. \item\end{DoxyCompactList}\item 
uint16\_\-t \hyperlink{classTopologyManager_a320289f7435283fa76280617fe095b91}{get\_\-mid\_\-address\_\-distance} (const \hyperlink{classIPv4}{IPv4} \&main\_\-addr, const \hyperlink{classIPv4}{IPv4} \&iface\_\-addr)  throw (BadMidEntry)
\begin{DoxyCompactList}\small\item\em Look up \hyperlink{protocolthe-p}{the} most recently seen distance of a MID entry, given its origin and interface address. \item\end{DoxyCompactList}\item 
\hyperlink{classIPv4}{IPv4} \hyperlink{classTopologyManager_a1c36af3b07e3817882c27593965ef70d}{get\_\-main\_\-addr\_\-of\_\-mid} (const \hyperlink{classIPv4}{IPv4} \&mid\_\-addr)  throw (BadMidEntry)
\begin{DoxyCompactList}\small\item\em Given an address possibly corresponding to a MID entry, return \hyperlink{protocolthe-p}{the} main address to which it would map. \item\end{DoxyCompactList}\item 
size\_\-t \hyperlink{classTopologyManager_ae8f1efa509cb6ba3c46795587ee47c01}{mid\_\-node\_\-count} () const 
\begin{DoxyCompactList}\small\item\em Count \hyperlink{protocolthe-p}{the} number of unique OLSR main addresses in this node's MID database. \item\end{DoxyCompactList}\item 
const \hyperlink{classMidEntry}{MidEntry} $\ast$ \hyperlink{classTopologyManager_aefd5c7af7ad649b356d0ac036db1af12}{get\_\-mid\_\-entry\_\-by\_\-id} (const \hyperlink{structOlsrTypes_a3f8d2bee6d4dd2200eb86e3de60c261d}{OlsrTypes::MidEntryID} midid) const   throw (BadTopologyEntry)
\begin{DoxyCompactList}\small\item\em Get a pointer to a MID entry given its ID. \item\end{DoxyCompactList}\item 
void \hyperlink{classTopologyManager_ab6321a8d44bd4e1bd211cb4407a44b83}{get\_\-mid\_\-list} (list$<$ \hyperlink{structOlsrTypes_a3f8d2bee6d4dd2200eb86e3de60c261d}{OlsrTypes::MidEntryID} $>$ \&midlist) const 
\begin{DoxyCompactList}\small\item\em Fill out a list of all MID entry IDs. \item\end{DoxyCompactList}\item 
void \hyperlink{classTopologyManager_ae0ffae340837c9ceb54f7277cbb1c64f}{push\_\-topology} ()
\begin{DoxyCompactList}\small\item\em \hyperlink{classPush}{Push} topology set to \hyperlink{protocolthe-p}{the} \hyperlink{classRouteManager}{RouteManager} for SPT computation. \item\end{DoxyCompactList}\item 
bool \hyperlink{classTopologyManager_ad288ab1b7c7562b73a7390c981edeab0}{event\_\-receive\_\-tc} (\hyperlink{classMessage}{Message} $\ast$msg, const \hyperlink{classIPv4}{IPv4} \&remote\_\-addr, const \hyperlink{classIPv4}{IPv4} \&local\_\-addr)
\begin{DoxyCompactList}\small\item\em Callback method to: process an incoming TC message. \item\end{DoxyCompactList}\item 
void \hyperlink{classTopologyManager_a5dfc571ffbcb158a269f1197f8006783}{event\_\-tc\_\-dead} (\hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} tcid)
\begin{DoxyCompactList}\small\item\em Callback method to: delete an expiring \hyperlink{classTopologyEntry}{TopologyEntry}. \item\end{DoxyCompactList}\item 
bool \hyperlink{classTopologyManager_a352883d5b9822cbd7522fb1e5d316dee}{event\_\-receive\_\-mid} (\hyperlink{classMessage}{Message} $\ast$msg, const \hyperlink{classIPv4}{IPv4} \&remote\_\-addr, const \hyperlink{classIPv4}{IPv4} \&local\_\-addr)
\begin{DoxyCompactList}\small\item\em Callback method to: process an incoming MID message. \item\end{DoxyCompactList}\item 
\hypertarget{classTopologyManager_a0bd28f02c880ec11dacf129f49917456}{
void \hyperlink{classTopologyManager_a0bd28f02c880ec11dacf129f49917456}{event\_\-mid\_\-dead} (const \hyperlink{structOlsrTypes_a3f8d2bee6d4dd2200eb86e3de60c261d}{OlsrTypes::MidEntryID} mid\_\-id)}
\label{classTopologyManager_a0bd28f02c880ec11dacf129f49917456}

\begin{DoxyCompactList}\small\item\em Callback method to: delete a dying \hyperlink{classMidEntry}{MidEntry}. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classTopologyManager_aec656875de856247d6d75eb8bc5df359}{update\_\-tc\_\-distance} (\hyperlink{classTopologyEntry}{TopologyEntry} $\ast$tc, uint16\_\-t distance)
\begin{DoxyCompactList}\small\item\em Internal method to: update a TC entry's distance. \item\end{DoxyCompactList}\item 
void \hyperlink{classTopologyManager_a4c5736980b9f6d63b43376c75e66ba9f}{assert\_\-tc\_\-distance\_\-is\_\-unique} (const \hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} tcid)  throw (BadTopologyEntry)
\begin{DoxyCompactList}\small\item\em Internal method to: assert that a TC's distance is unique. \item\end{DoxyCompactList}\item 
void \hyperlink{classTopologyManager_a2e6a14c588c7f38bafa36456e3de474a}{assert\_\-tc\_\-ansn\_\-is\_\-identical} (const \hyperlink{classIPv4}{IPv4} \&origin\_\-addr)  throw (BadTopologyEntry)
\begin{DoxyCompactList}\small\item\em Internal method to: assert that \hyperlink{protocolthe-p}{the} ANSNs for all TC entries originated by \hyperlink{protocolthe-p}{the} node origin\_\-addr are identical. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTopologyManager_a8c4555a2d12c26b6907ffbb830d11feb}{
typedef map$<$ \hyperlink{structOlsrTypes_a3f8d2bee6d4dd2200eb86e3de60c261d}{OlsrTypes::MidEntryID}, \hyperlink{classMidEntry}{MidEntry} $\ast$ $>$ \hyperlink{classTopologyManager_a8c4555a2d12c26b6907ffbb830d11feb}{MidIdMap}}
\label{classTopologyManager_a8c4555a2d12c26b6907ffbb830d11feb}

\begin{DoxyCompactList}\small\item\em Multiple Interface Association Database. \item\end{DoxyCompactList}\item 
\hypertarget{classTopologyManager_a5361206a1bff97b294fe7f8c5502a543}{
typedef multimap$<$ \hyperlink{classIPv4}{IPv4}, \hyperlink{structOlsrTypes_a3f8d2bee6d4dd2200eb86e3de60c261d}{OlsrTypes::MidEntryID} $>$ \hyperlink{classTopologyManager_a5361206a1bff97b294fe7f8c5502a543}{MidAddrMap}}
\label{classTopologyManager_a5361206a1bff97b294fe7f8c5502a543}

\begin{DoxyCompactList}\small\item\em A map providing lookup of \hyperlink{protocolthe-p}{the} MidEntries corresponding to \hyperlink{protocolthe-p}{the} main protocol address of an OLSR node. \item\end{DoxyCompactList}\item 
\hypertarget{classTopologyManager_ad5973cea0abe5fd8aa681e52b8559b21}{
typedef map$<$ \hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID}, \hyperlink{classTopologyEntry}{TopologyEntry} $\ast$ $>$ \hyperlink{classTopologyManager_ad5973cea0abe5fd8aa681e52b8559b21}{TcIdMap}}
\label{classTopologyManager_ad5973cea0abe5fd8aa681e52b8559b21}

\begin{DoxyCompactList}\small\item\em Topology Information Base. \item\end{DoxyCompactList}\item 
typedef multimap$<$ uint16\_\-t, \hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} $>$ \hyperlink{classTopologyManager_a19571b5619b1701eb7b0949310c208bc}{TcDistanceMap}
\begin{DoxyCompactList}\small\item\em A multimap providing lookup of topology entries by their distance. \item\end{DoxyCompactList}\item 
typedef multimap$<$ \hyperlink{classIPv4}{IPv4}, \hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} $>$ \hyperlink{classTopologyManager_ab19a0757d65d5fe469235caaaf8af9f0}{TcDestMap}
\begin{DoxyCompactList}\small\item\em A multimap providing lookup of topology entries by destination. \item\end{DoxyCompactList}\item 
typedef multimap$<$ \hyperlink{classIPv4}{IPv4}, \hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} $>$ \hyperlink{classTopologyManager_a52eb3c875c1a781cf27e2dd3b998aaef}{TcLasthopMap}
\begin{DoxyCompactList}\small\item\em A multimap providing lookup of topology entries by last hop. \item\end{DoxyCompactList}\item 
typedef map$<$ \hyperlink{classIPv4}{IPv4}, uint16\_\-t $>$ \hyperlink{classTopologyManager_ad4f489d30b49a1143ee707105e481fb2}{TcFinalSeqMap}
\begin{DoxyCompactList}\small\item\em A map of final ANSN numbers for each origin from which we have seen TC messages with empty neighbor sets. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTopologyManager_aeb7d075fc90621aed9266bc8dd4f7a8c}{
\hyperlink{classOlsr}{Olsr} \& {\bfseries \_\-olsr}}
\label{classTopologyManager_aeb7d075fc90621aed9266bc8dd4f7a8c}

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

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

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

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

\item 
\hypertarget{classTopologyManager_a2dfb527d4f142b7c70af10704aac57d3}{
\hyperlink{structOlsrTypes_a3f8d2bee6d4dd2200eb86e3de60c261d}{OlsrTypes::MidEntryID} {\bfseries \_\-next\_\-mid\_\-id}}
\label{classTopologyManager_a2dfb527d4f142b7c70af10704aac57d3}

\item 
\hypertarget{classTopologyManager_a6aa31f12bc6a24a8070339e7bf8fbca9}{
\hyperlink{structOlsrTypes_a8ae1686d6bc0ed73f5d34126ae591c86}{OlsrTypes::TopologyID} {\bfseries \_\-next\_\-tcid}}
\label{classTopologyManager_a6aa31f12bc6a24a8070339e7bf8fbca9}

\item 
\hypertarget{classTopologyManager_a142cca2285362d6f86b52d9c319ee554}{
\hyperlink{classTopologyManager_a8c4555a2d12c26b6907ffbb830d11feb}{MidIdMap} {\bfseries \_\-mids}}
\label{classTopologyManager_a142cca2285362d6f86b52d9c319ee554}

\item 
\hypertarget{classTopologyManager_a5366be6d7ad9536c1e26781f678d0a83}{
\hyperlink{classTopologyManager_a5361206a1bff97b294fe7f8c5502a543}{MidAddrMap} {\bfseries \_\-mid\_\-addr}}
\label{classTopologyManager_a5366be6d7ad9536c1e26781f678d0a83}

\item 
\hypertarget{classTopologyManager_a2bea70da5c564e5bf93de4784d921187}{
\hyperlink{classTopologyManager_ad5973cea0abe5fd8aa681e52b8559b21}{TcIdMap} {\bfseries \_\-topology}}
\label{classTopologyManager_a2bea70da5c564e5bf93de4784d921187}

\item 
\hypertarget{classTopologyManager_a4a6a9aedcda8e0f8cf4e5b691f9cd220}{
\hyperlink{classTopologyManager_a19571b5619b1701eb7b0949310c208bc}{TcDistanceMap} {\bfseries \_\-tc\_\-distances}}
\label{classTopologyManager_a4a6a9aedcda8e0f8cf4e5b691f9cd220}

\item 
\hypertarget{classTopologyManager_a2690bdd5b1e8c802af45df4e9bfe6124}{
\hyperlink{classTopologyManager_ab19a0757d65d5fe469235caaaf8af9f0}{TcDestMap} {\bfseries \_\-tc\_\-destinations}}
\label{classTopologyManager_a2690bdd5b1e8c802af45df4e9bfe6124}

\item 
\hypertarget{classTopologyManager_a1712f8f00af71f0a3daf8108fa5e537d}{
\hyperlink{classTopologyManager_a52eb3c875c1a781cf27e2dd3b998aaef}{TcLasthopMap} {\bfseries \_\-tc\_\-lasthops}}
\label{classTopologyManager_a1712f8f00af71f0a3daf8108fa5e537d}

\item 
\hypertarget{classTopologyManager_aefbfb539ed12646369d0350a46d1d4cd}{
\hyperlink{classTopologyManager_ad4f489d30b49a1143ee707105e481fb2}{TcFinalSeqMap} {\bfseries \_\-tc\_\-final\_\-seqnos}}
\label{classTopologyManager_aefbfb539ed12646369d0350a46d1d4cd}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Class which manages topology outside of \hyperlink{protocolthe-p}{the} one-\/hop and two-\/hop neighborhood in \hyperlink{protocolthe-p}{the} OLSR domain. 

\subsection{Member Typedef Documentation}
\hypertarget{classTopologyManager_ab19a0757d65d5fe469235caaaf8af9f0}{
\index{TopologyManager@{TopologyManager}!TcDestMap@{TcDestMap}}
\index{TcDestMap@{TcDestMap}!TopologyManager@{TopologyManager}}
\subsubsection[{TcDestMap}]{\setlength{\rightskip}{0pt plus 5cm}typedef multimap$<${\bf IPv4}, {\bf OlsrTypes::TopologyID}$>$ {\bf TopologyManager::TcDestMap}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classTopologyManager_ab19a0757d65d5fe469235caaaf8af9f0}


A multimap providing lookup of topology entries by destination. 

Used by TC updates. \hypertarget{classTopologyManager_a19571b5619b1701eb7b0949310c208bc}{
\index{TopologyManager@{TopologyManager}!TcDistanceMap@{TcDistanceMap}}
\index{TcDistanceMap@{TcDistanceMap}!TopologyManager@{TopologyManager}}
\subsubsection[{TcDistanceMap}]{\setlength{\rightskip}{0pt plus 5cm}typedef multimap$<$uint16\_\-t, {\bf OlsrTypes::TopologyID}$>$ {\bf TopologyManager::TcDistanceMap}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classTopologyManager_a19571b5619b1701eb7b0949310c208bc}


A multimap providing lookup of topology entries by their distance. 

Used for routing computation, \hyperlink{protocolthe-p}{the} most common case. \hypertarget{classTopologyManager_ad4f489d30b49a1143ee707105e481fb2}{
\index{TopologyManager@{TopologyManager}!TcFinalSeqMap@{TcFinalSeqMap}}
\index{TcFinalSeqMap@{TcFinalSeqMap}!TopologyManager@{TopologyManager}}
\subsubsection[{TcFinalSeqMap}]{\setlength{\rightskip}{0pt plus 5cm}typedef map$<${\bf IPv4}, uint16\_\-t$>$ {\bf TopologyManager::TcFinalSeqMap}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classTopologyManager_ad4f489d30b49a1143ee707105e481fb2}


A map of final ANSN numbers for each origin from which we have seen TC messages with empty neighbor sets. 

Used by \hyperlink{protocolthe-p}{the} simulator for verification. \hypertarget{classTopologyManager_a52eb3c875c1a781cf27e2dd3b998aaef}{
\index{TopologyManager@{TopologyManager}!TcLasthopMap@{TcLasthopMap}}
\index{TcLasthopMap@{TcLasthopMap}!TopologyManager@{TopologyManager}}
\subsubsection[{TcLasthopMap}]{\setlength{\rightskip}{0pt plus 5cm}typedef multimap$<${\bf IPv4}, {\bf OlsrTypes::TopologyID}$>$ {\bf TopologyManager::TcLasthopMap}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classTopologyManager_a52eb3c875c1a781cf27e2dd3b998aaef}


A multimap providing lookup of topology entries by last hop. 

Used by ANSN processing. 

\subsection{Member Function Documentation}
\hypertarget{classTopologyManager_ab03ddc026229f3c5f3389bd24f603081}{
\index{TopologyManager@{TopologyManager}!add\_\-mid\_\-entry@{add\_\-mid\_\-entry}}
\index{add\_\-mid\_\-entry@{add\_\-mid\_\-entry}!TopologyManager@{TopologyManager}}
\subsubsection[{add\_\-mid\_\-entry}]{\setlength{\rightskip}{0pt plus 5cm}void TopologyManager::add\_\-mid\_\-entry (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{main\_\-addr, }
\item[{const {\bf IPv4} \&}]{iface\_\-addr, }
\item[{const uint16\_\-t}]{distance, }
\item[{const {\bf TimeVal} \&}]{vtime}
\end{DoxyParamCaption}
)  throw ({\bf BadMidEntry})}}
\label{classTopologyManager_ab03ddc026229f3c5f3389bd24f603081}


Create a new entry in \hyperlink{protocolthe-p}{the} MID database. 

TODO Find \hyperlink{protocolthe-p}{the} next available ID if already taken, as \hyperlink{protocolthe-p}{the} range may recycle quickly in large, dynamically changing topologies.


\begin{DoxyParams}{Parameters}
{\em main\_\-addr} & \hyperlink{protocolthe-p}{the} main address of \hyperlink{protocolthe-p}{the} node originating \hyperlink{protocolthe-p}{the} MID entry. \\
\hline
{\em iface\_\-addr} & \hyperlink{protocolthe-p}{the} interface address of \hyperlink{protocolthe-p}{the} MID entry. \\
\hline
{\em distance} & \hyperlink{protocolthe-p}{the} distance in hops of \hyperlink{protocolthe-p}{the} origin of \hyperlink{protocolthe-p}{the} MIS message being processed. \\
\hline
{\em vtime} & \hyperlink{protocolthe-p}{the} time for which \hyperlink{protocolthe-p}{the} MID entry remains valid. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadMidEntry}{BadMidEntry}} & if \hyperlink{protocolthe-p}{the} entry could not be created or updated. \\
\hline
\end{DoxyExceptions}
\hypertarget{classTopologyManager_a53d4df6d66825a29957bbeff5acaaa57}{
\index{TopologyManager@{TopologyManager}!add\_\-tc\_\-entry@{add\_\-tc\_\-entry}}
\index{add\_\-tc\_\-entry@{add\_\-tc\_\-entry}!TopologyManager@{TopologyManager}}
\subsubsection[{add\_\-tc\_\-entry}]{\setlength{\rightskip}{0pt plus 5cm}{\bf OlsrTypes::TopologyID} TopologyManager::add\_\-tc\_\-entry (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{dest\_\-addr, }
\item[{const {\bf IPv4} \&}]{origin\_\-addr, }
\item[{const uint16\_\-t}]{distance, }
\item[{const uint16\_\-t}]{ansn, }
\item[{const {\bf TimeVal} \&}]{expiry\_\-time}
\end{DoxyParamCaption}
)  throw ({\bf BadTopologyEntry})}}
\label{classTopologyManager_a53d4df6d66825a29957bbeff5acaaa57}


Add a topology entry to \hyperlink{protocolthe-p}{the} database. 


\begin{DoxyParams}{Parameters}
{\em dest\_\-addr} & \hyperlink{protocolthe-p}{the} destination of \hyperlink{protocolthe-p}{the} new topology entry. \\
\hline
{\em origin\_\-addr} & \hyperlink{protocolthe-p}{the} origin of \hyperlink{protocolthe-p}{the} new topology entry. \\
\hline
{\em distance} & \hyperlink{protocolthe-p}{the} distance in hops from this node to \hyperlink{protocolthe-p}{the} origin, calculated from \hyperlink{protocolthe-p}{the} message hop count. \\
\hline
{\em ansn} & \hyperlink{protocolthe-p}{the} advertised sequence number of \hyperlink{protocolthe-p}{the} topology entry. \\
\hline
{\em expiry\_\-time} & \hyperlink{protocolthe-p}{the} time for which this topology entry remains valid. \\
\hline
\end{DoxyParams}
\hypertarget{classTopologyManager_adff998210a599d86f3976e478ec2d73d}{
\index{TopologyManager@{TopologyManager}!apply\_\-tc\_\-ansn@{apply\_\-tc\_\-ansn}}
\index{apply\_\-tc\_\-ansn@{apply\_\-tc\_\-ansn}!TopologyManager@{TopologyManager}}
\subsubsection[{apply\_\-tc\_\-ansn}]{\setlength{\rightskip}{0pt plus 5cm}bool TopologyManager::apply\_\-tc\_\-ansn (
\begin{DoxyParamCaption}
\item[{const uint16\_\-t}]{ansn, }
\item[{const {\bf IPv4} \&}]{origin\_\-addr}
\end{DoxyParamCaption}
)}}
\label{classTopologyManager_adff998210a599d86f3976e478ec2d73d}


Apply \hyperlink{protocolthe-p}{the} Advertised \hyperlink{classNeighbor}{Neighbor} Sequence Number in \hyperlink{protocolthe-p}{the} given TC message to \hyperlink{protocolthe-p}{the} Topology Set. 

Section 9.5: TC \hyperlink{classMessage}{Message} Processing, 2-\/3.


\begin{DoxyParams}{Parameters}
{\em ansn} & \hyperlink{protocolthe-p}{the} ANSN to apply. \\
\hline
{\em origin\_\-addr} & \hyperlink{protocolthe-p}{the} origin of \hyperlink{protocolthe-p}{the} TC message containing \\
\hline
{\em ansn} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} provided ANSN is valid and has been applied, otherwise false if \hyperlink{protocolthe-p}{the} message is stale and should be rejected. 
\end{DoxyReturn}
\hypertarget{classTopologyManager_a2e6a14c588c7f38bafa36456e3de474a}{
\index{TopologyManager@{TopologyManager}!assert\_\-tc\_\-ansn\_\-is\_\-identical@{assert\_\-tc\_\-ansn\_\-is\_\-identical}}
\index{assert\_\-tc\_\-ansn\_\-is\_\-identical@{assert\_\-tc\_\-ansn\_\-is\_\-identical}!TopologyManager@{TopologyManager}}
\subsubsection[{assert\_\-tc\_\-ansn\_\-is\_\-identical}]{\setlength{\rightskip}{0pt plus 5cm}void TopologyManager::assert\_\-tc\_\-ansn\_\-is\_\-identical (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{origin\_\-addr}
\end{DoxyParamCaption}
)  throw ({\bf BadTopologyEntry})\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classTopologyManager_a2e6a14c588c7f38bafa36456e3de474a}


Internal method to: assert that \hyperlink{protocolthe-p}{the} ANSNs for all TC entries originated by \hyperlink{protocolthe-p}{the} node origin\_\-addr are identical. 

A full linear search of \hyperlink{protocolthe-p}{the} TC record space is performed. Stubbed out if DETAILED\_\-DEBUG is not defined.

TODO: Eliminate this function by refactoring \hyperlink{protocolthe-p}{the} data structures; we SHOULD be able to check if \hyperlink{protocolthe-p}{the} last ANSN from origin was empty, currently we don't do that.


\begin{DoxyParams}{Parameters}
{\em origin\_\-addr} & \hyperlink{protocolthe-p}{the} node for which to verify \hyperlink{protocolthe-p}{the} ANSNs. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadTopologyEntry}{BadTopologyEntry}} & if \hyperlink{protocolthe-p}{the} ANSNs for origin\_\-addr are not identical. \\
\hline
\end{DoxyExceptions}
\hypertarget{classTopologyManager_a4c5736980b9f6d63b43376c75e66ba9f}{
\index{TopologyManager@{TopologyManager}!assert\_\-tc\_\-distance\_\-is\_\-unique@{assert\_\-tc\_\-distance\_\-is\_\-unique}}
\index{assert\_\-tc\_\-distance\_\-is\_\-unique@{assert\_\-tc\_\-distance\_\-is\_\-unique}!TopologyManager@{TopologyManager}}
\subsubsection[{assert\_\-tc\_\-distance\_\-is\_\-unique}]{\setlength{\rightskip}{0pt plus 5cm}void TopologyManager::assert\_\-tc\_\-distance\_\-is\_\-unique (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::TopologyID}}]{tcid}
\end{DoxyParamCaption}
)  throw ({\bf BadTopologyEntry})\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classTopologyManager_a4c5736980b9f6d63b43376c75e66ba9f}


Internal method to: assert that a TC's distance is unique. 

Verify that \hyperlink{protocolthe-p}{the} given TopologyID appears once, and only once, in \hyperlink{protocolthe-p}{the} \_\-tc\_\-distances array used for route computation. Stubbed out if DETAILED\_\-DEBUG is not defined.


\begin{DoxyParams}{Parameters}
{\em tcid} & \hyperlink{protocolthe-p}{the} topology entry ID to verify. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadTopologyEntry}{BadTopologyEntry}} & if tcid appears more than once in \_\-tc\_\-distances. \\
\hline
\end{DoxyExceptions}
\hypertarget{classTopologyManager_a357aa76775585f3799ff5f45a977a1ef}{
\index{TopologyManager@{TopologyManager}!delete\_\-mid\_\-entry@{delete\_\-mid\_\-entry}}
\index{delete\_\-mid\_\-entry@{delete\_\-mid\_\-entry}!TopologyManager@{TopologyManager}}
\subsubsection[{delete\_\-mid\_\-entry}]{\setlength{\rightskip}{0pt plus 5cm}bool TopologyManager::delete\_\-mid\_\-entry (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::MidEntryID}}]{mid\_\-id}
\end{DoxyParamCaption}
)}}
\label{classTopologyManager_a357aa76775585f3799ff5f45a977a1ef}


Delete a MID entry by ID. 


\begin{DoxyParams}{Parameters}
{\em mid\_\-id} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} MID entry to delete. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} MID entry was deleted. 
\end{DoxyReturn}
\hypertarget{classTopologyManager_ae631cfd8c1ccdeaf19fdb0b59d989afa}{
\index{TopologyManager@{TopologyManager}!delete\_\-tc\_\-entry@{delete\_\-tc\_\-entry}}
\index{delete\_\-tc\_\-entry@{delete\_\-tc\_\-entry}!TopologyManager@{TopologyManager}}
\subsubsection[{delete\_\-tc\_\-entry}]{\setlength{\rightskip}{0pt plus 5cm}bool TopologyManager::delete\_\-tc\_\-entry (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::TopologyID}}]{tcid}
\end{DoxyParamCaption}
)}}
\label{classTopologyManager_ae631cfd8c1ccdeaf19fdb0b59d989afa}


Delete a topology entry by ID. 

It must be removed from last-\/hop and destination maps.


\begin{DoxyParams}{Parameters}
{\em tcid} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} toplogy entry to delete. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} topology entry was deleted, false if it could not be found. 
\end{DoxyReturn}
\hypertarget{classTopologyManager_a352883d5b9822cbd7522fb1e5d316dee}{
\index{TopologyManager@{TopologyManager}!event\_\-receive\_\-mid@{event\_\-receive\_\-mid}}
\index{event\_\-receive\_\-mid@{event\_\-receive\_\-mid}!TopologyManager@{TopologyManager}}
\subsubsection[{event\_\-receive\_\-mid}]{\setlength{\rightskip}{0pt plus 5cm}bool TopologyManager::event\_\-receive\_\-mid (
\begin{DoxyParamCaption}
\item[{{\bf Message} $\ast$}]{msg, }
\item[{const {\bf IPv4} \&}]{remote\_\-addr, }
\item[{const {\bf IPv4} \&}]{local\_\-addr}
\end{DoxyParamCaption}
)}}
\label{classTopologyManager_a352883d5b9822cbd7522fb1e5d316dee}


Callback method to: process an incoming MID message. 

Section 5.4: MID \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} interface where \\
\hline
{\em msg} & was received. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if this method consumed 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em msg} & \\
\hline
\end{DoxyParams}
\hypertarget{classTopologyManager_ad288ab1b7c7562b73a7390c981edeab0}{
\index{TopologyManager@{TopologyManager}!event\_\-receive\_\-tc@{event\_\-receive\_\-tc}}
\index{event\_\-receive\_\-tc@{event\_\-receive\_\-tc}!TopologyManager@{TopologyManager}}
\subsubsection[{event\_\-receive\_\-tc}]{\setlength{\rightskip}{0pt plus 5cm}bool TopologyManager::event\_\-receive\_\-tc (
\begin{DoxyParamCaption}
\item[{{\bf Message} $\ast$}]{msg, }
\item[{const {\bf IPv4} \&}]{remote\_\-addr, }
\item[{const {\bf IPv4} \&}]{local\_\-addr}
\end{DoxyParamCaption}
)}}
\label{classTopologyManager_ad288ab1b7c7562b73a7390c981edeab0}


Callback method to: process an incoming TC message. 

Section 9.5: TC \hyperlink{classMessage}{Message} Processing.


\begin{DoxyParams}{Parameters}
{\em msg} & Pointer to a message which is derived from \hyperlink{classTcMessage}{TcMessage}. \\
\hline
{\em remote\_\-addr} & The source address of \hyperlink{protocolthe-p}{the} packet containing msg. \\
\hline
{\em local\_\-addr} & The address of \hyperlink{protocolthe-p}{the} interface where this packet was received. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if this function consumed msg. 
\end{DoxyReturn}
\hypertarget{classTopologyManager_a5dfc571ffbcb158a269f1197f8006783}{
\index{TopologyManager@{TopologyManager}!event\_\-tc\_\-dead@{event\_\-tc\_\-dead}}
\index{event\_\-tc\_\-dead@{event\_\-tc\_\-dead}!TopologyManager@{TopologyManager}}
\subsubsection[{event\_\-tc\_\-dead}]{\setlength{\rightskip}{0pt plus 5cm}void TopologyManager::event\_\-tc\_\-dead (
\begin{DoxyParamCaption}
\item[{{\bf OlsrTypes::TopologyID}}]{tcid}
\end{DoxyParamCaption}
)}}
\label{classTopologyManager_a5dfc571ffbcb158a269f1197f8006783}


Callback method to: delete an expiring \hyperlink{classTopologyEntry}{TopologyEntry}. 


\begin{DoxyParams}{Parameters}
{\em tcid} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} expiring \hyperlink{classTopologyEntry}{TopologyEntry}. \\
\hline
\end{DoxyParams}
\hypertarget{classTopologyManager_a1c36af3b07e3817882c27593965ef70d}{
\index{TopologyManager@{TopologyManager}!get\_\-main\_\-addr\_\-of\_\-mid@{get\_\-main\_\-addr\_\-of\_\-mid}}
\index{get\_\-main\_\-addr\_\-of\_\-mid@{get\_\-main\_\-addr\_\-of\_\-mid}!TopologyManager@{TopologyManager}}
\subsubsection[{get\_\-main\_\-addr\_\-of\_\-mid}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IPv4} TopologyManager::get\_\-main\_\-addr\_\-of\_\-mid (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{mid\_\-addr}
\end{DoxyParamCaption}
)  throw ({\bf BadMidEntry})}}
\label{classTopologyManager_a1c36af3b07e3817882c27593965ef70d}


Given an address possibly corresponding to a MID entry, return \hyperlink{protocolthe-p}{the} main address to which it would map. 

Used by \hyperlink{protocolthe-p}{the} protocol simulator. Requires a linear search of MID space, returns first match, there should be no other matches; no invariant.


\begin{DoxyParams}{Parameters}
{\em mid\_\-addr} & \hyperlink{protocolthe-p}{the} interface address to look up. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} main address of \hyperlink{protocolthe-p}{the} node with \hyperlink{protocolthe-p}{the} given interface address. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadMidEntry}{BadMidEntry}} & if mid\_\-addr was not found. \\
\hline
\end{DoxyExceptions}
\hypertarget{classTopologyManager_a320289f7435283fa76280617fe095b91}{
\index{TopologyManager@{TopologyManager}!get\_\-mid\_\-address\_\-distance@{get\_\-mid\_\-address\_\-distance}}
\index{get\_\-mid\_\-address\_\-distance@{get\_\-mid\_\-address\_\-distance}!TopologyManager@{TopologyManager}}
\subsubsection[{get\_\-mid\_\-address\_\-distance}]{\setlength{\rightskip}{0pt plus 5cm}uint16\_\-t TopologyManager::get\_\-mid\_\-address\_\-distance (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{main\_\-addr, }
\item[{const {\bf IPv4} \&}]{iface\_\-addr}
\end{DoxyParamCaption}
)  throw ({\bf BadMidEntry})}}
\label{classTopologyManager_a320289f7435283fa76280617fe095b91}


Look up \hyperlink{protocolthe-p}{the} most recently seen distance of a MID entry, given its origin and interface address. 

Internal method. Stubbed out if DETAILED\_\-DEBUG is not defined.


\begin{DoxyParams}{Parameters}
{\em main\_\-addr} & \hyperlink{protocolthe-p}{the} main address of \hyperlink{protocolthe-p}{the} OLSR node to look up. \\
\hline
{\em iface\_\-addr} & \hyperlink{protocolthe-p}{the} interface address of \hyperlink{protocolthe-p}{the} OLSR node to look up. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadMidEntry}{BadMidEntry}} & if \hyperlink{protocolthe-p}{the} entry could not be found. \\
\hline
\end{DoxyExceptions}
\hypertarget{classTopologyManager_a337e9206c8673c8a42b72ef40929768b}{
\index{TopologyManager@{TopologyManager}!get\_\-mid\_\-addresses@{get\_\-mid\_\-addresses}}
\index{get\_\-mid\_\-addresses@{get\_\-mid\_\-addresses}!TopologyManager@{TopologyManager}}
\subsubsection[{get\_\-mid\_\-addresses}]{\setlength{\rightskip}{0pt plus 5cm}vector$<$ {\bf IPv4} $>$ TopologyManager::get\_\-mid\_\-addresses (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{main\_\-addr}
\end{DoxyParamCaption}
)}}
\label{classTopologyManager_a337e9206c8673c8a42b72ef40929768b}


Given \hyperlink{protocolthe-p}{the} main address of an OLSR node, return a vector containing all other interface addresses for it, as learned via \hyperlink{protocolthe-p}{the} MID part of \hyperlink{protocolthe-p}{the} OLSR protocol. 


\begin{DoxyParams}{Parameters}
{\em main\_\-addr} & \hyperlink{protocolthe-p}{the} main address to look up \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a vector of protocol addresses, which may be empty. 
\end{DoxyReturn}
\hypertarget{classTopologyManager_aefd5c7af7ad649b356d0ac036db1af12}{
\index{TopologyManager@{TopologyManager}!get\_\-mid\_\-entry\_\-by\_\-id@{get\_\-mid\_\-entry\_\-by\_\-id}}
\index{get\_\-mid\_\-entry\_\-by\_\-id@{get\_\-mid\_\-entry\_\-by\_\-id}!TopologyManager@{TopologyManager}}
\subsubsection[{get\_\-mid\_\-entry\_\-by\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf MidEntry} $\ast$ TopologyManager::get\_\-mid\_\-entry\_\-by\_\-id (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::MidEntryID}}]{midid}
\end{DoxyParamCaption}
) const  throw ({\bf BadTopologyEntry})}}
\label{classTopologyManager_aefd5c7af7ad649b356d0ac036db1af12}


Get a pointer to a MID entry given its ID. 

Used by \hyperlink{protocolthe-p}{the} XRL layer.


\begin{DoxyParams}{Parameters}
{\em midid} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} MID entry to look up. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} MID entry pointer. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadTopologyEntry}{BadTopologyEntry}} & if \hyperlink{protocolthe-p}{the} entry could not be found. \\
\hline
\end{DoxyExceptions}
\hypertarget{classTopologyManager_ab6321a8d44bd4e1bd211cb4407a44b83}{
\index{TopologyManager@{TopologyManager}!get\_\-mid\_\-list@{get\_\-mid\_\-list}}
\index{get\_\-mid\_\-list@{get\_\-mid\_\-list}!TopologyManager@{TopologyManager}}
\subsubsection[{get\_\-mid\_\-list}]{\setlength{\rightskip}{0pt plus 5cm}void TopologyManager::get\_\-mid\_\-list (
\begin{DoxyParamCaption}
\item[{list$<$ {\bf OlsrTypes::MidEntryID} $>$ \&}]{midlist}
\end{DoxyParamCaption}
) const}}
\label{classTopologyManager_ab6321a8d44bd4e1bd211cb4407a44b83}


Fill out a list of all MID entry IDs. 

Used by \hyperlink{protocolthe-p}{the} XRL layer.


\begin{DoxyParams}{Parameters}
{\em midlist} & \hyperlink{protocolthe-p}{the} list to fill out. \\
\hline
\end{DoxyParams}
\hypertarget{classTopologyManager_a824535b5d358727dc44b861f31503ce0}{
\index{TopologyManager@{TopologyManager}!get\_\-tc\_\-lasthop\_\-count\_\-by\_\-dest@{get\_\-tc\_\-lasthop\_\-count\_\-by\_\-dest}}
\index{get\_\-tc\_\-lasthop\_\-count\_\-by\_\-dest@{get\_\-tc\_\-lasthop\_\-count\_\-by\_\-dest}!TopologyManager@{TopologyManager}}
\subsubsection[{get\_\-tc\_\-lasthop\_\-count\_\-by\_\-dest}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t TopologyManager::get\_\-tc\_\-lasthop\_\-count\_\-by\_\-dest (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{dest\_\-addr}
\end{DoxyParamCaption}
)}}
\label{classTopologyManager_a824535b5d358727dc44b861f31503ce0}


Count \hyperlink{protocolthe-p}{the} number of TC entries which point to a given destination. 

Used by protocol simulator.


\begin{DoxyParams}{Parameters}
{\em dest\_\-addr} & \hyperlink{protocolthe-p}{the} TC destination. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of TC entries pointing to dest\_\-addr. 
\end{DoxyReturn}
\hypertarget{classTopologyManager_a3f4e545a9e144a0ab4dabb74b7515bfe}{
\index{TopologyManager@{TopologyManager}!get\_\-tc\_\-neighbor\_\-set@{get\_\-tc\_\-neighbor\_\-set}}
\index{get\_\-tc\_\-neighbor\_\-set@{get\_\-tc\_\-neighbor\_\-set}!TopologyManager@{TopologyManager}}
\subsubsection[{get\_\-tc\_\-neighbor\_\-set}]{\setlength{\rightskip}{0pt plus 5cm}vector$<$ {\bf IPv4} $>$ TopologyManager::get\_\-tc\_\-neighbor\_\-set (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{origin\_\-addr, }
\item[{uint16\_\-t \&}]{ansn}
\end{DoxyParamCaption}
)  throw ({\bf BadTopologyEntry})}}
\label{classTopologyManager_a3f4e545a9e144a0ab4dabb74b7515bfe}


Retrieve \hyperlink{protocolthe-p}{the} Advertised \hyperlink{classNeighbor}{Neighbor} Set (ANS) for a given OLSR peer. 

Typically used by protocol simulator.

Given \hyperlink{protocolthe-p}{the} address of a node in \hyperlink{protocolthe-p}{the} topology, retrieve \hyperlink{protocolthe-p}{the} addresses from all TC entries originated by that node. Assumes that \hyperlink{protocolthe-p}{the} \char`\"{}all entries for origin have same ANSN\char`\"{} invariant holds.

TODO: Also return \hyperlink{protocolthe-p}{the} per-\/link ETX information.


\begin{DoxyParams}{Parameters}
{\em origin\_\-addr} & \hyperlink{protocolthe-p}{the} originating node to look up in \hyperlink{protocolthe-p}{the} TC database. \\
\hline
{\em ansn} & \hyperlink{protocolthe-p}{the} sequence number of origin\_\-addr's neighbor set. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadTopologyEntry}{BadTopologyEntry}} & if origin\_\-addr was not found. \\
\hline
\end{DoxyExceptions}
\hypertarget{classTopologyManager_aa77aa532266b3ba35264369f0609588c}{
\index{TopologyManager@{TopologyManager}!get\_\-topology\_\-entry\_\-by\_\-id@{get\_\-topology\_\-entry\_\-by\_\-id}}
\index{get\_\-topology\_\-entry\_\-by\_\-id@{get\_\-topology\_\-entry\_\-by\_\-id}!TopologyManager@{TopologyManager}}
\subsubsection[{get\_\-topology\_\-entry\_\-by\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf TopologyEntry} $\ast$ TopologyManager::get\_\-topology\_\-entry\_\-by\_\-id (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::TopologyID}}]{tcid}
\end{DoxyParamCaption}
) const  throw ({\bf BadTopologyEntry})}}
\label{classTopologyManager_aa77aa532266b3ba35264369f0609588c}


Get a pointer to a topology entry given its ID. 

Used by \hyperlink{protocolthe-p}{the} XRL layer.


\begin{DoxyParams}{Parameters}
{\em tcid} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} TC entry to look up. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} MID pointer. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadTopologyEntry}{BadTopologyEntry}} & if \hyperlink{protocolthe-p}{the} entry could not be found. \\
\hline
\end{DoxyExceptions}
\hypertarget{classTopologyManager_afa014f852f2b21c39a50421fce8f9e2b}{
\index{TopologyManager@{TopologyManager}!get\_\-topology\_\-list@{get\_\-topology\_\-list}}
\index{get\_\-topology\_\-list@{get\_\-topology\_\-list}!TopologyManager@{TopologyManager}}
\subsubsection[{get\_\-topology\_\-list}]{\setlength{\rightskip}{0pt plus 5cm}void TopologyManager::get\_\-topology\_\-list (
\begin{DoxyParamCaption}
\item[{list$<$ {\bf OlsrTypes::TopologyID} $>$ \&}]{tclist}
\end{DoxyParamCaption}
) const}}
\label{classTopologyManager_afa014f852f2b21c39a50421fce8f9e2b}


Fill out a list of all topology entry IDs. 

Used by \hyperlink{protocolthe-p}{the} XRL layer.


\begin{DoxyParams}{Parameters}
{\em tclist} & \hyperlink{protocolthe-p}{the} list to fill out. \\
\hline
\end{DoxyParams}
\hypertarget{classTopologyManager_a91a7f74ad8fcf00febbe6dfc599f2b9a}{
\index{TopologyManager@{TopologyManager}!get\_\-topologyid@{get\_\-topologyid}}
\index{get\_\-topologyid@{get\_\-topologyid}!TopologyManager@{TopologyManager}}
\subsubsection[{get\_\-topologyid}]{\setlength{\rightskip}{0pt plus 5cm}{\bf OlsrTypes::TopologyID} TopologyManager::get\_\-topologyid (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{dest\_\-addr, }
\item[{const {\bf IPv4} \&}]{lasthop\_\-addr}
\end{DoxyParamCaption}
)  throw ({\bf BadTopologyEntry})}}
\label{classTopologyManager_a91a7f74ad8fcf00febbe6dfc599f2b9a}


Return a topology entry ID given its destination and origin. 

Note: This is not declared 'const' due to \hyperlink{protocolthe-p}{the} undeclared mutability of map::operator\mbox{[}$\,$\mbox{]}.


\begin{DoxyParams}{Parameters}
{\em dest\_\-addr} & \hyperlink{protocolthe-p}{the} destination of \hyperlink{protocolthe-p}{the} TC entry to look up. \\
\hline
{\em lasthop\_\-addr} & \hyperlink{protocolthe-p}{the} origin of \hyperlink{protocolthe-p}{the} TC entry to look up. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} topology ID. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadTopologyEntry}{BadTopologyEntry}} & if \hyperlink{protocolthe-p}{the} entry could not be found. \\
\hline
\end{DoxyExceptions}
\hypertarget{classTopologyManager_ae8f1efa509cb6ba3c46795587ee47c01}{
\index{TopologyManager@{TopologyManager}!mid\_\-node\_\-count@{mid\_\-node\_\-count}}
\index{mid\_\-node\_\-count@{mid\_\-node\_\-count}!TopologyManager@{TopologyManager}}
\subsubsection[{mid\_\-node\_\-count}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t TopologyManager::mid\_\-node\_\-count (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classTopologyManager_ae8f1efa509cb6ba3c46795587ee47c01}


Count \hyperlink{protocolthe-p}{the} number of unique OLSR main addresses in this node's MID database. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} number of OLSR main addresses in \_\-mid\_\-addr. 
\end{DoxyReturn}
\hypertarget{classTopologyManager_ae0ffae340837c9ceb54f7277cbb1c64f}{
\index{TopologyManager@{TopologyManager}!push\_\-topology@{push\_\-topology}}
\index{push\_\-topology@{push\_\-topology}!TopologyManager@{TopologyManager}}
\subsubsection[{push\_\-topology}]{\setlength{\rightskip}{0pt plus 5cm}void TopologyManager::push\_\-topology (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classTopologyManager_ae0ffae340837c9ceb54f7277cbb1c64f}


\hyperlink{classPush}{Push} topology set to \hyperlink{protocolthe-p}{the} \hyperlink{classRouteManager}{RouteManager} for SPT computation. 

Section 10: \hyperlink{classRoute}{Route} computation.

In ascending order, we push \hyperlink{protocolthe-p}{the} rest of \hyperlink{protocolthe-p}{the} known network topology, starting with \hyperlink{protocolthe-p}{the} TC entries which would have been originated by two-\/hop neighbors. If we encounter incomplete TC information for \hyperlink{protocolthe-p}{the} network topology, that is, there are no known nodes at a particular distance, we stop pushing topology to \hyperlink{classRouteManager}{RouteManager}.

TODO: Use ETX measurements for edge choice. \hypertarget{classTopologyManager_adcfd552b9feabc64961851c407bf9476}{
\index{TopologyManager@{TopologyManager}!tc\_\-node\_\-count@{tc\_\-node\_\-count}}
\index{tc\_\-node\_\-count@{tc\_\-node\_\-count}!TopologyManager@{TopologyManager}}
\subsubsection[{tc\_\-node\_\-count}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t TopologyManager::tc\_\-node\_\-count (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classTopologyManager_adcfd552b9feabc64961851c407bf9476}


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

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} number of unique main addresses in \hyperlink{protocolthe-p}{the} TC lasthop map. 
\end{DoxyReturn}
\hypertarget{classTopologyManager_acfa9623a87e742572e8fab588b83d687}{
\index{TopologyManager@{TopologyManager}!update\_\-mid\_\-entry@{update\_\-mid\_\-entry}}
\index{update\_\-mid\_\-entry@{update\_\-mid\_\-entry}!TopologyManager@{TopologyManager}}
\subsubsection[{update\_\-mid\_\-entry}]{\setlength{\rightskip}{0pt plus 5cm}void TopologyManager::update\_\-mid\_\-entry (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{main\_\-addr, }
\item[{const {\bf IPv4} \&}]{iface\_\-addr, }
\item[{const uint16\_\-t}]{distance, }
\item[{const {\bf TimeVal} \&}]{vtime, }
\item[{bool \&}]{is\_\-mid\_\-created}
\end{DoxyParamCaption}
)  throw ({\bf BadMidEntry})}}
\label{classTopologyManager_acfa9623a87e742572e8fab588b83d687}


Update a Multiple Interface Declaration (MID) entry. 

The entry will be created if it does not exist.


\begin{DoxyParams}{Parameters}
{\em main\_\-addr} & \hyperlink{protocolthe-p}{the} main address of \hyperlink{protocolthe-p}{the} node originating \hyperlink{protocolthe-p}{the} MID entry. \\
\hline
{\em iface\_\-addr} & \hyperlink{protocolthe-p}{the} interface address of \hyperlink{protocolthe-p}{the} MID entry. \\
\hline
{\em distance} & \hyperlink{protocolthe-p}{the} distance in hops of \hyperlink{protocolthe-p}{the} origin of \hyperlink{protocolthe-p}{the} MIS message being processed. \\
\hline
{\em vtime} & \hyperlink{protocolthe-p}{the} time for which \hyperlink{protocolthe-p}{the} MID entry remains valid. \\
\hline
{\em is\_\-mid\_\-created} & set to true if a new MID entry was created. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadMidEntry}{BadMidEntry}} & if \hyperlink{protocolthe-p}{the} entry could not be created or updated. \\
\hline
\end{DoxyExceptions}
\hypertarget{classTopologyManager_aec656875de856247d6d75eb8bc5df359}{
\index{TopologyManager@{TopologyManager}!update\_\-tc\_\-distance@{update\_\-tc\_\-distance}}
\index{update\_\-tc\_\-distance@{update\_\-tc\_\-distance}!TopologyManager@{TopologyManager}}
\subsubsection[{update\_\-tc\_\-distance}]{\setlength{\rightskip}{0pt plus 5cm}void TopologyManager::update\_\-tc\_\-distance (
\begin{DoxyParamCaption}
\item[{{\bf TopologyEntry} $\ast$}]{tc, }
\item[{uint16\_\-t}]{distance}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classTopologyManager_aec656875de856247d6d75eb8bc5df359}


Internal method to: update a TC entry's distance. 

It is necessary to maintain an insertion sort collation order in \hyperlink{protocolthe-p}{the} TcDistanceMap as it is used for route calculation.


\begin{DoxyParams}{Parameters}
{\em tc} & pointer to \hyperlink{protocolthe-p}{the} \hyperlink{classTopologyEntry}{TopologyEntry} to update. \\
\hline
{\em distance} & \hyperlink{protocolthe-p}{the} new distance of \hyperlink{protocolthe-p}{the} \hyperlink{classTopologyEntry}{TopologyEntry}. \\
\hline
\end{DoxyParams}
\hypertarget{classTopologyManager_a4136de52b12928b9cbc3b0b17ab70cae}{
\index{TopologyManager@{TopologyManager}!update\_\-tc\_\-entry@{update\_\-tc\_\-entry}}
\index{update\_\-tc\_\-entry@{update\_\-tc\_\-entry}!TopologyManager@{TopologyManager}}
\subsubsection[{update\_\-tc\_\-entry}]{\setlength{\rightskip}{0pt plus 5cm}void TopologyManager::update\_\-tc\_\-entry (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{dest\_\-addr, }
\item[{const {\bf IPv4} \&}]{origin\_\-addr, }
\item[{const uint16\_\-t}]{distance, }
\item[{const uint16\_\-t}]{ansn, }
\item[{const {\bf TimeVal} \&}]{vtime, }
\item[{bool \&}]{is\_\-created}
\end{DoxyParamCaption}
)  throw ({\bf BadTopologyEntry})}}
\label{classTopologyManager_a4136de52b12928b9cbc3b0b17ab70cae}


Update or create a topology entry in \hyperlink{protocolthe-p}{the} TC database. 


\begin{DoxyParams}{Parameters}
{\em dest\_\-addr} & \hyperlink{protocolthe-p}{the} destination of \hyperlink{protocolthe-p}{the} topology entry. \\
\hline
{\em origin\_\-addr} & \hyperlink{protocolthe-p}{the} origin of \hyperlink{protocolthe-p}{the} topology entry. \\
\hline
{\em distance} & \hyperlink{protocolthe-p}{the} distance in hops from this node to \hyperlink{protocolthe-p}{the} origin, calculated from \hyperlink{protocolthe-p}{the} message hop count. \\
\hline
{\em ansn} & \hyperlink{protocolthe-p}{the} advertised sequence number of \hyperlink{protocolthe-p}{the} topology entry. \\
\hline
{\em vtime} & \hyperlink{protocolthe-p}{the} time for which this topology entry remains valid. \\
\hline
{\em is\_\-created} & a boolean which is set to true if a new entry has been created. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classBadTopologyEntry}{BadTopologyEntry}} & if \hyperlink{protocolthe-p}{the} entry could not be created. \\
\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/topology.hh\item 
/home/greearb/git/xorp.ct.github/xorp/contrib/olsr/topology.cc\end{DoxyCompactItemize}
