\hypertarget{classXrlPort}{
\section{XrlPort Class Reference}
\label{classXrlPort}\index{XrlPort@{XrlPort}}
}


Helper class which encapsulates XRL socket service.  




{\ttfamily \#include $<$xrl\_\-port.hh$>$}

Inheritance diagram for XrlPort:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classXrlPort}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classXrlPort_a23f373592f4871705e27ee74db474eee}{XrlPort} (\hyperlink{classIO}{IO} $\ast$io, \hyperlink{classEventLoop}{EventLoop} \&eventloop, \hyperlink{classXrlRouter}{XrlRouter} \&xrl\_\-router, const string \&ssname, const string \&ifname, const string \&vifname, const \hyperlink{classIPv4}{IPv4} \&local\_\-addr, const uint16\_\-t local\_\-port, const \hyperlink{classIPv4}{IPv4} \&all\_\-nodes\_\-addr)
\begin{DoxyCompactList}\small\item\em Begin creation of \hyperlink{protocolthe-p}{the} broadcast/multicast socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classXrlPort_a54dd8c5e15759f0e02c372f4440795e7}{startup} ()
\begin{DoxyCompactList}\small\item\em Start \hyperlink{protocolthe-p}{the} port binding. \item\end{DoxyCompactList}\item 
int \hyperlink{classXrlPort_a61417d22f531ffbe363f673b41faee6c}{shutdown} ()
\begin{DoxyCompactList}\small\item\em \hyperlink{classShutdown}{Shutdown} \hyperlink{protocolthe-p}{the} port binding. \item\end{DoxyCompactList}\item 
bool \hyperlink{classXrlPort_a7a448bac8aee9963e9b0181d1462ce81}{send\_\-to} (const \hyperlink{classIPv4}{IPv4} \&dst\_\-addr, const uint16\_\-t dst\_\-port, const vector$<$ uint8\_\-t $>$ \&payload)
\begin{DoxyCompactList}\small\item\em \hyperlink{structSend}{Send} packet. \item\end{DoxyCompactList}\item 
string \hyperlink{classXrlPort_a2cfb023f5366b7df340de3a2e0b17d8b}{socket\_\-server} () const 
\item 
string \hyperlink{classXrlPort_a01c9be4ef02a6ec1560eb5a9f8881203}{ifname} () const 
\item 
string \hyperlink{classXrlPort_a80baaddbd171a99adb38dd0823924d55}{vifname} () const 
\item 
\hyperlink{classIPv4}{IPv4} \hyperlink{classXrlPort_a04d0340e80f4ef89159c349e4e1e1d6a}{local\_\-address} () const 
\item 
uint16\_\-t \hyperlink{classXrlPort_abf2c306e955cf73a5ed1a85562f4ad7e}{local\_\-port} () const 
\item 
string \hyperlink{classXrlPort_a85b7a6c589382dd26a50423238340e74}{sockid} () const 
\item 
\hyperlink{classIPv4}{IPv4} \hyperlink{classXrlPort_a67d7b17c6fe8dc40d88279d723c8c663}{all\_\-nodes\_\-address} () const 
\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classXrlPort_a002a2317e0c83b14bc1eeba126a3f15e}{
bool {\bfseries startup\_\-socket} ()}
\label{classXrlPort_a002a2317e0c83b14bc1eeba126a3f15e}

\item 
\hypertarget{classXrlPort_a6fbac6c8fce0b809ca6d2ef5b68732a1}{
bool {\bfseries request\_\-udp\_\-open\_\-bind\_\-broadcast} ()}
\label{classXrlPort_a6fbac6c8fce0b809ca6d2ef5b68732a1}

\item 
\hypertarget{classXrlPort_a75925223cd90b04028cb5f444749985d}{
void {\bfseries udp\_\-open\_\-bind\_\-broadcast\_\-cb} (const \hyperlink{classXrlError}{XrlError} \&e, const string $\ast$psid)}
\label{classXrlPort_a75925223cd90b04028cb5f444749985d}

\item 
\hypertarget{classXrlPort_aa7dc074618e49322915e207e62563d20}{
bool {\bfseries request\_\-tos} ()}
\label{classXrlPort_aa7dc074618e49322915e207e62563d20}

\item 
\hypertarget{classXrlPort_af841e4a59dbffde0d6521f1333d3b9c5}{
void {\bfseries tos\_\-cb} (const \hyperlink{classXrlError}{XrlError} \&xrl\_\-error)}
\label{classXrlPort_af841e4a59dbffde0d6521f1333d3b9c5}

\item 
\hypertarget{classXrlPort_a545ecb31074ed5a81d7e8233d9ec093f}{
void {\bfseries socket\_\-setup\_\-complete} ()}
\label{classXrlPort_a545ecb31074ed5a81d7e8233d9ec093f}

\item 
\hypertarget{classXrlPort_ada78815255db543e1728cf3bac216110}{
bool {\bfseries request\_\-reuseport} ()}
\label{classXrlPort_ada78815255db543e1728cf3bac216110}

\item 
\hypertarget{classXrlPort_a4db26a9f8a633cbaed9946e067047a14}{
void {\bfseries reuseport\_\-cb} (const \hyperlink{classXrlError}{XrlError} \&e)}
\label{classXrlPort_a4db26a9f8a633cbaed9946e067047a14}

\item 
\hypertarget{classXrlPort_a7ff01fade7d8ccc3048cfe80096b8d3a}{
bool {\bfseries request\_\-onesbcast} (const bool enabled)}
\label{classXrlPort_a7ff01fade7d8ccc3048cfe80096b8d3a}

\item 
\hypertarget{classXrlPort_a6983484952cbb6b92da7749f081fdb94}{
void {\bfseries onesbcast\_\-cb} (const \hyperlink{classXrlError}{XrlError} \&e)}
\label{classXrlPort_a6983484952cbb6b92da7749f081fdb94}

\item 
\hypertarget{classXrlPort_a708eeb356a875468b9781ed4c771a2e4}{
bool {\bfseries request\_\-close} ()}
\label{classXrlPort_a708eeb356a875468b9781ed4c771a2e4}

\item 
\hypertarget{classXrlPort_a2bf7f91189aad1ed13fe140e020babb0}{
void {\bfseries close\_\-cb} (const \hyperlink{classXrlError}{XrlError} \&xrl\_\-error)}
\label{classXrlPort_a2bf7f91189aad1ed13fe140e020babb0}

\item 
\hypertarget{classXrlPort_a030599fc0bf29e5a3c5ac1aaa16f1448}{
void {\bfseries send\_\-cb} (const \hyperlink{classXrlError}{XrlError} \&xrl\_\-error)}
\label{classXrlPort_a030599fc0bf29e5a3c5ac1aaa16f1448}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classXrlPort_a6a7f6243d7d4d5f50bf839fd1aabcc8d}{
\hyperlink{classIO}{IO} $\ast$ {\bfseries \_\-io}}
\label{classXrlPort_a6a7f6243d7d4d5f50bf839fd1aabcc8d}

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

\item 
\hypertarget{classXrlPort_aeb71b2f371a38c8c6b02095b72040d90}{
\hyperlink{classXrlRouter}{XrlRouter} \& {\bfseries \_\-xrl\_\-router}}
\label{classXrlPort_aeb71b2f371a38c8c6b02095b72040d90}

\item 
\hypertarget{classXrlPort_a6f3f05db829f5a91a3739697a0efd231}{
string {\bfseries \_\-ss}}
\label{classXrlPort_a6f3f05db829f5a91a3739697a0efd231}

\item 
\hypertarget{classXrlPort_a72663aeeac10387b287ad9f8c860ed15}{
string {\bfseries \_\-ifname}}
\label{classXrlPort_a72663aeeac10387b287ad9f8c860ed15}

\item 
\hypertarget{classXrlPort_a91fe42deea5caa9e00309d3f1e94421d}{
string {\bfseries \_\-vifname}}
\label{classXrlPort_a91fe42deea5caa9e00309d3f1e94421d}

\item 
\hypertarget{classXrlPort_a36837881163f901037c7396e2dcc1cc2}{
\hyperlink{classIPv4}{IPv4} {\bfseries \_\-local\_\-addr}}
\label{classXrlPort_a36837881163f901037c7396e2dcc1cc2}

\item 
\hypertarget{classXrlPort_a8eca67c4a17ca7860fd42d6132e3224a}{
uint16\_\-t {\bfseries \_\-local\_\-port}}
\label{classXrlPort_a8eca67c4a17ca7860fd42d6132e3224a}

\item 
\hypertarget{classXrlPort_aa01977a2ceb0a284b6523b58bd0f1a7a}{
\hyperlink{classIPv4}{IPv4} {\bfseries \_\-all\_\-nodes\_\-addr}}
\label{classXrlPort_aa01977a2ceb0a284b6523b58bd0f1a7a}

\item 
\hypertarget{classXrlPort_aa0743094de26ff6f95be2abf2a67a7e0}{
bool {\bfseries \_\-pending}}
\label{classXrlPort_aa0743094de26ff6f95be2abf2a67a7e0}

\item 
\hypertarget{classXrlPort_a5273afd75ece3cf92a5a0ebde3fb2a82}{
string {\bfseries \_\-sockid}}
\label{classXrlPort_a5273afd75ece3cf92a5a0ebde3fb2a82}

\item 
\hypertarget{classXrlPort_a774234b0be9443ce4b1df01664801898}{
bool {\bfseries \_\-is\_\-undirected\_\-broadcast}}
\label{classXrlPort_a774234b0be9443ce4b1df01664801898}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Helper class which encapsulates XRL socket service. Deals with setting \hyperlink{protocolthe-p}{the} specific XRL socket options that OLSR needs to send/receive broadcast/multicast control traffic to \hyperlink{protocolthe-p}{the} all-\/nodes address. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classXrlPort_a23f373592f4871705e27ee74db474eee}{
\index{XrlPort@{XrlPort}!XrlPort@{XrlPort}}
\index{XrlPort@{XrlPort}!XrlPort@{XrlPort}}
\subsubsection[{XrlPort}]{\setlength{\rightskip}{0pt plus 5cm}XrlPort::XrlPort (
\begin{DoxyParamCaption}
\item[{{\bf IO} $\ast$}]{io, }
\item[{{\bf EventLoop} \&}]{eventloop, }
\item[{{\bf XrlRouter} \&}]{xrl\_\-router, }
\item[{const string \&}]{ssname, }
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{const {\bf IPv4} \&}]{local\_\-addr, }
\item[{const uint16\_\-t}]{local\_\-port, }
\item[{const {\bf IPv4} \&}]{all\_\-nodes\_\-addr}
\end{DoxyParamCaption}
)}}
\label{classXrlPort_a23f373592f4871705e27ee74db474eee}


Begin creation of \hyperlink{protocolthe-p}{the} broadcast/multicast socket. 


\begin{DoxyParams}{Parameters}
{\em io} & pointer to parent object \\
\hline
{\em eventloop} & process-\/wide event loop \\
\hline
{\em xrl\_\-router} & process-\/wide XRL router \\
\hline
{\em ssname} & name of XRL target containing socket server; usually this is \hyperlink{protocolthe-p}{the} FEA. \\
\hline
{\em ifname} & interface to listen on \\
\hline
{\em vifname} & vif to listen on \\
\hline
{\em local\_\-addr} & address to listen on \\
\hline
{\em local\_\-port} & port to listen on \\
\hline
{\em all\_\-nodes\_\-addr} & address to send to \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classXrlPort_a67d7b17c6fe8dc40d88279d723c8c663}{
\index{XrlPort@{XrlPort}!all\_\-nodes\_\-address@{all\_\-nodes\_\-address}}
\index{all\_\-nodes\_\-address@{all\_\-nodes\_\-address}!XrlPort@{XrlPort}}
\subsubsection[{all\_\-nodes\_\-address}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IPv4} XrlPort::all\_\-nodes\_\-address (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classXrlPort_a67d7b17c6fe8dc40d88279d723c8c663}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} address to which this socket transmits. 
\end{DoxyReturn}
\hypertarget{classXrlPort_a01c9be4ef02a6ec1560eb5a9f8881203}{
\index{XrlPort@{XrlPort}!ifname@{ifname}}
\index{ifname@{ifname}!XrlPort@{XrlPort}}
\subsubsection[{ifname}]{\setlength{\rightskip}{0pt plus 5cm}string XrlPort::ifname (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classXrlPort_a01c9be4ef02a6ec1560eb5a9f8881203}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} name of \hyperlink{protocolthe-p}{the} interface to which this socket is bound. 
\end{DoxyReturn}
\hypertarget{classXrlPort_a04d0340e80f4ef89159c349e4e1e1d6a}{
\index{XrlPort@{XrlPort}!local\_\-address@{local\_\-address}}
\index{local\_\-address@{local\_\-address}!XrlPort@{XrlPort}}
\subsubsection[{local\_\-address}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IPv4} XrlPort::local\_\-address (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classXrlPort_a04d0340e80f4ef89159c349e4e1e1d6a}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} address to which this socket is bound. 
\end{DoxyReturn}
\hypertarget{classXrlPort_abf2c306e955cf73a5ed1a85562f4ad7e}{
\index{XrlPort@{XrlPort}!local\_\-port@{local\_\-port}}
\index{local\_\-port@{local\_\-port}!XrlPort@{XrlPort}}
\subsubsection[{local\_\-port}]{\setlength{\rightskip}{0pt plus 5cm}uint16\_\-t XrlPort::local\_\-port (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classXrlPort_abf2c306e955cf73a5ed1a85562f4ad7e}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} port to which this socket is bound. 
\end{DoxyReturn}
\hypertarget{classXrlPort_a7a448bac8aee9963e9b0181d1462ce81}{
\index{XrlPort@{XrlPort}!send\_\-to@{send\_\-to}}
\index{send\_\-to@{send\_\-to}!XrlPort@{XrlPort}}
\subsubsection[{send\_\-to}]{\setlength{\rightskip}{0pt plus 5cm}bool XrlPort::send\_\-to (
\begin{DoxyParamCaption}
\item[{const {\bf IPv4} \&}]{dst\_\-addr, }
\item[{const uint16\_\-t}]{dst\_\-port, }
\item[{const vector$<$ uint8\_\-t $>$ \&}]{payload}
\end{DoxyParamCaption}
)}}
\label{classXrlPort_a7a448bac8aee9963e9b0181d1462ce81}


\hyperlink{structSend}{Send} packet. 

Status of instance must be running, and should not be pending.


\begin{DoxyParams}{Parameters}
{\em dst\_\-addr} & address to send packet. \\
\hline
{\em dst\_\-port} & port to send packet to. \\
\hline
{\em payload} & vector containing paylaod of packet to be sent.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false on immediately detectable failure, true otherwise. 
\end{DoxyReturn}
\hypertarget{classXrlPort_a61417d22f531ffbe363f673b41faee6c}{
\index{XrlPort@{XrlPort}!shutdown@{shutdown}}
\index{shutdown@{shutdown}!XrlPort@{XrlPort}}
\subsubsection[{shutdown}]{\setlength{\rightskip}{0pt plus 5cm}int XrlPort::shutdown (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classXrlPort_a61417d22f531ffbe363f673b41faee6c}


\hyperlink{classShutdown}{Shutdown} \hyperlink{protocolthe-p}{the} port binding. 

Sends request to close socket and transitions into SERVICE\_\-SHUTTING\_\-DOWN state. When socket is closed transition to SERVICE\_\-SHUTDOWN occurs.

\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classServiceBase_a6ad34506fd5a446d5667abcb2e1b593b}{ServiceBase}.

\hypertarget{classXrlPort_a2cfb023f5366b7df340de3a2e0b17d8b}{
\index{XrlPort@{XrlPort}!socket\_\-server@{socket\_\-server}}
\index{socket\_\-server@{socket\_\-server}!XrlPort@{XrlPort}}
\subsubsection[{socket\_\-server}]{\setlength{\rightskip}{0pt plus 5cm}string XrlPort::socket\_\-server (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classXrlPort_a2cfb023f5366b7df340de3a2e0b17d8b}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} name of \hyperlink{protocolthe-p}{the} socket server in use. 
\end{DoxyReturn}
\hypertarget{classXrlPort_a85b7a6c589382dd26a50423238340e74}{
\index{XrlPort@{XrlPort}!sockid@{sockid}}
\index{sockid@{sockid}!XrlPort@{XrlPort}}
\subsubsection[{sockid}]{\setlength{\rightskip}{0pt plus 5cm}string XrlPort::sockid (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classXrlPort_a85b7a6c589382dd26a50423238340e74}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} socket server's socket identifier, if service status is RUNNING; otherwise undefined. 
\end{DoxyReturn}
\hypertarget{classXrlPort_a54dd8c5e15759f0e02c372f4440795e7}{
\index{XrlPort@{XrlPort}!startup@{startup}}
\index{startup@{startup}!XrlPort@{XrlPort}}
\subsubsection[{startup}]{\setlength{\rightskip}{0pt plus 5cm}int XrlPort::startup (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classXrlPort_a54dd8c5e15759f0e02c372f4440795e7}


Start \hyperlink{protocolthe-p}{the} port binding. 

Sends request to FEA for socket server for address and then attempts to instantiate socket with socket server. If both operations are successful, instance status transitions to SERVICE\_\-RUNNING. Otherwise, it transitions to failed.

\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classServiceBase_a791755872b2056ddd82a2f00904c7d2b}{ServiceBase}.

\hypertarget{classXrlPort_a80baaddbd171a99adb38dd0823924d55}{
\index{XrlPort@{XrlPort}!vifname@{vifname}}
\index{vifname@{vifname}!XrlPort@{XrlPort}}
\subsubsection[{vifname}]{\setlength{\rightskip}{0pt plus 5cm}string XrlPort::vifname (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classXrlPort_a80baaddbd171a99adb38dd0823924d55}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} name of \hyperlink{protocolthe-p}{the} vif to which this socket is bound. 
\end{DoxyReturn}


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