\hypertarget{classTwoHopLink}{
\section{TwoHopLink Class Reference}
\label{classTwoHopLink}\index{TwoHopLink@{TwoHopLink}}
}


A link between a \hyperlink{classNeighbor}{Neighbor} and a \hyperlink{classTwoHopNeighbor}{TwoHopNeighbor}.  




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

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTwoHopLink_a99c9be3e837a7b62f003064549272bcb}{
{\bfseries TwoHopLink} (\hyperlink{classEventLoop}{EventLoop} \&ev, \hyperlink{classNeighborhood}{Neighborhood} $\ast$parent, \hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} tlid, \hyperlink{classNeighbor}{Neighbor} $\ast$nexthop, const \hyperlink{classTimeVal}{TimeVal} \&vtime)}
\label{classTwoHopLink_a99c9be3e837a7b62f003064549272bcb}

\item 
\hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} \hyperlink{classTwoHopLink_a6b31e7910c60762cd819363118cf770a}{id} () const 
\item 
\hyperlink{classNeighbor}{Neighbor} $\ast$ \hyperlink{classTwoHopLink_a50fb80f23c12554865e099195c031604}{nexthop} () const 
\item 
\hyperlink{classTwoHopNeighbor}{TwoHopNeighbor} $\ast$ \hyperlink{classTwoHopLink_a5e157a5d22ad60a914a9c98d9e678885}{destination} () const 
\item 
void \hyperlink{classTwoHopLink_a5b80b3a4767eb4a05426a88a819f00a4}{set\_\-destination} (\hyperlink{classTwoHopNeighbor}{TwoHopNeighbor} $\ast$destination)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} cached destination pointer. \item\end{DoxyCompactList}\item 
\hyperlink{structOlsrTypes_a0be5017ad053311658089d9a795c63ac}{OlsrTypes::FaceID} \hyperlink{classTwoHopLink_a7155c88d7a68e38d3d736caa8c868428}{face\_\-id} () const 
\item 
double \hyperlink{classTwoHopLink_a99571f9377ac713a4e63289af225c14e}{near\_\-etx} () const 
\item 
double \hyperlink{classTwoHopLink_ab60aebac106fc1e1d0ad57bdfba247e7}{far\_\-etx} () const 
\item 
void \hyperlink{classTwoHopLink_a2ff716006f42150b545613d9efc25403}{set\_\-face\_\-id} (const \hyperlink{structOlsrTypes_a0be5017ad053311658089d9a795c63ac}{OlsrTypes::FaceID} faceid)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} interface where this link was last heard. \item\end{DoxyCompactList}\item 
void \hyperlink{classTwoHopLink_a84acaa4c5c137421bda0731077e45ec7}{set\_\-near\_\-etx} (const double \&near\_\-etx)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} ETX measurement at near end of link. \item\end{DoxyCompactList}\item 
void \hyperlink{classTwoHopLink_a89ee689bc8074f88b9cc2dcbab7ee9a7}{set\_\-far\_\-etx} (const double \&far\_\-etx)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} ETX measurement at far end of link. \item\end{DoxyCompactList}\item 
\hyperlink{classTimeVal}{TimeVal} \hyperlink{classTwoHopLink_abd14daf6d985492836aa79824c4969e8}{time\_\-remaining} () const 
\item 
void \hyperlink{classTwoHopLink_a681795dfd618e3b4879b2f69c82ffe69}{update\_\-timer} (const \hyperlink{classTimeVal}{TimeVal} \&vtime)
\begin{DoxyCompactList}\small\item\em Update this link's expiry timer. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopLink_ad998c0975bec62d1c807b0781f7f7b41}{
void \hyperlink{classTwoHopLink_ad998c0975bec62d1c807b0781f7f7b41}{event\_\-dead} ()}
\label{classTwoHopLink_ad998c0975bec62d1c807b0781f7f7b41}

\begin{DoxyCompactList}\small\item\em Callback method to: tell \hyperlink{protocolthe-p}{the} parent that this two-\/hop link has now expired. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTwoHopLink_ab184ab976d62f071d9edf82b09a8fb27}{
\hyperlink{classEventLoop}{EventLoop} \& {\bfseries \_\-ev}}
\label{classTwoHopLink_ab184ab976d62f071d9edf82b09a8fb27}

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

\item 
\hypertarget{classTwoHopLink_a1125beee8f3db4827902b9f8e08f2c40}{
\hyperlink{structOlsrTypes_a5341e986890944c45a8362cd9d8916e7}{OlsrTypes::TwoHopLinkID} \hyperlink{classTwoHopLink_a1125beee8f3db4827902b9f8e08f2c40}{\_\-id}}
\label{classTwoHopLink_a1125beee8f3db4827902b9f8e08f2c40}

\begin{DoxyCompactList}\small\item\em A unique identifier for this object. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopLink_ad4d15b51cb38312d9c98796d48c0d11b}{
\hyperlink{classNeighbor}{Neighbor} $\ast$ \hyperlink{classTwoHopLink_ad4d15b51cb38312d9c98796d48c0d11b}{\_\-nexthop}}
\label{classTwoHopLink_ad4d15b51cb38312d9c98796d48c0d11b}

\begin{DoxyCompactList}\small\item\em The strict one-\/hop neighbor used to reach \hyperlink{protocolthe-p}{the} two-\/hop neighbor referenced by \_\-far\_\-id. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopLink_a586ea0bd97c801b984ee9e88d226ed1f}{
\hyperlink{classTwoHopNeighbor}{TwoHopNeighbor} $\ast$ \hyperlink{classTwoHopLink_a586ea0bd97c801b984ee9e88d226ed1f}{\_\-destination}}
\label{classTwoHopLink_a586ea0bd97c801b984ee9e88d226ed1f}

\begin{DoxyCompactList}\small\item\em The two-\/hop neighbor at \hyperlink{protocolthe-p}{the} end of this link. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopLink_a9c68f9d03f2fff4b1e9d0219528a3905}{
\hyperlink{structOlsrTypes_a0be5017ad053311658089d9a795c63ac}{OlsrTypes::FaceID} \hyperlink{classTwoHopLink_a9c68f9d03f2fff4b1e9d0219528a3905}{\_\-face\_\-id}}
\label{classTwoHopLink_a9c68f9d03f2fff4b1e9d0219528a3905}

\begin{DoxyCompactList}\small\item\em The ID of \hyperlink{protocolthe-p}{the} interface where \hyperlink{protocolthe-p}{the} advertisement of this link was last heard. \item\end{DoxyCompactList}\item 
\hypertarget{classTwoHopLink_a590e79a99a99ff616474047015df4c6d}{
\hyperlink{classXorpTimer}{XorpTimer} \hyperlink{classTwoHopLink_a590e79a99a99ff616474047015df4c6d}{\_\-expiry\_\-timer}}
\label{classTwoHopLink_a590e79a99a99ff616474047015df4c6d}

\begin{DoxyCompactList}\small\item\em The time at which this two-\/hop link expires. \item\end{DoxyCompactList}\item 
double \hyperlink{classTwoHopLink_a855736f6d27f1f8119254eef9293b45e}{\_\-near\_\-etx}
\begin{DoxyCompactList}\small\item\em The ETX as measured at \hyperlink{protocolthe-p}{the} near end of this link. \item\end{DoxyCompactList}\item 
double \hyperlink{classTwoHopLink_ab90763b9a1d699de91f093841b4fe57a}{\_\-far\_\-etx}
\begin{DoxyCompactList}\small\item\em The ETX as measured at \hyperlink{protocolthe-p}{the} far end of this link. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A link between a \hyperlink{classNeighbor}{Neighbor} and a \hyperlink{classTwoHopNeighbor}{TwoHopNeighbor}. Association class between \hyperlink{classTwoHopNeighbor}{TwoHopNeighbor} and \hyperlink{classNeighbor}{Neighbor}. \hyperlink{classTwoHopNeighbor}{TwoHopNeighbor} cannot exist without \hyperlink{classTwoHopLink}{TwoHopLink}. Like Link and \hyperlink{classNeighbor}{Neighbor}, there is a co-\/dependent relationship. Both \hyperlink{classTwoHopNeighbor}{TwoHopNeighbor} and \hyperlink{classTwoHopLink}{TwoHopLink} cannot exist without \hyperlink{classNeighbor}{Neighbor}.

TwoHopLinks are uniquely identified by \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} two-\/hop neighbor at \hyperlink{protocolthe-p}{the} far end, and \hyperlink{protocolthe-p}{the} \hyperlink{classNeighbor}{Neighbor} at \hyperlink{protocolthe-p}{the} near end. When \hyperlink{protocolthe-p}{the} last \hyperlink{classTwoHopLink}{TwoHopLink} associated with a \hyperlink{classTwoHopNeighbor}{TwoHopNeighbor} is deleted, \hyperlink{protocolthe-p}{the} \hyperlink{classTwoHopNeighbor}{TwoHopNeighbor} MUST be deleted, to conform to \hyperlink{protocolthe-p}{the} relations in \hyperlink{protocolthe-p}{the} RFC. 

\subsection{Member Function Documentation}
\hypertarget{classTwoHopLink_a5e157a5d22ad60a914a9c98d9e678885}{
\index{TwoHopLink@{TwoHopLink}!destination@{destination}}
\index{destination@{destination}!TwoHopLink@{TwoHopLink}}
\subsubsection[{destination}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TwoHopNeighbor}$\ast$ TwoHopLink::destination (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_a5e157a5d22ad60a914a9c98d9e678885}
\begin{DoxyReturn}{Returns}
A pointer to \hyperlink{protocolthe-p}{the} strict two-\/hop neighbor at \hyperlink{protocolthe-p}{the} far end of this link. 
\end{DoxyReturn}
\hypertarget{classTwoHopLink_a7155c88d7a68e38d3d736caa8c868428}{
\index{TwoHopLink@{TwoHopLink}!face\_\-id@{face\_\-id}}
\index{face\_\-id@{face\_\-id}!TwoHopLink@{TwoHopLink}}
\subsubsection[{face\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}{\bf OlsrTypes::FaceID} TwoHopLink::face\_\-id (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_a7155c88d7a68e38d3d736caa8c868428}
\begin{DoxyReturn}{Returns}
The ID of \hyperlink{protocolthe-p}{the} interface where \hyperlink{protocolthe-p}{the} advertisement of this \hyperlink{classTwoHopLink}{TwoHopLink} was last heard by a \hyperlink{classNeighbor}{Neighbor}. 
\end{DoxyReturn}
\hypertarget{classTwoHopLink_ab60aebac106fc1e1d0ad57bdfba247e7}{
\index{TwoHopLink@{TwoHopLink}!far\_\-etx@{far\_\-etx}}
\index{far\_\-etx@{far\_\-etx}!TwoHopLink@{TwoHopLink}}
\subsubsection[{far\_\-etx}]{\setlength{\rightskip}{0pt plus 5cm}double TwoHopLink::far\_\-etx (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_ab60aebac106fc1e1d0ad57bdfba247e7}
\begin{DoxyReturn}{Returns}
ETX measurement at far end of link. 
\end{DoxyReturn}
\hypertarget{classTwoHopLink_a6b31e7910c60762cd819363118cf770a}{
\index{TwoHopLink@{TwoHopLink}!id@{id}}
\index{id@{id}!TwoHopLink@{TwoHopLink}}
\subsubsection[{id}]{\setlength{\rightskip}{0pt plus 5cm}{\bf OlsrTypes::TwoHopLinkID} TwoHopLink::id (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_a6b31e7910c60762cd819363118cf770a}
\begin{DoxyReturn}{Returns}
A unique identifier for this link in \hyperlink{protocolthe-p}{the} two-\/hop neighborhood. 
\end{DoxyReturn}
\hypertarget{classTwoHopLink_a99571f9377ac713a4e63289af225c14e}{
\index{TwoHopLink@{TwoHopLink}!near\_\-etx@{near\_\-etx}}
\index{near\_\-etx@{near\_\-etx}!TwoHopLink@{TwoHopLink}}
\subsubsection[{near\_\-etx}]{\setlength{\rightskip}{0pt plus 5cm}double TwoHopLink::near\_\-etx (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_a99571f9377ac713a4e63289af225c14e}
\begin{DoxyReturn}{Returns}
ETX measurement at near end of link. 
\end{DoxyReturn}
\hypertarget{classTwoHopLink_a50fb80f23c12554865e099195c031604}{
\index{TwoHopLink@{TwoHopLink}!nexthop@{nexthop}}
\index{nexthop@{nexthop}!TwoHopLink@{TwoHopLink}}
\subsubsection[{nexthop}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Neighbor}$\ast$ TwoHopLink::nexthop (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_a50fb80f23c12554865e099195c031604}
\begin{DoxyReturn}{Returns}
A pointer to \hyperlink{protocolthe-p}{the} strict one-\/hop neighbor at \hyperlink{protocolthe-p}{the} near end of this link. 
\end{DoxyReturn}
\hypertarget{classTwoHopLink_a5b80b3a4767eb4a05426a88a819f00a4}{
\index{TwoHopLink@{TwoHopLink}!set\_\-destination@{set\_\-destination}}
\index{set\_\-destination@{set\_\-destination}!TwoHopLink@{TwoHopLink}}
\subsubsection[{set\_\-destination}]{\setlength{\rightskip}{0pt plus 5cm}void TwoHopLink::set\_\-destination (
\begin{DoxyParamCaption}
\item[{{\bf TwoHopNeighbor} $\ast$}]{destination}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_a5b80b3a4767eb4a05426a88a819f00a4}


Set \hyperlink{protocolthe-p}{the} cached destination pointer. 


\begin{DoxyParams}{Parameters}
{\em destination} & \hyperlink{protocolthe-p}{the} \hyperlink{classTwoHopNeighbor}{TwoHopNeighbor} at \hyperlink{protocolthe-p}{the} end of this link. \\
\hline
\end{DoxyParams}
\hypertarget{classTwoHopLink_a2ff716006f42150b545613d9efc25403}{
\index{TwoHopLink@{TwoHopLink}!set\_\-face\_\-id@{set\_\-face\_\-id}}
\index{set\_\-face\_\-id@{set\_\-face\_\-id}!TwoHopLink@{TwoHopLink}}
\subsubsection[{set\_\-face\_\-id}]{\setlength{\rightskip}{0pt plus 5cm}void TwoHopLink::set\_\-face\_\-id (
\begin{DoxyParamCaption}
\item[{const {\bf OlsrTypes::FaceID}}]{faceid}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_a2ff716006f42150b545613d9efc25403}


Set \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} interface where this link was last heard. 


\begin{DoxyParams}{Parameters}
{\em faceid} & \hyperlink{protocolthe-p}{the} ID of \hyperlink{protocolthe-p}{the} interface. \\
\hline
\end{DoxyParams}
\hypertarget{classTwoHopLink_a89ee689bc8074f88b9cc2dcbab7ee9a7}{
\index{TwoHopLink@{TwoHopLink}!set\_\-far\_\-etx@{set\_\-far\_\-etx}}
\index{set\_\-far\_\-etx@{set\_\-far\_\-etx}!TwoHopLink@{TwoHopLink}}
\subsubsection[{set\_\-far\_\-etx}]{\setlength{\rightskip}{0pt plus 5cm}void TwoHopLink::set\_\-far\_\-etx (
\begin{DoxyParamCaption}
\item[{const double \&}]{far\_\-etx}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_a89ee689bc8074f88b9cc2dcbab7ee9a7}


Set \hyperlink{protocolthe-p}{the} ETX measurement at far end of link. 


\begin{DoxyParams}{Parameters}
{\em far\_\-etx} & far end ETX measurement. \\
\hline
\end{DoxyParams}
\hypertarget{classTwoHopLink_a84acaa4c5c137421bda0731077e45ec7}{
\index{TwoHopLink@{TwoHopLink}!set\_\-near\_\-etx@{set\_\-near\_\-etx}}
\index{set\_\-near\_\-etx@{set\_\-near\_\-etx}!TwoHopLink@{TwoHopLink}}
\subsubsection[{set\_\-near\_\-etx}]{\setlength{\rightskip}{0pt plus 5cm}void TwoHopLink::set\_\-near\_\-etx (
\begin{DoxyParamCaption}
\item[{const double \&}]{near\_\-etx}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_a84acaa4c5c137421bda0731077e45ec7}


Set \hyperlink{protocolthe-p}{the} ETX measurement at near end of link. 


\begin{DoxyParams}{Parameters}
{\em near\_\-etx} & near end ETX measurement. \\
\hline
\end{DoxyParams}
\hypertarget{classTwoHopLink_abd14daf6d985492836aa79824c4969e8}{
\index{TwoHopLink@{TwoHopLink}!time\_\-remaining@{time\_\-remaining}}
\index{time\_\-remaining@{time\_\-remaining}!TwoHopLink@{TwoHopLink}}
\subsubsection[{time\_\-remaining}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TimeVal} TwoHopLink::time\_\-remaining (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTwoHopLink_abd14daf6d985492836aa79824c4969e8}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} amount of time remaining until this two-\/hop link expires. 
\end{DoxyReturn}
\hypertarget{classTwoHopLink_a681795dfd618e3b4879b2f69c82ffe69}{
\index{TwoHopLink@{TwoHopLink}!update\_\-timer@{update\_\-timer}}
\index{update\_\-timer@{update\_\-timer}!TwoHopLink@{TwoHopLink}}
\subsubsection[{update\_\-timer}]{\setlength{\rightskip}{0pt plus 5cm}void TwoHopLink::update\_\-timer (
\begin{DoxyParamCaption}
\item[{const {\bf TimeVal} \&}]{vtime}
\end{DoxyParamCaption}
)}}
\label{classTwoHopLink_a681795dfd618e3b4879b2f69c82ffe69}


Update this link's expiry timer. 


\begin{DoxyParams}{Parameters}
{\em vtime} & \hyperlink{protocolthe-p}{the} amount of time from now til when \hyperlink{protocolthe-p}{the} link expires. \\
\hline
\end{DoxyParams}


\subsection{Member Data Documentation}
\hypertarget{classTwoHopLink_ab90763b9a1d699de91f093841b4fe57a}{
\index{TwoHopLink@{TwoHopLink}!\_\-far\_\-etx@{\_\-far\_\-etx}}
\index{\_\-far\_\-etx@{\_\-far\_\-etx}!TwoHopLink@{TwoHopLink}}
\subsubsection[{\_\-far\_\-etx}]{\setlength{\rightskip}{0pt plus 5cm}double {\bf TwoHopLink::\_\-far\_\-etx}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classTwoHopLink_ab90763b9a1d699de91f093841b4fe57a}


The ETX as measured at \hyperlink{protocolthe-p}{the} far end of this link. 

Optional. \hypertarget{classTwoHopLink_a855736f6d27f1f8119254eef9293b45e}{
\index{TwoHopLink@{TwoHopLink}!\_\-near\_\-etx@{\_\-near\_\-etx}}
\index{\_\-near\_\-etx@{\_\-near\_\-etx}!TwoHopLink@{TwoHopLink}}
\subsubsection[{\_\-near\_\-etx}]{\setlength{\rightskip}{0pt plus 5cm}double {\bf TwoHopLink::\_\-near\_\-etx}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classTwoHopLink_a855736f6d27f1f8119254eef9293b45e}


The ETX as measured at \hyperlink{protocolthe-p}{the} near end of this link. 

Optional. 

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}
