\hypertarget{classIoTcpUdpSocket}{
\section{IoTcpUdpSocket Class Reference}
\label{classIoTcpUdpSocket}\index{IoTcpUdpSocket@{IoTcpUdpSocket}}
}


A base class for I/O TCP/UDP socket communication.  




{\ttfamily \#include $<$io\_\-tcpudp\_\-socket.hh$>$}

Inheritance diagram for IoTcpUdpSocket:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classIoTcpUdpSocket}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classIoTcpUdpSocket_a6a7f253f661b6941873ffa9eeff01aa6}{IoTcpUdpSocket} (\hyperlink{classFeaDataPlaneManager}{FeaDataPlaneManager} \&fea\_\-data\_\-plane\_\-manager, const \hyperlink{classIfTree}{IfTree} \&iftree, int family, bool is\_\-tcp)
\begin{DoxyCompactList}\small\item\em Constructor for a given address family. \item\end{DoxyCompactList}\item 
\hypertarget{classIoTcpUdpSocket_a82c1a71c8f08cca93f5b98df9d061e91}{
virtual \hyperlink{classIoTcpUdpSocket_a82c1a71c8f08cca93f5b98df9d061e91}{$\sim$IoTcpUdpSocket} ()}
\label{classIoTcpUdpSocket_a82c1a71c8f08cca93f5b98df9d061e91}

\begin{DoxyCompactList}\small\item\em Virtual destructor. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_ae637705746d243c42d7d82557bbb8383}{start} (string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Start operation. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_af3bd57f6fa39adec5f284a282e6894d3}{stop} (string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Stop operation. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a01141647da3bf2c4ad261b49d540f171}{tcp\_\-open} (string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Open a TCP socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_aff49e9fa1809a52d92b04ae818ad9610}{udp\_\-open} (string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Open an UDP socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a9d711cc79b8fd999a0f0c3369e062021}{tcp\_\-open\_\-and\_\-bind} (const \hyperlink{classIPvX}{IPvX} \&local\_\-addr, uint16\_\-t local\_\-port, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Create a bound TCP socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a62e5779761a172dbcd459562f5de0df3}{udp\_\-open\_\-and\_\-bind} (const \hyperlink{classIPvX}{IPvX} \&local\_\-addr, uint16\_\-t local\_\-port, const string \&local\_\-dev, int reuse, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Create a bound UDP socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a178ae69f8fee1f3b0ce91ec368666d1d}{udp\_\-open\_\-bind\_\-join} (const \hyperlink{classIPvX}{IPvX} \&local\_\-addr, uint16\_\-t local\_\-port, const \hyperlink{classIPvX}{IPvX} \&mcast\_\-addr, uint8\_\-t ttl, bool reuse, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Create a bound UDP multicast socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_ac349432dd585dd91f9e1136483b06fda}{tcp\_\-open\_\-bind\_\-connect} (const \hyperlink{classIPvX}{IPvX} \&local\_\-addr, uint16\_\-t local\_\-port, const \hyperlink{classIPvX}{IPvX} \&remote\_\-addr, uint16\_\-t remote\_\-port, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Create a bound and connected TCP socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_ae07c8afc6631fef73e4be27bdd15ffc2}{udp\_\-open\_\-bind\_\-connect} (const \hyperlink{classIPvX}{IPvX} \&local\_\-addr, uint16\_\-t local\_\-port, const \hyperlink{classIPvX}{IPvX} \&remote\_\-addr, uint16\_\-t remote\_\-port, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Create a bound and connected UDP socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a226e38963f18eccbb980da710c1cbe53}{udp\_\-open\_\-bind\_\-broadcast} (const string \&ifname, const string \&vifname, uint16\_\-t local\_\-port, uint16\_\-t remote\_\-port, bool reuse, bool limited, bool connected, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Create a bound, and optionally connected, UDP broadcast socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_af33570ab3416113b3b5b2665d654a19c}{bind} (const \hyperlink{classIPvX}{IPvX} \&local\_\-addr, uint16\_\-t local\_\-port, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Bind a socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a55c1fa62dc82b8810a372d07bb041f2c}{udp\_\-join\_\-group} (const \hyperlink{classIPvX}{IPvX} \&mcast\_\-addr, const \hyperlink{classIPvX}{IPvX} \&join\_\-if\_\-addr, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Join multicast group on already bound socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_abf3d4dd56e0bc702b093d4d730a7325f}{udp\_\-leave\_\-group} (const \hyperlink{classIPvX}{IPvX} \&mcast\_\-addr, const \hyperlink{classIPvX}{IPvX} \&leave\_\-if\_\-addr, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Leave multicast group on already bound socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a929f7f6ecf99cd3a3b865d237ecf92ac}{close} (string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Close socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a675623d6a5c032e4abdf64f58c9b2f20}{tcp\_\-listen} (uint32\_\-t backlog, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Listen for inbound connections on socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_aeaac5e980710537b493f12485de772d6}{udp\_\-enable\_\-recv} (string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Enable a UDP socket for datagram reception. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a73a0d227266572b9f2c4ca225f137261}{send} (const vector$<$ uint8\_\-t $>$ \&data, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em \hyperlink{structSend}{Send} data on socket. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_ae08e28452b05ebab88e9389c0408e50b}{send\_\-to} (const \hyperlink{classIPvX}{IPvX} \&remote\_\-addr, uint16\_\-t remote\_\-port, const vector$<$ uint8\_\-t $>$ \&data, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em \hyperlink{structSend}{Send} data on socket to a given destination. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a02aea071040a2344c9581a6fae2f8cec}{send\_\-from\_\-multicast\_\-if} (const \hyperlink{classIPvX}{IPvX} \&group\_\-addr, uint16\_\-t group\_\-port, const \hyperlink{classIPvX}{IPvX} \&ifaddr, const vector$<$ uint8\_\-t $>$ \&data, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em \hyperlink{structSend}{Send} data on socket to a given multicast group from a given interface. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a27dc7b3b4600a119f677e8f189d0ded7}{set\_\-socket\_\-option} (const string \&optname, uint32\_\-t optval, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Set a named socket option with an integer value. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a82d9d3d924b106de0ce0f18666067b0a}{set\_\-socket\_\-option} (const string \&optname, const string \&optval, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Set a named socket option with a text value. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a6dcfd162e8a4d1de7bd1d3ecac5fc02e}{accept\_\-connection} (bool is\_\-accepted, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em \hyperlink{classAccept}{Accept} or reject a pending connection. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classIoTcpUdpSocket_a28f22a65e1346588552ccd903ade3c1b}{set\_\-socket\_\-fd} (\hyperlink{classXorpFd}{XorpFd} fd)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} file descriptor of \hyperlink{protocolthe-p}{the} socket. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{classIoTcpUdpSocket_a65fe46a7edf03c1a2bb1da36d6cae979}{enable\_\-data\_\-recv} (string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Enable receiving of data. \item\end{DoxyCompactList}\item 
int \hyperlink{classIoTcpUdpSocket_a41dd34747bd388071278ad9fa04dd50b}{enable\_\-recv\_\-pktinfo} (bool is\_\-enabled, string \&error\_\-msg)
\begin{DoxyCompactList}\small\item\em Enable/disable receiving information about a packet received on \hyperlink{protocolthe-p}{the} protocol socket. \item\end{DoxyCompactList}\item 
void \hyperlink{classIoTcpUdpSocket_aab4c1ef6147fc33b7f6ff722392d4274}{accept\_\-io\_\-cb} (\hyperlink{classXorpFd}{XorpFd} fd, IoEventType io\_\-event\_\-type)
\begin{DoxyCompactList}\small\item\em I/O event callback: new connection is ready to be accepted. \item\end{DoxyCompactList}\item 
void \hyperlink{classIoTcpUdpSocket_abe89c3dd889ff3d4772e5d060f6dab71}{connect\_\-io\_\-cb} (\hyperlink{classXorpFd}{XorpFd} fd, IoEventType io\_\-event\_\-type)
\begin{DoxyCompactList}\small\item\em I/O event callback: connection opening to \hyperlink{protocolthe-p}{the} peer has completed. \item\end{DoxyCompactList}\item 
void \hyperlink{classIoTcpUdpSocket_a2f144a58d16d499329cae863832b341b}{data\_\-io\_\-cb} (\hyperlink{classXorpFd}{XorpFd} fd, IoEventType io\_\-event\_\-type)
\begin{DoxyCompactList}\small\item\em I/O event callback: data is received. \item\end{DoxyCompactList}\item 
void \hyperlink{classIoTcpUdpSocket_a4a30c66a91e898d7d142b294e28c3498}{send\_\-completed\_\-cb} (AsyncFileWriter::Event event, const uint8\_\-t $\ast$buffer, size\_\-t buffer\_\-bytes, size\_\-t offset)
\begin{DoxyCompactList}\small\item\em Data transmission completed callback. \item\end{DoxyCompactList}\item 
void \hyperlink{classIoTcpUdpSocket_a6e84924ee5d243408db2401b80b871c2}{disconnect\_\-io\_\-cb} (\hyperlink{classXorpFd}{XorpFd} fd, IoEventType io\_\-event\_\-type)
\begin{DoxyCompactList}\small\item\em I/O event callback: \hyperlink{protocolthe-p}{the} peer has closed \hyperlink{protocolthe-p}{the} connection. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIoTcpUdpSocket_abb8a16c9fbb4a6e56b7aadd0b6e56ec6}{
\hyperlink{classXorpFd}{XorpFd} {\bfseries \_\-socket\_\-fd}}
\label{classIoTcpUdpSocket_abb8a16c9fbb4a6e56b7aadd0b6e56ec6}

\item 
\hypertarget{classIoTcpUdpSocket_ae2b337d8e081924fbc2a0c846b8e781e}{
\hyperlink{classIPvX}{IPvX} {\bfseries \_\-peer\_\-address}}
\label{classIoTcpUdpSocket_ae2b337d8e081924fbc2a0c846b8e781e}

\item 
\hypertarget{classIoTcpUdpSocket_a13f0c4cd9b65a0da78f4d6ebf55e8328}{
uint16\_\-t {\bfseries \_\-peer\_\-port}}
\label{classIoTcpUdpSocket_a13f0c4cd9b65a0da78f4d6ebf55e8328}

\item 
\hypertarget{classIoTcpUdpSocket_a6ae264a3695b649ef3ce16f7c9842d37}{
\hyperlink{classAsyncFileWriter}{AsyncFileWriter} $\ast$ {\bfseries \_\-async\_\-writer}}
\label{classIoTcpUdpSocket_a6ae264a3695b649ef3ce16f7c9842d37}

\item 
\hypertarget{classIoTcpUdpSocket_aefe9c1e95ef92fa5668b702ac3a40e37}{
bool {\bfseries \_\-limited\_\-broadcast\_\-enabled}}
\label{classIoTcpUdpSocket_aefe9c1e95ef92fa5668b702ac3a40e37}

\item 
\hypertarget{classIoTcpUdpSocket_ad59cba5d890a7da7c2312ab905ccb450}{
\hyperlink{classIPvX}{IPvX} {\bfseries \_\-network\_\-broadcast\_\-address}}
\label{classIoTcpUdpSocket_ad59cba5d890a7da7c2312ab905ccb450}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
A base class for I/O TCP/UDP socket communication. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classIoTcpUdpSocket_a6a7f253f661b6941873ffa9eeff01aa6}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{IoTcpUdpSocket}]{\setlength{\rightskip}{0pt plus 5cm}IoTcpUdpSocket::IoTcpUdpSocket (
\begin{DoxyParamCaption}
\item[{{\bf FeaDataPlaneManager} \&}]{fea\_\-data\_\-plane\_\-manager, }
\item[{const {\bf IfTree} \&}]{iftree, }
\item[{int}]{family, }
\item[{bool}]{is\_\-tcp}
\end{DoxyParamCaption}
)}}
\label{classIoTcpUdpSocket_a6a7f253f661b6941873ffa9eeff01aa6}


Constructor for a given address family. 


\begin{DoxyParams}{Parameters}
{\em fea\_\-data\_\-plane\_\-manager} & \hyperlink{protocolthe-p}{the} corresponding data plane manager (\hyperlink{classFeaDataPlaneManager}{FeaDataPlaneManager}). \\
\hline
{\em iftree} & \hyperlink{protocolthe-p}{the} interface tree to use. \\
\hline
{\em family} & \hyperlink{protocolthe-p}{the} address family (AF\_\-INET or AF\_\-INET6 for \hyperlink{classIPv4}{IPv4} and \hyperlink{classIPv6}{IPv6} respectively). \\
\hline
{\em is\_\-tcp} & if true this is TCP entry, otherwise UDP. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classIoTcpUdpSocket_a6dcfd162e8a4d1de7bd1d3ecac5fc02e}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!accept\_\-connection@{accept\_\-connection}}
\index{accept\_\-connection@{accept\_\-connection}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{accept\_\-connection}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::accept\_\-connection (
\begin{DoxyParamCaption}
\item[{bool}]{is\_\-accepted, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a6dcfd162e8a4d1de7bd1d3ecac5fc02e}


\hyperlink{classAccept}{Accept} or reject a pending connection. 


\begin{DoxyParams}{Parameters}
{\em is\_\-accepted} & if true, \hyperlink{protocolthe-p}{the} connection is accepted, otherwise is rejected. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a5a451d459c4b8f935b5e62ce88d1c130}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_aab4c1ef6147fc33b7f6ff722392d4274}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!accept\_\-io\_\-cb@{accept\_\-io\_\-cb}}
\index{accept\_\-io\_\-cb@{accept\_\-io\_\-cb}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{accept\_\-io\_\-cb}]{\setlength{\rightskip}{0pt plus 5cm}void IoTcpUdpSocket::accept\_\-io\_\-cb (
\begin{DoxyParamCaption}
\item[{{\bf XorpFd}}]{fd, }
\item[{IoEventType}]{io\_\-event\_\-type}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classIoTcpUdpSocket_aab4c1ef6147fc33b7f6ff722392d4274}


I/O event callback: new connection is ready to be accepted. 


\begin{DoxyParams}{Parameters}
{\em fd} & \hyperlink{protocolthe-p}{the} file descriptor of \hyperlink{protocolthe-p}{the} socket with \hyperlink{protocolthe-p}{the} new connection. \\
\hline
{\em io\_\-event\_\-type} & \hyperlink{protocolthe-p}{the} event type (IoEventType). \\
\hline
\end{DoxyParams}
\hypertarget{classIoTcpUdpSocket_af33570ab3416113b3b5b2665d654a19c}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!bind@{bind}}
\index{bind@{bind}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{bind}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::bind (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{local\_\-addr, }
\item[{uint16\_\-t}]{local\_\-port, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_af33570ab3416113b3b5b2665d654a19c}


Bind a socket. 


\begin{DoxyParams}{Parameters}
{\em local\_\-addr} & \hyperlink{protocolthe-p}{the} interface address to bind socket to. \\
\hline
{\em local\_\-port} & \hyperlink{protocolthe-p}{the} port to bind socket to. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a262453ac79b0a2761f87dcfedd5706f8}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a929f7f6ecf99cd3a3b865d237ecf92ac}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!close@{close}}
\index{close@{close}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::close (
\begin{DoxyParamCaption}
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a929f7f6ecf99cd3a3b865d237ecf92ac}


Close socket. 


\begin{DoxyParams}{Parameters}
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a3451da21b4680d8b3e567efe12f28955}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_abe89c3dd889ff3d4772e5d060f6dab71}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!connect\_\-io\_\-cb@{connect\_\-io\_\-cb}}
\index{connect\_\-io\_\-cb@{connect\_\-io\_\-cb}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{connect\_\-io\_\-cb}]{\setlength{\rightskip}{0pt plus 5cm}void IoTcpUdpSocket::connect\_\-io\_\-cb (
\begin{DoxyParamCaption}
\item[{{\bf XorpFd}}]{fd, }
\item[{IoEventType}]{io\_\-event\_\-type}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classIoTcpUdpSocket_abe89c3dd889ff3d4772e5d060f6dab71}


I/O event callback: connection opening to \hyperlink{protocolthe-p}{the} peer has completed. 


\begin{DoxyParams}{Parameters}
{\em fd} & \hyperlink{protocolthe-p}{the} file descriptor of \hyperlink{protocolthe-p}{the} socket with \hyperlink{protocolthe-p}{the} new connection. \\
\hline
{\em io\_\-event\_\-type} & \hyperlink{protocolthe-p}{the} event type (IoEventType). \\
\hline
\end{DoxyParams}
\hypertarget{classIoTcpUdpSocket_a2f144a58d16d499329cae863832b341b}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!data\_\-io\_\-cb@{data\_\-io\_\-cb}}
\index{data\_\-io\_\-cb@{data\_\-io\_\-cb}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{data\_\-io\_\-cb}]{\setlength{\rightskip}{0pt plus 5cm}void IoTcpUdpSocket::data\_\-io\_\-cb (
\begin{DoxyParamCaption}
\item[{{\bf XorpFd}}]{fd, }
\item[{IoEventType}]{io\_\-event\_\-type}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classIoTcpUdpSocket_a2f144a58d16d499329cae863832b341b}


I/O event callback: data is received. 


\begin{DoxyParams}{Parameters}
{\em fd} & \hyperlink{protocolthe-p}{the} file descriptor of \hyperlink{protocolthe-p}{the} socket with \hyperlink{protocolthe-p}{the} data. \\
\hline
{\em io\_\-event\_\-type} & \hyperlink{protocolthe-p}{the} event type (IoEventType). \\
\hline
\end{DoxyParams}
\hypertarget{classIoTcpUdpSocket_a6e84924ee5d243408db2401b80b871c2}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!disconnect\_\-io\_\-cb@{disconnect\_\-io\_\-cb}}
\index{disconnect\_\-io\_\-cb@{disconnect\_\-io\_\-cb}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{disconnect\_\-io\_\-cb}]{\setlength{\rightskip}{0pt plus 5cm}void IoTcpUdpSocket::disconnect\_\-io\_\-cb (
\begin{DoxyParamCaption}
\item[{{\bf XorpFd}}]{fd, }
\item[{IoEventType}]{io\_\-event\_\-type}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classIoTcpUdpSocket_a6e84924ee5d243408db2401b80b871c2}


I/O event callback: \hyperlink{protocolthe-p}{the} peer has closed \hyperlink{protocolthe-p}{the} connection. 

This callback is used only for Windows, and only for TCP sockets.


\begin{DoxyParams}{Parameters}
{\em fd} & \hyperlink{protocolthe-p}{the} file descriptor of \hyperlink{protocolthe-p}{the} socket with \hyperlink{protocolthe-p}{the} data. \\
\hline
{\em io\_\-event\_\-type} & \hyperlink{protocolthe-p}{the} event type (IoEventType). \\
\hline
\end{DoxyParams}
\hypertarget{classIoTcpUdpSocket_a65fe46a7edf03c1a2bb1da36d6cae979}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!enable\_\-data\_\-recv@{enable\_\-data\_\-recv}}
\index{enable\_\-data\_\-recv@{enable\_\-data\_\-recv}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{enable\_\-data\_\-recv}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::enable\_\-data\_\-recv (
\begin{DoxyParamCaption}
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classIoTcpUdpSocket_a65fe46a7edf03c1a2bb1da36d6cae979}


Enable receiving of data. 


\begin{DoxyParams}{Parameters}
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}
\hypertarget{classIoTcpUdpSocket_a41dd34747bd388071278ad9fa04dd50b}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!enable\_\-recv\_\-pktinfo@{enable\_\-recv\_\-pktinfo}}
\index{enable\_\-recv\_\-pktinfo@{enable\_\-recv\_\-pktinfo}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{enable\_\-recv\_\-pktinfo}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::enable\_\-recv\_\-pktinfo (
\begin{DoxyParamCaption}
\item[{bool}]{is\_\-enabled, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classIoTcpUdpSocket_a41dd34747bd388071278ad9fa04dd50b}


Enable/disable receiving information about a packet received on \hyperlink{protocolthe-p}{the} protocol socket. 

If enabled, values such as interface index will be received as well.


\begin{DoxyParams}{Parameters}
{\em is\_\-enabled} & if true, set \hyperlink{protocolthe-p}{the} option, otherwise reset it. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}
\hypertarget{classIoTcpUdpSocket_a73a0d227266572b9f2c4ca225f137261}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!send@{send}}
\index{send@{send}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{send}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::send (
\begin{DoxyParamCaption}
\item[{const vector$<$ uint8\_\-t $>$ \&}]{data, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a73a0d227266572b9f2c4ca225f137261}


\hyperlink{structSend}{Send} data on socket. 


\begin{DoxyParams}{Parameters}
{\em data} & block of data to be sent. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a53ca85961ecbc07da9cb76a7599cbbbb}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a4a30c66a91e898d7d142b294e28c3498}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!send\_\-completed\_\-cb@{send\_\-completed\_\-cb}}
\index{send\_\-completed\_\-cb@{send\_\-completed\_\-cb}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{send\_\-completed\_\-cb}]{\setlength{\rightskip}{0pt plus 5cm}void IoTcpUdpSocket::send\_\-completed\_\-cb (
\begin{DoxyParamCaption}
\item[{AsyncFileWriter::Event}]{event, }
\item[{const uint8\_\-t $\ast$}]{buffer, }
\item[{size\_\-t}]{buffer\_\-bytes, }
\item[{size\_\-t}]{offset}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classIoTcpUdpSocket_a4a30c66a91e898d7d142b294e28c3498}


Data transmission completed callback. 


\begin{DoxyParams}{Parameters}
{\em event} & \hyperlink{protocolthe-p}{the} event code (AsyncFileOperator::Event). \\
\hline
{\em buffer} & \hyperlink{protocolthe-p}{the} buffer with \hyperlink{protocolthe-p}{the} transmitted data. \\
\hline
{\em buffer\_\-bytes} & \hyperlink{protocolthe-p}{the} size of \hyperlink{protocolthe-p}{the} buffer with \hyperlink{protocolthe-p}{the} data. \\
\hline
{\em offset} & \hyperlink{protocolthe-p}{the} offset of \hyperlink{protocolthe-p}{the} last byte written (from \hyperlink{protocolthe-p}{the} beginning of \hyperlink{protocolthe-p}{the} buffer. \\
\hline
\end{DoxyParams}
\hypertarget{classIoTcpUdpSocket_a02aea071040a2344c9581a6fae2f8cec}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!send\_\-from\_\-multicast\_\-if@{send\_\-from\_\-multicast\_\-if}}
\index{send\_\-from\_\-multicast\_\-if@{send\_\-from\_\-multicast\_\-if}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{send\_\-from\_\-multicast\_\-if}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::send\_\-from\_\-multicast\_\-if (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{group\_\-addr, }
\item[{uint16\_\-t}]{group\_\-port, }
\item[{const {\bf IPvX} \&}]{ifaddr, }
\item[{const vector$<$ uint8\_\-t $>$ \&}]{data, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a02aea071040a2344c9581a6fae2f8cec}


\hyperlink{structSend}{Send} data on socket to a given multicast group from a given interface. 


\begin{DoxyParams}{Parameters}
{\em group\_\-addr} & destination address for data. \\
\hline
{\em group\_\-port} & destination port for data. \\
\hline
{\em ifaddr} & interface address. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_abbe53379d6427f27b475c38b7c5d1c0d}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_ae08e28452b05ebab88e9389c0408e50b}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!send\_\-to@{send\_\-to}}
\index{send\_\-to@{send\_\-to}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{send\_\-to}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::send\_\-to (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{remote\_\-addr, }
\item[{uint16\_\-t}]{remote\_\-port, }
\item[{const vector$<$ uint8\_\-t $>$ \&}]{data, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_ae08e28452b05ebab88e9389c0408e50b}


\hyperlink{structSend}{Send} data on socket to a given destination. 

The packet is not routed as \hyperlink{protocolthe-p}{the} forwarding engine sending \hyperlink{protocolthe-p}{the} packet may not have access to \hyperlink{protocolthe-p}{the} full routing table.


\begin{DoxyParams}{Parameters}
{\em remote\_\-addr} & destination address for data. \\
\hline
{\em remote\_\-port} & destination port for data. \\
\hline
{\em data} & block of data to be sent. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_ad6f8969ce50e5b683bd73c91a504240e}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a28f22a65e1346588552ccd903ade3c1b}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!set\_\-socket\_\-fd@{set\_\-socket\_\-fd}}
\index{set\_\-socket\_\-fd@{set\_\-socket\_\-fd}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{set\_\-socket\_\-fd}]{\setlength{\rightskip}{0pt plus 5cm}void IoTcpUdpSocket::set\_\-socket\_\-fd (
\begin{DoxyParamCaption}
\item[{{\bf XorpFd}}]{fd}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, protected\mbox{]}}}}
\label{classIoTcpUdpSocket_a28f22a65e1346588552ccd903ade3c1b}


Set \hyperlink{protocolthe-p}{the} file descriptor of \hyperlink{protocolthe-p}{the} socket. 


\begin{DoxyParams}{Parameters}
{\em fd} & \hyperlink{protocolthe-p}{the} file descriptor of \hyperlink{protocolthe-p}{the} socket. \\
\hline
\end{DoxyParams}
\hypertarget{classIoTcpUdpSocket_a82d9d3d924b106de0ce0f18666067b0a}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!set\_\-socket\_\-option@{set\_\-socket\_\-option}}
\index{set\_\-socket\_\-option@{set\_\-socket\_\-option}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{set\_\-socket\_\-option}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::set\_\-socket\_\-option (
\begin{DoxyParamCaption}
\item[{const string \&}]{optname, }
\item[{const string \&}]{optval, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a82d9d3d924b106de0ce0f18666067b0a}


Set a named socket option with a text value. 


\begin{DoxyParams}{Parameters}
{\em optname} & name of option to be set. Valid values are: \char`\"{}bindtodevice\char`\"{} \\
\hline
{\em optval} & string value of option to be set. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_aab7e194fffa22ae3ec1d604f1ca46df3}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a27dc7b3b4600a119f677e8f189d0ded7}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!set\_\-socket\_\-option@{set\_\-socket\_\-option}}
\index{set\_\-socket\_\-option@{set\_\-socket\_\-option}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{set\_\-socket\_\-option}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::set\_\-socket\_\-option (
\begin{DoxyParamCaption}
\item[{const string \&}]{optname, }
\item[{uint32\_\-t}]{optval, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a27dc7b3b4600a119f677e8f189d0ded7}


Set a named socket option with an integer value. 


\begin{DoxyParams}{Parameters}
{\em optname} & name of option to be set. Valid values are: \char`\"{}onesbcast\char`\"{} (\hyperlink{classIPv4}{IPv4} only) \char`\"{}receive\_\-broadcast\char`\"{} (\hyperlink{classIPv4}{IPv4} only) \char`\"{}reuseport\char`\"{} \char`\"{}send\_\-broadcast\char`\"{} (\hyperlink{classIPv4}{IPv4} only) \char`\"{}tos\char`\"{} (\hyperlink{classIPv4}{IPv4} only) \char`\"{}ttl\char`\"{} \char`\"{}multicast\_\-loopback\char`\"{} \char`\"{}multicast\_\-ttl\char`\"{} \\
\hline
{\em optval} & value of option to be set. If value is logically boolean then zero represents false and any non-\/zero value true. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_ace5c324fe13721b31399062f87a214b9}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_ae637705746d243c42d7d82557bbb8383}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!start@{start}}
\index{start@{start}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{start}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::start (
\begin{DoxyParamCaption}
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_ae637705746d243c42d7d82557bbb8383}


Start operation. 


\begin{DoxyParams}{Parameters}
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_abc82f6f92ec696f8a174673a00aaa7b4}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_af3bd57f6fa39adec5f284a282e6894d3}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!stop@{stop}}
\index{stop@{stop}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{stop}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::stop (
\begin{DoxyParamCaption}
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_af3bd57f6fa39adec5f284a282e6894d3}


Stop operation. 


\begin{DoxyParams}{Parameters}
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a2fdd3b26ccf4af375653f3bc34b6db96}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a675623d6a5c032e4abdf64f58c9b2f20}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!tcp\_\-listen@{tcp\_\-listen}}
\index{tcp\_\-listen@{tcp\_\-listen}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{tcp\_\-listen}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::tcp\_\-listen (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{backlog, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a675623d6a5c032e4abdf64f58c9b2f20}


Listen for inbound connections on socket. 

When a connection request is received \hyperlink{protocolthe-p}{the} socket creator will receive notification.


\begin{DoxyParams}{Parameters}
{\em backlog} & \hyperlink{protocolthe-p}{the} maximum number of pending connections. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a36932a32e49b0af71c3f8dc26d2a7474}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a01141647da3bf2c4ad261b49d540f171}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!tcp\_\-open@{tcp\_\-open}}
\index{tcp\_\-open@{tcp\_\-open}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{tcp\_\-open}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::tcp\_\-open (
\begin{DoxyParamCaption}
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a01141647da3bf2c4ad261b49d540f171}


Open a TCP socket. 


\begin{DoxyParams}{Parameters}
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_ae5cda6420a774c24fc8edc9a5780683e}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a9d711cc79b8fd999a0f0c3369e062021}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!tcp\_\-open\_\-and\_\-bind@{tcp\_\-open\_\-and\_\-bind}}
\index{tcp\_\-open\_\-and\_\-bind@{tcp\_\-open\_\-and\_\-bind}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{tcp\_\-open\_\-and\_\-bind}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::tcp\_\-open\_\-and\_\-bind (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{local\_\-addr, }
\item[{uint16\_\-t}]{local\_\-port, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a9d711cc79b8fd999a0f0c3369e062021}


Create a bound TCP socket. 


\begin{DoxyParams}{Parameters}
{\em local\_\-addr} & \hyperlink{protocolthe-p}{the} interface address to bind socket to. \\
\hline
{\em local\_\-port} & \hyperlink{protocolthe-p}{the} port to bind socket to. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a1a059d4142656cbd90a063e495f228b3}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_ac349432dd585dd91f9e1136483b06fda}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!tcp\_\-open\_\-bind\_\-connect@{tcp\_\-open\_\-bind\_\-connect}}
\index{tcp\_\-open\_\-bind\_\-connect@{tcp\_\-open\_\-bind\_\-connect}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{tcp\_\-open\_\-bind\_\-connect}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::tcp\_\-open\_\-bind\_\-connect (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{local\_\-addr, }
\item[{uint16\_\-t}]{local\_\-port, }
\item[{const {\bf IPvX} \&}]{remote\_\-addr, }
\item[{uint16\_\-t}]{remote\_\-port, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_ac349432dd585dd91f9e1136483b06fda}


Create a bound and connected TCP socket. 


\begin{DoxyParams}{Parameters}
{\em local\_\-addr} & \hyperlink{protocolthe-p}{the} interface address to bind socket to. \\
\hline
{\em local\_\-port} & \hyperlink{protocolthe-p}{the} port to bind socket to. \\
\hline
{\em remote\_\-addr} & \hyperlink{protocolthe-p}{the} address to connect to. \\
\hline
{\em remote\_\-port} & \hyperlink{protocolthe-p}{the} remote port to connect to. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_abdc53f610eb3191ad0a945d2c559f5d3}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_aeaac5e980710537b493f12485de772d6}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!udp\_\-enable\_\-recv@{udp\_\-enable\_\-recv}}
\index{udp\_\-enable\_\-recv@{udp\_\-enable\_\-recv}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{udp\_\-enable\_\-recv}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::udp\_\-enable\_\-recv (
\begin{DoxyParamCaption}
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_aeaac5e980710537b493f12485de772d6}


Enable a UDP socket for datagram reception. 


\begin{DoxyParams}{Parameters}
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a1a05fdb241e8a99fd54a5407b7f6b618}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a55c1fa62dc82b8810a372d07bb041f2c}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!udp\_\-join\_\-group@{udp\_\-join\_\-group}}
\index{udp\_\-join\_\-group@{udp\_\-join\_\-group}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{udp\_\-join\_\-group}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::udp\_\-join\_\-group (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{mcast\_\-addr, }
\item[{const {\bf IPvX} \&}]{join\_\-if\_\-addr, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a55c1fa62dc82b8810a372d07bb041f2c}


Join multicast group on already bound socket. 


\begin{DoxyParams}{Parameters}
{\em mcast\_\-addr} & group to join. \\
\hline
{\em join\_\-if\_\-addr} & interface address to perform join on. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_af8680ef1d8758531b6b84f1b155cde45}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_abf3d4dd56e0bc702b093d4d730a7325f}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!udp\_\-leave\_\-group@{udp\_\-leave\_\-group}}
\index{udp\_\-leave\_\-group@{udp\_\-leave\_\-group}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{udp\_\-leave\_\-group}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::udp\_\-leave\_\-group (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{mcast\_\-addr, }
\item[{const {\bf IPvX} \&}]{leave\_\-if\_\-addr, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_abf3d4dd56e0bc702b093d4d730a7325f}


Leave multicast group on already bound socket. 


\begin{DoxyParams}{Parameters}
{\em mcast\_\-addr} & group to leave. \\
\hline
{\em leave\_\-if\_\-addr} & interface address to perform leave on. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a81b895c1634d404191a099bd5aff5b8c}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_aff49e9fa1809a52d92b04ae818ad9610}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!udp\_\-open@{udp\_\-open}}
\index{udp\_\-open@{udp\_\-open}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{udp\_\-open}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::udp\_\-open (
\begin{DoxyParamCaption}
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_aff49e9fa1809a52d92b04ae818ad9610}


Open an UDP socket. 


\begin{DoxyParams}{Parameters}
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_aed038b61b40713bbf3b43c23e2ebb8bf}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a62e5779761a172dbcd459562f5de0df3}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!udp\_\-open\_\-and\_\-bind@{udp\_\-open\_\-and\_\-bind}}
\index{udp\_\-open\_\-and\_\-bind@{udp\_\-open\_\-and\_\-bind}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{udp\_\-open\_\-and\_\-bind}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::udp\_\-open\_\-and\_\-bind (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{local\_\-addr, }
\item[{uint16\_\-t}]{local\_\-port, }
\item[{const string \&}]{local\_\-dev, }
\item[{int}]{reuse, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a62e5779761a172dbcd459562f5de0df3}


Create a bound UDP socket. 


\begin{DoxyParams}{Parameters}
{\em local\_\-addr} & \hyperlink{protocolthe-p}{the} interface address to bind socket to. \\
\hline
{\em local\_\-port} & \hyperlink{protocolthe-p}{the} port to bind socket to. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a1885797d1bf4d2d844272e7469ee41be}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a226e38963f18eccbb980da710c1cbe53}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!udp\_\-open\_\-bind\_\-broadcast@{udp\_\-open\_\-bind\_\-broadcast}}
\index{udp\_\-open\_\-bind\_\-broadcast@{udp\_\-open\_\-bind\_\-broadcast}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{udp\_\-open\_\-bind\_\-broadcast}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::udp\_\-open\_\-bind\_\-broadcast (
\begin{DoxyParamCaption}
\item[{const string \&}]{ifname, }
\item[{const string \&}]{vifname, }
\item[{uint16\_\-t}]{local\_\-port, }
\item[{uint16\_\-t}]{remote\_\-port, }
\item[{bool}]{reuse, }
\item[{bool}]{limited, }
\item[{bool}]{connected, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a226e38963f18eccbb980da710c1cbe53}


Create a bound, and optionally connected, UDP broadcast socket. 


\begin{DoxyParams}{Parameters}
{\em ifname} & \hyperlink{protocolthe-p}{the} interface name to bind socket to. \\
\hline
{\em vifname} & \hyperlink{protocolthe-p}{the} vif to bind socket to. \\
\hline
{\em local\_\-port} & \hyperlink{protocolthe-p}{the} port to bind socket to. \\
\hline
{\em remote\_\-port} & \hyperlink{protocolthe-p}{the} remote port to connect to. \\
\hline
{\em reuse} & allow other sockets to bind to same port. \\
\hline
{\em limited} & set \hyperlink{protocolthe-p}{the} socket up for transmission to \hyperlink{protocolthe-p}{the} limited broadcast address 255.255.255.255. \\
\hline
{\em connected} & connect \hyperlink{protocolthe-p}{the} socket for use with \hyperlink{classIoTcpUdpSocket_a73a0d227266572b9f2c4ca225f137261}{send()} not sendto(). \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a33da4c42427d1f9d93e3877e21004c6f}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_ae07c8afc6631fef73e4be27bdd15ffc2}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!udp\_\-open\_\-bind\_\-connect@{udp\_\-open\_\-bind\_\-connect}}
\index{udp\_\-open\_\-bind\_\-connect@{udp\_\-open\_\-bind\_\-connect}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{udp\_\-open\_\-bind\_\-connect}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::udp\_\-open\_\-bind\_\-connect (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{local\_\-addr, }
\item[{uint16\_\-t}]{local\_\-port, }
\item[{const {\bf IPvX} \&}]{remote\_\-addr, }
\item[{uint16\_\-t}]{remote\_\-port, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_ae07c8afc6631fef73e4be27bdd15ffc2}


Create a bound and connected UDP socket. 


\begin{DoxyParams}{Parameters}
{\em local\_\-addr} & \hyperlink{protocolthe-p}{the} interface address to bind socket to. \\
\hline
{\em local\_\-port} & \hyperlink{protocolthe-p}{the} port to bind socket to. \\
\hline
{\em remote\_\-addr} & \hyperlink{protocolthe-p}{the} address to connect to. \\
\hline
{\em remote\_\-port} & \hyperlink{protocolthe-p}{the} remote port to connect to. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_a537ad4a122779c5f70c0627f9bca65ff}{IoTcpUdp}.

\hypertarget{classIoTcpUdpSocket_a178ae69f8fee1f3b0ce91ec368666d1d}{
\index{IoTcpUdpSocket@{IoTcpUdpSocket}!udp\_\-open\_\-bind\_\-join@{udp\_\-open\_\-bind\_\-join}}
\index{udp\_\-open\_\-bind\_\-join@{udp\_\-open\_\-bind\_\-join}!IoTcpUdpSocket@{IoTcpUdpSocket}}
\subsubsection[{udp\_\-open\_\-bind\_\-join}]{\setlength{\rightskip}{0pt plus 5cm}int IoTcpUdpSocket::udp\_\-open\_\-bind\_\-join (
\begin{DoxyParamCaption}
\item[{const {\bf IPvX} \&}]{local\_\-addr, }
\item[{uint16\_\-t}]{local\_\-port, }
\item[{const {\bf IPvX} \&}]{mcast\_\-addr, }
\item[{uint8\_\-t}]{ttl, }
\item[{bool}]{reuse, }
\item[{string \&}]{error\_\-msg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIoTcpUdpSocket_a178ae69f8fee1f3b0ce91ec368666d1d}


Create a bound UDP multicast socket. 


\begin{DoxyParams}{Parameters}
{\em local\_\-addr} & \hyperlink{protocolthe-p}{the} interface address to bind socket to. \\
\hline
{\em local\_\-port} & \hyperlink{protocolthe-p}{the} port to bind socket to. \\
\hline
{\em mcast\_\-addr} & \hyperlink{protocolthe-p}{the} multicast group address to join. \\
\hline
{\em ttl} & \hyperlink{protocolthe-p}{the} TTL to use for this multicast socket. \\
\hline
{\em reuse} & allow other sockets to bind to same multicast group. \\
\hline
{\em error\_\-msg} & \hyperlink{protocolthe-p}{the} error message (if error). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
XORP\_\-OK on success, otherwise XORP\_\-ERROR. 
\end{DoxyReturn}


Implements \hyperlink{classIoTcpUdp_ae456ddc7b4ae18cad3f0d5768eaca335}{IoTcpUdp}.



The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/fea/data\_\-plane/io/io\_\-tcpudp\_\-socket.hh\end{DoxyCompactItemize}
