\hypertarget{classTwoHopNeighbor}{
\section{TwoHopNeighbor Class Reference}
\label{classTwoHopNeighbor}\index{TwoHopNeighbor@{TwoHopNeighbor}}
}


A two-\/hop neighbor.  




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

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTwoHopNeighbor_aed56d96ba420941ebfb2e743fb34a47f}{
{\bfseries TwoHopNeighbor} (\hyperlink{classEventLoop}{EventLoop} \&ev, \hyperlink{classNeighborhood}{Neighborhood} $\ast$parent, const \hyperlink{structOlsrTypes_af87f2dd463b624b5e0cb89d476ff5485}{OlsrTypes::TwoHopNodeID} id, const \hyperlink{classIPv4}{IPv4} \&main\_\-addr, const \hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} tlid)}
\label{classTwoHopNeighbor_aed56d96ba420941ebfb2e743fb34a47f}

\item 
\hypertarget{classTwoHopNeighbor_af9c4e2983dda806e5eeca46e97793e41}{
\hyperlink{structOlsrTypes_af87f2dd463b624b5e0cb89d476ff5485}{OlsrTypes::TwoHopNodeID} {\bfseries id} () const }
\label{classTwoHopNeighbor_af9c4e2983dda806e5eeca46e97793e41}

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

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

\item 
void \hyperlink{classTwoHopNeighbor_a3b89759d87d72c060c2c73834f1df87f}{add\_\-twohop\_\-link} (const \hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} tlid)
\begin{DoxyCompactList}\small\item\em Associate this N2 with an N1, using an instance of \hyperlink{protocolthe-p}{the} association class \hyperlink{classTwoHopLink}{TwoHopLink}. \item\end{DoxyCompactList}\item 
bool \hyperlink{classTwoHopNeighbor_a5cec85ff5b63d5e16ec8f2edb530ceea}{delete\_\-twohop\_\-link} (const \hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} tlid)
\begin{DoxyCompactList}\small\item\em Delete \hyperlink{protocolthe-p}{the} given N1 from \hyperlink{protocolthe-p}{the} set of Neighbors which may be used to reach this N2. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopNeighbor_aef93f1976e2f11fd24d63fda8e25832d}{
size\_\-t {\bfseries delete\_\-all\_\-twohop\_\-links} ()}
\label{classTwoHopNeighbor_aef93f1976e2f11fd24d63fda8e25832d}

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

\item 
void \hyperlink{classTwoHopNeighbor_a382e1e88347f8b66c6ee4a553e6ec8d1}{add\_\-covering\_\-mpr} (const \hyperlink{structOlsrTypes_a246952255e8728960d15898f8f96e017}{OlsrTypes::NeighborID} nid)
\begin{DoxyCompactList}\small\item\em Add \hyperlink{protocolthe-p}{the} given neighbor as an MPR which covers this node. \item\end{DoxyCompactList}\item 
void \hyperlink{classTwoHopNeighbor_abe2cb27f161693751d98df6854da0b0c}{withdraw\_\-covering\_\-mpr} (const \hyperlink{structOlsrTypes_a246952255e8728960d15898f8f96e017}{OlsrTypes::NeighborID} nid)
\begin{DoxyCompactList}\small\item\em Withdraw \hyperlink{protocolthe-p}{the} given neighbor as an MPR which covers this node. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopNeighbor_a8e7375f921af03d513d69683a8534093}{
void \hyperlink{classTwoHopNeighbor_a8e7375f921af03d513d69683a8534093}{reset\_\-covering\_\-mprs} ()}
\label{classTwoHopNeighbor_a8e7375f921af03d513d69683a8534093}

\begin{DoxyCompactList}\small\item\em Reset \hyperlink{protocolthe-p}{the} MPR coverage state for this N2 node. \item\end{DoxyCompactList}\item 
uint32\_\-t \hyperlink{classTwoHopNeighbor_a95d3784a8df396ae6f2df032510851b6}{coverage} () const 
\item 
bool \hyperlink{classTwoHopNeighbor_ae1cb7a65a0792f71e0efe2f8f87474b3}{is\_\-covered} () const 
\item 
uint32\_\-t \hyperlink{classTwoHopNeighbor_a74c95e73c5003e78d0bfa2bf8e6806b7}{reachability} () const 
\item 
\hypertarget{classTwoHopNeighbor_a2532eccdee1c2d44cfd33b7f0826e648}{
void \hyperlink{classTwoHopNeighbor_a2532eccdee1c2d44cfd33b7f0826e648}{set\_\-reachability} (uint32\_\-t value)}
\label{classTwoHopNeighbor_a2532eccdee1c2d44cfd33b7f0826e648}

\begin{DoxyCompactList}\small\item\em Set this N2's reachability. \item\end{DoxyCompactList}\item 
bool \hyperlink{classTwoHopNeighbor_a13b9bfa01cb9a2f5576f259f9c3379e1}{is\_\-reachable} () const 
\item 
bool \hyperlink{classTwoHopNeighbor_a6d50e1c43722a90fb6b47e411ea5ca3e}{is\_\-strict} () const 
\item 
void \hyperlink{classTwoHopNeighbor_a1dfc70916f950868295a4f2c830395b0}{set\_\-is\_\-strict} (bool is\_\-strict)
\begin{DoxyCompactList}\small\item\em Set if this N2 is a strict two-\/hop neighbor. \item\end{DoxyCompactList}\item 
const set$<$ \hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} $>$ \& \hyperlink{classTwoHopNeighbor_a773553bd51e41cc6e3d8723a1dce7da6}{twohop\_\-links} ()
\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTwoHopNeighbor_ad50d062299993c3d819b1960a3ff19d4}{
\hyperlink{classEventLoop}{EventLoop} \& {\bfseries \_\-ev}}
\label{classTwoHopNeighbor_ad50d062299993c3d819b1960a3ff19d4}

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

\item 
\hypertarget{classTwoHopNeighbor_a9baf0bfdf7095cca82a06b4d62567051}{
\hyperlink{structOlsrTypes_af87f2dd463b624b5e0cb89d476ff5485}{OlsrTypes::TwoHopNodeID} \hyperlink{classTwoHopNeighbor_a9baf0bfdf7095cca82a06b4d62567051}{\_\-id}}
\label{classTwoHopNeighbor_a9baf0bfdf7095cca82a06b4d62567051}

\begin{DoxyCompactList}\small\item\em Unique ID of this N2 node. \item\end{DoxyCompactList}\item 
\hyperlink{classIPv4}{IPv4} \hyperlink{classTwoHopNeighbor_a1658583f536e6228d80052828888fe08}{\_\-main\_\-addr}
\begin{DoxyCompactList}\small\item\em N\_\-2hop\_\-addr protocol variable. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopNeighbor_a7f7f639831f30d4ef744415437ddd350}{
bool \hyperlink{classTwoHopNeighbor_a7f7f639831f30d4ef744415437ddd350}{\_\-is\_\-strict}}
\label{classTwoHopNeighbor_a7f7f639831f30d4ef744415437ddd350}

\begin{DoxyCompactList}\small\item\em true if this N2 is NOT also an N1 node. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopNeighbor_a7aece101a4cbd391bd3b0cf9e319b798}{
uint32\_\-t \hyperlink{classTwoHopNeighbor_a7aece101a4cbd391bd3b0cf9e319b798}{\_\-coverage}}
\label{classTwoHopNeighbor_a7aece101a4cbd391bd3b0cf9e319b798}

\begin{DoxyCompactList}\small\item\em The number of strict N1 which can reach this strict N2, and which have been selected as MPRs by \hyperlink{protocolthe-p}{the} \hyperlink{classNeighborhood}{Neighborhood}. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopNeighbor_a7da633c5b1550adf9f226d889a6873b8}{
uint32\_\-t \hyperlink{classTwoHopNeighbor_a7da633c5b1550adf9f226d889a6873b8}{\_\-reachability}}
\label{classTwoHopNeighbor_a7da633c5b1550adf9f226d889a6873b8}

\begin{DoxyCompactList}\small\item\em The number of strict N1 which can reach this strict N2. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopNeighbor_a6ad08260dab000b022cbb653ffa9c93f}{
set$<$ \hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} $>$ \hyperlink{classTwoHopNeighbor_a6ad08260dab000b022cbb653ffa9c93f}{\_\-twohop\_\-links}}
\label{classTwoHopNeighbor_a6ad08260dab000b022cbb653ffa9c93f}

\begin{DoxyCompactList}\small\item\em \hyperlink{classLinks}{Links} by which this two-\/hop neighbor is reachable. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A two-\/hop neighbor. When \hyperlink{protocolthe-p}{the} last link expires, \hyperlink{protocolthe-p}{the} entire instance expires. 

\subsection{Member Function Documentation}
\hypertarget{classTwoHopNeighbor_a382e1e88347f8b66c6ee4a553e6ec8d1}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!add\_\-covering\_\-mpr@{add\_\-covering\_\-mpr}}
\index{add\_\-covering\_\-mpr@{add\_\-covering\_\-mpr}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{add\_\-covering\_\-mpr}]{\setlength{\rightskip}{0pt plus 5cm}void TwoHopNeighbor::add\_\-covering\_\-mpr (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::NeighborID}}]{nid}
\end{DoxyParamCaption}
)}}
\label{classTwoHopNeighbor_a382e1e88347f8b66c6ee4a553e6ec8d1}


Add \hyperlink{protocolthe-p}{the} given neighbor as an MPR which covers this node. 


\begin{DoxyParams}{Parameters}
{\em nid} & \hyperlink{protocolthe-p}{the} N to count as one of this N2's covering nodes. \\
\hline
\end{DoxyParams}
\hypertarget{classTwoHopNeighbor_a3b89759d87d72c060c2c73834f1df87f}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!add\_\-twohop\_\-link@{add\_\-twohop\_\-link}}
\index{add\_\-twohop\_\-link@{add\_\-twohop\_\-link}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{add\_\-twohop\_\-link}]{\setlength{\rightskip}{0pt plus 5cm}void TwoHopNeighbor::add\_\-twohop\_\-link (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::TwoHopLinkID}}]{tlid}
\end{DoxyParamCaption}
)}}
\label{classTwoHopNeighbor_a3b89759d87d72c060c2c73834f1df87f}


Associate this N2 with an N1, using an instance of \hyperlink{protocolthe-p}{the} association class \hyperlink{classTwoHopLink}{TwoHopLink}. 


\begin{DoxyParams}{Parameters}
{\em tlid} & \hyperlink{protocolthe-p}{the} ID of a two-\/hop link. \\
\hline
\end{DoxyParams}
\hypertarget{classTwoHopNeighbor_a95d3784a8df396ae6f2df032510851b6}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!coverage@{coverage}}
\index{coverage@{coverage}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{coverage}]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t TwoHopNeighbor::coverage (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopNeighbor_a95d3784a8df396ae6f2df032510851b6}
\begin{DoxyReturn}{Returns}
The number of MPRs which cover this node. 
\end{DoxyReturn}
\hypertarget{classTwoHopNeighbor_a5cec85ff5b63d5e16ec8f2edb530ceea}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!delete\_\-twohop\_\-link@{delete\_\-twohop\_\-link}}
\index{delete\_\-twohop\_\-link@{delete\_\-twohop\_\-link}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{delete\_\-twohop\_\-link}]{\setlength{\rightskip}{0pt plus 5cm}bool TwoHopNeighbor::delete\_\-twohop\_\-link (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::TwoHopLinkID}}]{tlid}
\end{DoxyParamCaption}
)}}
\label{classTwoHopNeighbor_a5cec85ff5b63d5e16ec8f2edb530ceea}


Delete \hyperlink{protocolthe-p}{the} given N1 from \hyperlink{protocolthe-p}{the} set of Neighbors which may be used to reach this N2. 


\begin{DoxyParams}{Parameters}
{\em tlid} & \hyperlink{protocolthe-p}{the} ID of a two-\/hop link. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} last link to \hyperlink{protocolthe-p}{the} \hyperlink{classTwoHopNeighbor}{TwoHopNeighbor} was removed. 
\end{DoxyReturn}
\hypertarget{classTwoHopNeighbor_ae1cb7a65a0792f71e0efe2f8f87474b3}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!is\_\-covered@{is\_\-covered}}
\index{is\_\-covered@{is\_\-covered}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{is\_\-covered}]{\setlength{\rightskip}{0pt plus 5cm}bool TwoHopNeighbor::is\_\-covered (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopNeighbor_ae1cb7a65a0792f71e0efe2f8f87474b3}
\begin{DoxyReturn}{Returns}
true if this N2 is covered by at least N1. 
\end{DoxyReturn}
\hypertarget{classTwoHopNeighbor_a13b9bfa01cb9a2f5576f259f9c3379e1}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!is\_\-reachable@{is\_\-reachable}}
\index{is\_\-reachable@{is\_\-reachable}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{is\_\-reachable}]{\setlength{\rightskip}{0pt plus 5cm}bool TwoHopNeighbor::is\_\-reachable (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopNeighbor_a13b9bfa01cb9a2f5576f259f9c3379e1}
\begin{DoxyReturn}{Returns}
true if this N2 is reachable. 
\end{DoxyReturn}
\hypertarget{classTwoHopNeighbor_a6d50e1c43722a90fb6b47e411ea5ca3e}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!is\_\-strict@{is\_\-strict}}
\index{is\_\-strict@{is\_\-strict}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{is\_\-strict}]{\setlength{\rightskip}{0pt plus 5cm}bool TwoHopNeighbor::is\_\-strict (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopNeighbor_a6d50e1c43722a90fb6b47e411ea5ca3e}
\begin{DoxyReturn}{Returns}
true if this N2 is strict.
\end{DoxyReturn}
An N2 is strict if it appears only in \hyperlink{protocolthe-p}{the} two-\/hop neighborhood, and not in \hyperlink{protocolthe-p}{the} one-\/hop neighborhood. \hypertarget{classTwoHopNeighbor_a74c95e73c5003e78d0bfa2bf8e6806b7}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!reachability@{reachability}}
\index{reachability@{reachability}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{reachability}]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t TwoHopNeighbor::reachability (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopNeighbor_a74c95e73c5003e78d0bfa2bf8e6806b7}
\begin{DoxyReturn}{Returns}
The number of MPR candidates which cover this node. This is not computed here but by \hyperlink{classNeighborhood}{Neighborhood}, \hyperlink{protocolthe-p}{the} parent. Note: This is NOT \hyperlink{protocolthe-p}{the} same as a neighbor's reachability. 
\end{DoxyReturn}
\hypertarget{classTwoHopNeighbor_a1dfc70916f950868295a4f2c830395b0}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!set\_\-is\_\-strict@{set\_\-is\_\-strict}}
\index{set\_\-is\_\-strict@{set\_\-is\_\-strict}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{set\_\-is\_\-strict}]{\setlength{\rightskip}{0pt plus 5cm}void TwoHopNeighbor::set\_\-is\_\-strict (
\begin{DoxyParamCaption}
\item[{bool}]{is\_\-strict}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopNeighbor_a1dfc70916f950868295a4f2c830395b0}


Set if this N2 is a strict two-\/hop neighbor. 


\begin{DoxyParams}{Parameters}
{\em is\_\-strict} & true if this N2 does NOT also appear as an N1. \\
\hline
\end{DoxyParams}
\hypertarget{classTwoHopNeighbor_a773553bd51e41cc6e3d8723a1dce7da6}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!twohop\_\-links@{twohop\_\-links}}
\index{twohop\_\-links@{twohop\_\-links}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{twohop\_\-links}]{\setlength{\rightskip}{0pt plus 5cm}const set$<${\bf OlsrTypes::TwoHopLinkID}$>$\& TwoHopNeighbor::twohop\_\-links (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopNeighbor_a773553bd51e41cc6e3d8723a1dce7da6}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} set of two-\/hop links pointing to this N2 node. 
\end{DoxyReturn}
\hypertarget{classTwoHopNeighbor_abe2cb27f161693751d98df6854da0b0c}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!withdraw\_\-covering\_\-mpr@{withdraw\_\-covering\_\-mpr}}
\index{withdraw\_\-covering\_\-mpr@{withdraw\_\-covering\_\-mpr}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{withdraw\_\-covering\_\-mpr}]{\setlength{\rightskip}{0pt plus 5cm}void TwoHopNeighbor::withdraw\_\-covering\_\-mpr (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::NeighborID}}]{nid}
\end{DoxyParamCaption}
)}}
\label{classTwoHopNeighbor_abe2cb27f161693751d98df6854da0b0c}


Withdraw \hyperlink{protocolthe-p}{the} given neighbor as an MPR which covers this node. 


\begin{DoxyParams}{Parameters}
{\em nid} & \hyperlink{protocolthe-p}{the} N to count as one of this N2's covering nodes. \\
\hline
\end{DoxyParams}


\subsection{Member Data Documentation}
\hypertarget{classTwoHopNeighbor_a1658583f536e6228d80052828888fe08}{
\index{TwoHopNeighbor@{TwoHopNeighbor}!\_\-main\_\-addr@{\_\-main\_\-addr}}
\index{\_\-main\_\-addr@{\_\-main\_\-addr}!TwoHopNeighbor@{TwoHopNeighbor}}
\subsubsection[{\_\-main\_\-addr}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IPv4} {\bf TwoHopNeighbor::\_\-main\_\-addr}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classTwoHopNeighbor_a1658583f536e6228d80052828888fe08}


N\_\-2hop\_\-addr protocol variable. 

Main protocol address of this N2 node. 

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