\hypertarget{classNeighbor}{
\section{Neighbor Class Reference}
\label{classNeighbor}\index{Neighbor@{Neighbor}}
}


A one-\/hop neighbor.  




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

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classNeighbor_ac59c8408fdf255a9926878a99c0cf130}{
{\bfseries Neighbor} (\hyperlink{classEventLoop}{EventLoop} \&ev, \hyperlink{classNeighborhood}{Neighborhood} $\ast$parent, const \hyperlink{structOlsrTypes_a246952255e8728960d15898f8f96e017}{OlsrTypes::NeighborID} nid, const \hyperlink{classIPv4}{IPv4} \&main\_\-addr, const \hyperlink{structOlsrTypes_a5c8f1d4f06caa7b0cb4b05f7aef7b67f}{OlsrTypes::LogicalLinkID} linkid)}
\label{classNeighbor_ac59c8408fdf255a9926878a99c0cf130}

\item 
\hypertarget{classNeighbor_a6abd5c9d6d1c1a060cb602e10fc3c6a6}{
\hyperlink{structOlsrTypes_a246952255e8728960d15898f8f96e017}{OlsrTypes::NeighborID} {\bfseries id} () const }
\label{classNeighbor_a6abd5c9d6d1c1a060cb602e10fc3c6a6}

\item 
\hypertarget{classNeighbor_ac6835cbe305fd048966be50d3cb880e2}{
const \hyperlink{classIPv4}{IPv4} {\bfseries main\_\-addr} () const }
\label{classNeighbor_ac6835cbe305fd048966be50d3cb880e2}

\item 
\hypertarget{classNeighbor_a6f93435e9c4797e5e061a87d9552cf38}{
string {\bfseries toStringBrief} ()}
\label{classNeighbor_a6f93435e9c4797e5e061a87d9552cf38}

\item 
\hypertarget{classNeighbor_a5b4b33e20ddc539fb2e8515b14c45fd3}{
\hyperlink{structOlsrTypes_a49660be3860e0e723a6d6450b31a1eb9}{OlsrTypes::NeighborType} {\bfseries neighbor\_\-type} () const }
\label{classNeighbor_a5b4b33e20ddc539fb2e8515b14c45fd3}

\item 
uint8\_\-t \hyperlink{classNeighbor_ae77d6a52cd0bcdf84432cb7db18b999f}{willingness} () const 
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} willingness-\/to-\/forward for this neighbor. \item\end{DoxyCompactList}\item 
void \hyperlink{classNeighbor_aa5791ddf246b0b94dba32e525a908bf1}{set\_\-willingness} (\hyperlink{structOlsrTypes_a0dc070ed0b3ef1b8e99e93c333c8ed2e}{OlsrTypes::WillType} value)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} willingness-\/to-\/forward for this neighbor. \item\end{DoxyCompactList}\item 
bool \hyperlink{classNeighbor_ac7f77864b4fbb6f869f4332857668236}{is\_\-mpr\_\-selector} () const 
\begin{DoxyCompactList}\small\item\em Return \hyperlink{protocolthe-p}{the} MPR selector state of this neighbor. \item\end{DoxyCompactList}\item 
void \hyperlink{classNeighbor_a9901e18e7c7225cca95ac64a8d76bd7c}{set\_\-is\_\-mpr\_\-selector} (bool value, const \hyperlink{classTimeVal}{TimeVal} \&expiry\_\-time)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} MPR selector state of this neighbor. \item\end{DoxyCompactList}\item 
bool \hyperlink{classNeighbor_a3d87bf404e5f30822e97475dedea7553}{is\_\-mpr} () const 
\begin{DoxyCompactList}\small\item\em Return \hyperlink{protocolthe-p}{the} previously stored result of MPR selection. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_a3440bfbfd0a1c7d9c71d9edd4a2aad3c}{
void {\bfseries set\_\-is\_\-mpr} (bool value)}
\label{classNeighbor_a3440bfbfd0a1c7d9c71d9edd4a2aad3c}

\item 
bool \hyperlink{classNeighbor_a734f434a10b991a8b23300a935adc2c2}{is\_\-persistent\_\-cand\_\-mpr} () const 
\item 
bool \hyperlink{classNeighbor_ad9ee99a0faaca1cbb8edab890a960e6f}{is\_\-cand\_\-mpr} ()
\begin{DoxyCompactList}\small\item\em Return \hyperlink{protocolthe-p}{the} MPR candidacy of this neighbor. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_ad5e9367a2c74230ca2e1a404bbaa3eff}{
bool {\bfseries is\_\-sym} () const }
\label{classNeighbor_ad5e9367a2c74230ca2e1a404bbaa3eff}

\item 
\hypertarget{classNeighbor_af2bc8e938f57ae51b65609a6d4b9cecd}{
void {\bfseries set\_\-is\_\-sym} (bool value)}
\label{classNeighbor_af2bc8e938f57ae51b65609a6d4b9cecd}

\item 
\hypertarget{classNeighbor_aaf02b90bc187f768c1a0d03aa59c08f0}{
const set$<$ \hyperlink{structOlsrTypes_a5c8f1d4f06caa7b0cb4b05f7aef7b67f}{OlsrTypes::LogicalLinkID} $>$ \& {\bfseries links} () const }
\label{classNeighbor_aaf02b90bc187f768c1a0d03aa59c08f0}

\item 
\hypertarget{classNeighbor_a40c621954e8d62b51f82d1a702ebef61}{
const set$<$ \hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} $>$ \& {\bfseries twohop\_\-links} () const }
\label{classNeighbor_a40c621954e8d62b51f82d1a702ebef61}

\item 
void \hyperlink{classNeighbor_ab844a392164939d1d63d1cbd94d5399b}{update\_\-link} (const \hyperlink{structOlsrTypes_a5c8f1d4f06caa7b0cb4b05f7aef7b67f}{OlsrTypes::LogicalLinkID} linkid)
\begin{DoxyCompactList}\small\item\em Associate a link tuple with a \hyperlink{classNeighbor}{Neighbor} or update an existing one. \item\end{DoxyCompactList}\item 
bool \hyperlink{classNeighbor_a866cc749acc6d564a7321e45f15a3bf6}{delete\_\-link} (const \hyperlink{structOlsrTypes_a5c8f1d4f06caa7b0cb4b05f7aef7b67f}{OlsrTypes::LogicalLinkID} linkid)
\begin{DoxyCompactList}\small\item\em Disassociate a link tuple from a \hyperlink{classNeighbor}{Neighbor}. \item\end{DoxyCompactList}\item 
void \hyperlink{classNeighbor_aed7bd1c849d2f495a751ab43aea33e5d}{add\_\-twohop\_\-link} (const \hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} tlid)
\begin{DoxyCompactList}\small\item\em Associate a two-\/hop link with a \hyperlink{classNeighbor}{Neighbor}. \item\end{DoxyCompactList}\item 
bool \hyperlink{classNeighbor_a7e2bf799b6fb27612a49ffe25569fc17}{delete\_\-twohop\_\-link} (const \hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} tlid)
\begin{DoxyCompactList}\small\item\em Disassociate a two-\/hop link from a \hyperlink{classNeighbor}{Neighbor}. \item\end{DoxyCompactList}\item 
size\_\-t \hyperlink{classNeighbor_a561b6f261af16f87ed886818185d7810}{delete\_\-all\_\-twohop\_\-links} ()
\begin{DoxyCompactList}\small\item\em Disassociate all two-\/hop links from a \hyperlink{classNeighbor}{Neighbor}. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_acbe55a27594335eb9879433c470d2a6c}{
void \hyperlink{classNeighbor_acbe55a27594335eb9879433c470d2a6c}{event\_\-mpr\_\-selector\_\-expired} ()}
\label{classNeighbor_acbe55a27594335eb9879433c470d2a6c}

\begin{DoxyCompactList}\small\item\em Callback method to: process expiry of an MPR selector tuple. \item\end{DoxyCompactList}\item 
uint32\_\-t \hyperlink{classNeighbor_adab62484b8175195bad7120a4cbdefef}{degree} () const 
\begin{DoxyCompactList}\small\item\em Return \hyperlink{protocolthe-p}{the} degree of this neighbor. \item\end{DoxyCompactList}\item 
uint32\_\-t \hyperlink{classNeighbor_af23564df74fe1b80e4ecf34b6b7d8884}{reachability} () const 
\begin{DoxyCompactList}\small\item\em Return \hyperlink{protocolthe-p}{the} previously computed reachability of this neighbor. \item\end{DoxyCompactList}\item 
void \hyperlink{classNeighbor_aa06c588e4555037a3f682d444c07040a}{set\_\-reachability} (uint32\_\-t value)
\begin{DoxyCompactList}\small\item\em \hyperlink{classStore}{Store} \hyperlink{protocolthe-p}{the} reachability of this neighbor. \item\end{DoxyCompactList}\item 
bool \hyperlink{classNeighbor_af1c39ed2355df80eb1ea0dd78a10598b}{is\_\-advertised} () const 
\begin{DoxyCompactList}\small\item\em Return if this neighbor is advertised in TC messages. \item\end{DoxyCompactList}\item 
void \hyperlink{classNeighbor_a90f74800af32bacee9ca9cfbd686581b}{set\_\-is\_\-advertised} (bool value)
\begin{DoxyCompactList}\small\item\em \hyperlink{classStore}{Store} \hyperlink{protocolthe-p}{the} \char`\"{}is in advertised neighbor set\char`\"{} status. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classNeighbor_aeb15542539e2e0503385ffbd4c4629b4}{recount\_\-degree} ()
\begin{DoxyCompactList}\small\item\em Re-\/count \hyperlink{protocolthe-p}{the} degree of this strict one-\/hop \hyperlink{classNeighbor}{Neighbor}. \item\end{DoxyCompactList}\item 
bool \hyperlink{classNeighbor_a3056f79c4a1702966cc835e0bc3da773}{update\_\-cand\_\-mpr} (bool was\_\-cand\_\-mpr)
\begin{DoxyCompactList}\small\item\em Update \hyperlink{protocolthe-p}{the} MPR candidacy of this neighbor. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classNeighbor_a92118cdba4b4f9029f35657a7d467eed}{
\hyperlink{classEventLoop}{EventLoop} \& {\bfseries \_\-eventloop}}
\label{classNeighbor_a92118cdba4b4f9029f35657a7d467eed}

\item 
\hypertarget{classNeighbor_a5bf7354ccbf1549f9829b8abd147d875}{
\hyperlink{classNeighborhood}{Neighborhood} $\ast$ {\bfseries \_\-parent}}
\label{classNeighbor_a5bf7354ccbf1549f9829b8abd147d875}

\item 
\hypertarget{classNeighbor_a965e162a9eada1131faae2f35406f8e0}{
\hyperlink{structOlsrTypes_a246952255e8728960d15898f8f96e017}{OlsrTypes::NeighborID} {\bfseries \_\-id}}
\label{classNeighbor_a965e162a9eada1131faae2f35406f8e0}

\item 
\hypertarget{classNeighbor_aaf669e10da588f83bd401c721c8867cb}{
\hyperlink{classIPv4}{IPv4} \hyperlink{classNeighbor_aaf669e10da588f83bd401c721c8867cb}{\_\-main\_\-addr}}
\label{classNeighbor_aaf669e10da588f83bd401c721c8867cb}

\begin{DoxyCompactList}\small\item\em main address of this neighbor. \item\end{DoxyCompactList}\item 
bool \hyperlink{classNeighbor_ae4835aec3f34a5de558092a6f1bb4704}{\_\-is\_\-mpr}
\begin{DoxyCompactList}\small\item\em true if neighbor is an MPR. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_aa55deae9f43d7848fceb732d3cb6be9a}{
bool \hyperlink{classNeighbor_aa55deae9f43d7848fceb732d3cb6be9a}{\_\-is\_\-sym}}
\label{classNeighbor_aa55deae9f43d7848fceb732d3cb6be9a}

\begin{DoxyCompactList}\small\item\em true if neighbor is symmetric. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_a0c01e2687ce4da6b302cf2c6704120b6}{
\hyperlink{structOlsrTypes_a0dc070ed0b3ef1b8e99e93c333c8ed2e}{OlsrTypes::WillType} \hyperlink{classNeighbor_a0c01e2687ce4da6b302cf2c6704120b6}{\_\-willingness}}
\label{classNeighbor_a0c01e2687ce4da6b302cf2c6704120b6}

\begin{DoxyCompactList}\small\item\em willingness to forward traffic. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_a22d9b63cd02d0dcd2819ff9560a99b88}{
uint32\_\-t \hyperlink{classNeighbor_a22d9b63cd02d0dcd2819ff9560a99b88}{\_\-degree}}
\label{classNeighbor_a22d9b63cd02d0dcd2819ff9560a99b88}

\begin{DoxyCompactList}\small\item\em \hyperlink{protocolthe-p}{the} degree of this neighbor. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_a4ef324be1a0e7305752224151ed56aea}{
uint32\_\-t \hyperlink{classNeighbor_a4ef324be1a0e7305752224151ed56aea}{\_\-reachability}}
\label{classNeighbor_a4ef324be1a0e7305752224151ed56aea}

\begin{DoxyCompactList}\small\item\em \hyperlink{protocolthe-p}{the} reachability of this neighbor. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_aea0db87a3c11cba20d72be323adf8890}{
bool \hyperlink{classNeighbor_aea0db87a3c11cba20d72be323adf8890}{\_\-is\_\-advertised}}
\label{classNeighbor_aea0db87a3c11cba20d72be323adf8890}

\begin{DoxyCompactList}\small\item\em true if neighbor is advertised in TC messages. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_a78f27c5b7d9b09346e4726273124e7bd}{
\hyperlink{classXorpTimer}{XorpTimer} \hyperlink{classNeighbor_a78f27c5b7d9b09346e4726273124e7bd}{\_\-mpr\_\-selector\_\-timer}}
\label{classNeighbor_a78f27c5b7d9b09346e4726273124e7bd}

\begin{DoxyCompactList}\small\item\em A timer which is scheduled if and only if \hyperlink{protocolthe-p}{the} neighbor selects this node as an MPR. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_af408d38c957360bf1a60561a6cf58da4}{
set$<$ \hyperlink{structOlsrTypes_a5c8f1d4f06caa7b0cb4b05f7aef7b67f}{OlsrTypes::LogicalLinkID} $>$ \hyperlink{classNeighbor_af408d38c957360bf1a60561a6cf58da4}{\_\-links}}
\label{classNeighbor_af408d38c957360bf1a60561a6cf58da4}

\begin{DoxyCompactList}\small\item\em \hyperlink{classLinks}{Links} which reference this neighbor. \item\end{DoxyCompactList}\item 
\hypertarget{classNeighbor_a62d460567b19401cc5e2e4f5cad2e55a}{
set$<$ \hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} $>$ \hyperlink{classNeighbor_a62d460567b19401cc5e2e4f5cad2e55a}{\_\-twohop\_\-links}}
\label{classNeighbor_a62d460567b19401cc5e2e4f5cad2e55a}

\begin{DoxyCompactList}\small\item\em \hyperlink{classLinks}{Links} to all N2, strict and non-\/strict, reachable via this N. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A one-\/hop neighbor. 

\subsection{Member Function Documentation}
\hypertarget{classNeighbor_aed7bd1c849d2f495a751ab43aea33e5d}{
\index{Neighbor@{Neighbor}!add\_\-twohop\_\-link@{add\_\-twohop\_\-link}}
\index{add\_\-twohop\_\-link@{add\_\-twohop\_\-link}!Neighbor@{Neighbor}}
\subsubsection[{add\_\-twohop\_\-link}]{\setlength{\rightskip}{0pt plus 5cm}void Neighbor::add\_\-twohop\_\-link (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::TwoHopLinkID}}]{tlid}
\end{DoxyParamCaption}
)}}
\label{classNeighbor_aed7bd1c849d2f495a751ab43aea33e5d}


Associate a two-\/hop link with a \hyperlink{classNeighbor}{Neighbor}. 

MPR candidacy and degree are updated.


\begin{DoxyParams}{Parameters}
{\em tlid} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} two-\/hop link to associate with this \hyperlink{classNeighbor}{Neighbor}. \\
\hline
\end{DoxyParams}
\hypertarget{classNeighbor_adab62484b8175195bad7120a4cbdefef}{
\index{Neighbor@{Neighbor}!degree@{degree}}
\index{degree@{degree}!Neighbor@{Neighbor}}
\subsubsection[{degree}]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t Neighbor::degree (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classNeighbor_adab62484b8175195bad7120a4cbdefef}


Return \hyperlink{protocolthe-p}{the} degree of this neighbor. 

\begin{DoxyReturn}{Returns}
The number of symmetric neighbors of this neighbor, excluding this node, and other one-\/hop neighbors. 
\end{DoxyReturn}
\hypertarget{classNeighbor_a561b6f261af16f87ed886818185d7810}{
\index{Neighbor@{Neighbor}!delete\_\-all\_\-twohop\_\-links@{delete\_\-all\_\-twohop\_\-links}}
\index{delete\_\-all\_\-twohop\_\-links@{delete\_\-all\_\-twohop\_\-links}!Neighbor@{Neighbor}}
\subsubsection[{delete\_\-all\_\-twohop\_\-links}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t Neighbor::delete\_\-all\_\-twohop\_\-links (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classNeighbor_a561b6f261af16f87ed886818185d7810}


Disassociate all two-\/hop links from a \hyperlink{classNeighbor}{Neighbor}. 

MPR candidacy and degree are updated.

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} number of links which have been deleted. 
\end{DoxyReturn}
\hypertarget{classNeighbor_a866cc749acc6d564a7321e45f15a3bf6}{
\index{Neighbor@{Neighbor}!delete\_\-link@{delete\_\-link}}
\index{delete\_\-link@{delete\_\-link}!Neighbor@{Neighbor}}
\subsubsection[{delete\_\-link}]{\setlength{\rightskip}{0pt plus 5cm}bool Neighbor::delete\_\-link (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::LogicalLinkID}}]{linkid}
\end{DoxyParamCaption}
)}}
\label{classNeighbor_a866cc749acc6d564a7321e45f15a3bf6}


Disassociate a link tuple from a \hyperlink{classNeighbor}{Neighbor}. 

N\_\-status is updated.


\begin{DoxyParams}{Parameters}
{\em linkid} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} link to disassociate from this \hyperlink{classNeighbor}{Neighbor}.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if there are no links to this \hyperlink{classNeighbor}{Neighbor} and it should now be deleted. 
\end{DoxyReturn}
\hypertarget{classNeighbor_a7e2bf799b6fb27612a49ffe25569fc17}{
\index{Neighbor@{Neighbor}!delete\_\-twohop\_\-link@{delete\_\-twohop\_\-link}}
\index{delete\_\-twohop\_\-link@{delete\_\-twohop\_\-link}!Neighbor@{Neighbor}}
\subsubsection[{delete\_\-twohop\_\-link}]{\setlength{\rightskip}{0pt plus 5cm}bool Neighbor::delete\_\-twohop\_\-link (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::TwoHopLinkID}}]{tlid}
\end{DoxyParamCaption}
)}}
\label{classNeighbor_a7e2bf799b6fb27612a49ffe25569fc17}


Disassociate a two-\/hop link from a \hyperlink{classNeighbor}{Neighbor}. 

MPR candidacy and degree are updated.


\begin{DoxyParams}{Parameters}
{\em tlid} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} two-\/hop link to disassociate from this \hyperlink{classNeighbor}{Neighbor}. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if this \hyperlink{classNeighbor}{Neighbor} has no more two-\/hop links. 
\end{DoxyReturn}
\hypertarget{classNeighbor_af1c39ed2355df80eb1ea0dd78a10598b}{
\index{Neighbor@{Neighbor}!is\_\-advertised@{is\_\-advertised}}
\index{is\_\-advertised@{is\_\-advertised}!Neighbor@{Neighbor}}
\subsubsection[{is\_\-advertised}]{\setlength{\rightskip}{0pt plus 5cm}bool Neighbor::is\_\-advertised (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classNeighbor_af1c39ed2355df80eb1ea0dd78a10598b}


Return if this neighbor is advertised in TC messages. 

\begin{DoxyReturn}{Returns}
true if this neighbor is advertised in TC messages. 
\end{DoxyReturn}
\hypertarget{classNeighbor_ad9ee99a0faaca1cbb8edab890a960e6f}{
\index{Neighbor@{Neighbor}!is\_\-cand\_\-mpr@{is\_\-cand\_\-mpr}}
\index{is\_\-cand\_\-mpr@{is\_\-cand\_\-mpr}!Neighbor@{Neighbor}}
\subsubsection[{is\_\-cand\_\-mpr}]{\setlength{\rightskip}{0pt plus 5cm}bool Neighbor::is\_\-cand\_\-mpr (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classNeighbor_ad9ee99a0faaca1cbb8edab890a960e6f}


Return \hyperlink{protocolthe-p}{the} MPR candidacy of this neighbor. 

MPR candidacy is computed whenever Neighbor's link state changes.

TODO: NOTE WELL: If a neighbor is not reachable due to no good ETX links, it MUST NOT be considered as an MPR candidate. Currently \hyperlink{protocolthe-p}{the} code does not take account of this.

\begin{DoxyReturn}{Returns}
true if this neighbor is a candidate MPR, that is, there is at least one link to a strict two-\/hop neighbor, and willingness is not WILL\_\-NEVER. 
\end{DoxyReturn}
\hypertarget{classNeighbor_a3d87bf404e5f30822e97475dedea7553}{
\index{Neighbor@{Neighbor}!is\_\-mpr@{is\_\-mpr}}
\index{is\_\-mpr@{is\_\-mpr}!Neighbor@{Neighbor}}
\subsubsection[{is\_\-mpr}]{\setlength{\rightskip}{0pt plus 5cm}bool Neighbor::is\_\-mpr (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classNeighbor_a3d87bf404e5f30822e97475dedea7553}


Return \hyperlink{protocolthe-p}{the} previously stored result of MPR selection. 

This is computed by \hyperlink{protocolthe-p}{the} deferred MPR selection task in \hyperlink{classNeighborhood}{Neighborhood}.

\begin{DoxyReturn}{Returns}
true if this neighbor has been selected as an MPR. 
\end{DoxyReturn}
\hypertarget{classNeighbor_ac7f77864b4fbb6f869f4332857668236}{
\index{Neighbor@{Neighbor}!is\_\-mpr\_\-selector@{is\_\-mpr\_\-selector}}
\index{is\_\-mpr\_\-selector@{is\_\-mpr\_\-selector}!Neighbor@{Neighbor}}
\subsubsection[{is\_\-mpr\_\-selector}]{\setlength{\rightskip}{0pt plus 5cm}bool Neighbor::is\_\-mpr\_\-selector (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classNeighbor_ac7f77864b4fbb6f869f4332857668236}


Return \hyperlink{protocolthe-p}{the} MPR selector state of this neighbor. 

\begin{DoxyReturn}{Returns}
true if this neighbor has previously chosen this node as an MPR in a HELLO message, and \hyperlink{protocolthe-p}{the} tuple is still valid. 
\end{DoxyReturn}
\hypertarget{classNeighbor_a734f434a10b991a8b23300a935adc2c2}{
\index{Neighbor@{Neighbor}!is\_\-persistent\_\-cand\_\-mpr@{is\_\-persistent\_\-cand\_\-mpr}}
\index{is\_\-persistent\_\-cand\_\-mpr@{is\_\-persistent\_\-cand\_\-mpr}!Neighbor@{Neighbor}}
\subsubsection[{is\_\-persistent\_\-cand\_\-mpr}]{\setlength{\rightskip}{0pt plus 5cm}bool Neighbor::is\_\-persistent\_\-cand\_\-mpr (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classNeighbor_a734f434a10b991a8b23300a935adc2c2}
\begin{DoxyReturn}{Returns}
true if this neighbor is a persistent MPR candidate. 
\end{DoxyReturn}
\hypertarget{classNeighbor_af23564df74fe1b80e4ecf34b6b7d8884}{
\index{Neighbor@{Neighbor}!reachability@{reachability}}
\index{reachability@{reachability}!Neighbor@{Neighbor}}
\subsubsection[{reachability}]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t Neighbor::reachability (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classNeighbor_af23564df74fe1b80e4ecf34b6b7d8884}


Return \hyperlink{protocolthe-p}{the} previously computed reachability of this neighbor. 

\begin{DoxyReturn}{Returns}
The number of strict, uncovered, two-\/hop neighbors to which this neighbor has a link. 
\end{DoxyReturn}
\hypertarget{classNeighbor_aeb15542539e2e0503385ffbd4c4629b4}{
\index{Neighbor@{Neighbor}!recount\_\-degree@{recount\_\-degree}}
\index{recount\_\-degree@{recount\_\-degree}!Neighbor@{Neighbor}}
\subsubsection[{recount\_\-degree}]{\setlength{\rightskip}{0pt plus 5cm}void Neighbor::recount\_\-degree (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classNeighbor_aeb15542539e2e0503385ffbd4c4629b4}


Re-\/count \hyperlink{protocolthe-p}{the} degree of this strict one-\/hop \hyperlink{classNeighbor}{Neighbor}. 

Section 8.3.1 defines \hyperlink{protocolthe-p}{the} degree of a one-\/hop neighbor as \hyperlink{protocolthe-p}{the} number of symmetric neighbors of \hyperlink{protocolthe-p}{the} neighbor, excluding any members of \hyperlink{protocolthe-p}{the} one-\/hop neighborhood, and excluding this node.

Triggered by a two-\/hop link state change. TODO: Distribute \hyperlink{protocolthe-p}{the} computation by pushing \hyperlink{protocolthe-p}{the} responsibility for signalling \hyperlink{protocolthe-p}{the} change of state to \hyperlink{classTwoHopNeighbor}{TwoHopNeighbor}, rather than doing it here. \hypertarget{classNeighbor_a90f74800af32bacee9ca9cfbd686581b}{
\index{Neighbor@{Neighbor}!set\_\-is\_\-advertised@{set\_\-is\_\-advertised}}
\index{set\_\-is\_\-advertised@{set\_\-is\_\-advertised}!Neighbor@{Neighbor}}
\subsubsection[{set\_\-is\_\-advertised}]{\setlength{\rightskip}{0pt plus 5cm}void Neighbor::set\_\-is\_\-advertised (
\begin{DoxyParamCaption}
\item[{bool}]{value}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classNeighbor_a90f74800af32bacee9ca9cfbd686581b}


\hyperlink{classStore}{Store} \hyperlink{protocolthe-p}{the} \char`\"{}is in advertised neighbor set\char`\"{} status. 


\begin{DoxyParams}{Parameters}
{\em value} & true if this neighbor is advertised in TC. \\
\hline
\end{DoxyParams}
\hypertarget{classNeighbor_a9901e18e7c7225cca95ac64a8d76bd7c}{
\index{Neighbor@{Neighbor}!set\_\-is\_\-mpr\_\-selector@{set\_\-is\_\-mpr\_\-selector}}
\index{set\_\-is\_\-mpr\_\-selector@{set\_\-is\_\-mpr\_\-selector}!Neighbor@{Neighbor}}
\subsubsection[{set\_\-is\_\-mpr\_\-selector}]{\setlength{\rightskip}{0pt plus 5cm}void Neighbor::set\_\-is\_\-mpr\_\-selector (
\begin{DoxyParamCaption}
\item[{bool}]{value, }
\item[{const {\bf TimeVal} \&}]{expiry\_\-time}
\end{DoxyParamCaption}
)}}
\label{classNeighbor_a9901e18e7c7225cca95ac64a8d76bd7c}


Set \hyperlink{protocolthe-p}{the} MPR selector state of this neighbor. 


\begin{DoxyParams}{Parameters}
{\em value} & true if this neighbor selects this OLSR node as an MPR. \\
\hline
{\em expiry\_\-time} & The expiry time for MPR selector status. Ignored if value is false. \\
\hline
\end{DoxyParams}
\hypertarget{classNeighbor_aa06c588e4555037a3f682d444c07040a}{
\index{Neighbor@{Neighbor}!set\_\-reachability@{set\_\-reachability}}
\index{set\_\-reachability@{set\_\-reachability}!Neighbor@{Neighbor}}
\subsubsection[{set\_\-reachability}]{\setlength{\rightskip}{0pt plus 5cm}void Neighbor::set\_\-reachability (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{value}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classNeighbor_aa06c588e4555037a3f682d444c07040a}


\hyperlink{classStore}{Store} \hyperlink{protocolthe-p}{the} reachability of this neighbor. 

Typically called during MPR selection, as reachability can only be computed during MPR selection.


\begin{DoxyParams}{Parameters}
{\em value} & The number of strict, uncovered, two-\/hop neighbors to which this neighbor has a link. \\
\hline
\end{DoxyParams}
\hypertarget{classNeighbor_aa5791ddf246b0b94dba32e525a908bf1}{
\index{Neighbor@{Neighbor}!set\_\-willingness@{set\_\-willingness}}
\index{set\_\-willingness@{set\_\-willingness}!Neighbor@{Neighbor}}
\subsubsection[{set\_\-willingness}]{\setlength{\rightskip}{0pt plus 5cm}void Neighbor::set\_\-willingness (
\begin{DoxyParamCaption}
\item[{{\bf OlsrTypes::WillType}}]{value}
\end{DoxyParamCaption}
)}}
\label{classNeighbor_aa5791ddf246b0b94dba32e525a908bf1}


Set \hyperlink{protocolthe-p}{the} willingness-\/to-\/forward for this neighbor. 

This may trigger a recount of \hyperlink{protocolthe-p}{the} node's MPR status; a node with willingness WILL\_\-NEVER may never be an MPR.


\begin{DoxyParams}{Parameters}
{\em value} & \hyperlink{protocolthe-p}{the} new value for this neighbor's willingness property. \\
\hline
\end{DoxyParams}
\hypertarget{classNeighbor_a3056f79c4a1702966cc835e0bc3da773}{
\index{Neighbor@{Neighbor}!update\_\-cand\_\-mpr@{update\_\-cand\_\-mpr}}
\index{update\_\-cand\_\-mpr@{update\_\-cand\_\-mpr}!Neighbor@{Neighbor}}
\subsubsection[{update\_\-cand\_\-mpr}]{\setlength{\rightskip}{0pt plus 5cm}bool Neighbor::update\_\-cand\_\-mpr (
\begin{DoxyParamCaption}
\item[{bool}]{was\_\-cand\_\-mpr}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classNeighbor_a3056f79c4a1702966cc835e0bc3da773}


Update \hyperlink{protocolthe-p}{the} MPR candidacy of this neighbor. 

Triggered by a one-\/hop or two-\/hop link state change. The \hyperlink{classNeighborhood}{Neighborhood} is notified of \hyperlink{protocolthe-p}{the} change.


\begin{DoxyParams}{Parameters}
{\em was\_\-cand\_\-mpr} & true if \hyperlink{protocolthe-p}{the} node was an MPR candidate before any other criteria changed. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} node is now an MPR candidate. 
\end{DoxyReturn}
\hypertarget{classNeighbor_ab844a392164939d1d63d1cbd94d5399b}{
\index{Neighbor@{Neighbor}!update\_\-link@{update\_\-link}}
\index{update\_\-link@{update\_\-link}!Neighbor@{Neighbor}}
\subsubsection[{update\_\-link}]{\setlength{\rightskip}{0pt plus 5cm}void Neighbor::update\_\-link (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::LogicalLinkID}}]{linkid}
\end{DoxyParamCaption}
)}}
\label{classNeighbor_ab844a392164939d1d63d1cbd94d5399b}


Associate a link tuple with a \hyperlink{classNeighbor}{Neighbor} or update an existing one. 

N\_\-status is updated.


\begin{DoxyParams}{Parameters}
{\em linkid} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} link to associate with this \hyperlink{classNeighbor}{Neighbor}. \\
\hline
\end{DoxyParams}
\hypertarget{classNeighbor_ae77d6a52cd0bcdf84432cb7db18b999f}{
\index{Neighbor@{Neighbor}!willingness@{willingness}}
\index{willingness@{willingness}!Neighbor@{Neighbor}}
\subsubsection[{willingness}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t Neighbor::willingness (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classNeighbor_ae77d6a52cd0bcdf84432cb7db18b999f}


Get \hyperlink{protocolthe-p}{the} willingness-\/to-\/forward for this neighbor. 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} neighbor's willingness. 
\end{DoxyReturn}


\subsection{Member Data Documentation}
\hypertarget{classNeighbor_ae4835aec3f34a5de558092a6f1bb4704}{
\index{Neighbor@{Neighbor}!\_\-is\_\-mpr@{\_\-is\_\-mpr}}
\index{\_\-is\_\-mpr@{\_\-is\_\-mpr}!Neighbor@{Neighbor}}
\subsubsection[{\_\-is\_\-mpr}]{\setlength{\rightskip}{0pt plus 5cm}bool {\bf Neighbor::\_\-is\_\-mpr}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classNeighbor_ae4835aec3f34a5de558092a6f1bb4704}


true if neighbor is an MPR. 

Note: This may be out of sync with \hyperlink{protocolthe-p}{the} actual MPR state; it does not get updated until an MPR selection is performed from \hyperlink{classNeighborhood}{Neighborhood} (\hyperlink{protocolthe-p}{the} computation is not fully distributed). 

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