\doxysection{Transport sockets}
\hypertarget{group__mod__transport__h}{}\label{group__mod__transport__h}\index{Transport sockets@{Transport sockets}}


The RTR transport sockets implement the communication channel (e.\+g., SSH, TCP, TCP-\/\+AO) between an RTR server and client.  


\doxysubsubsection*{Modules}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__mod__ssh__transport__h}{SSH transport socket}}
\begin{DoxyCompactList}\small\item\em An implementation of the SSH protocol for the RTR transport. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__mod__tcp__transport__h}{TCP transport socket}}
\begin{DoxyCompactList}\small\item\em An implementation of the TCP protocol for the RTR transport. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}}
\begin{DoxyCompactList}\small\item\em A transport socket datastructure. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{group__mod__transport__h_gac27543eee07496666cd6ebf3487aec40}{RTRLIB\+\_\+\+TRANSPORT\+\_\+\+CONNECT\+\_\+\+TIMEOUT\+\_\+\+DEFAULT}}~30
\begin{DoxyCompactList}\small\item\em Default connect timeout. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef void(\texorpdfstring{$\ast$}{*} \mbox{\hyperlink{group__mod__transport__h_gad2efbef8b157cd9484c688d6ef67d6b6}{tr\+\_\+close\+\_\+fp}}) (void \texorpdfstring{$\ast$}{*}socket)
\begin{DoxyCompactList}\small\item\em A function pointer to a technology specific close function. \end{DoxyCompactList}\item 
typedef int(\texorpdfstring{$\ast$}{*} \mbox{\hyperlink{group__mod__transport__h_ga615d56abf17d32924155fcf0ccc2664c}{tr\+\_\+open\+\_\+fp}}) (void \texorpdfstring{$\ast$}{*}socket)
\begin{DoxyCompactList}\small\item\em A function pointer to a technology specific open function. \end{DoxyCompactList}\item 
typedef void(\texorpdfstring{$\ast$}{*} \mbox{\hyperlink{group__mod__transport__h_ga333a8d2d3a3dea54a36034c026d0a054}{tr\+\_\+free\+\_\+fp}}) (struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}tr\+\_\+sock)
\begin{DoxyCompactList}\small\item\em A function pointer to a technology specific free function. \end{DoxyCompactList}\item 
typedef int(\texorpdfstring{$\ast$}{*} \mbox{\hyperlink{group__mod__transport__h_ga257bfa5c831410f1034edaa9b79f303c}{tr\+\_\+recv\+\_\+fp}}) (const void \texorpdfstring{$\ast$}{*}socket, void \texorpdfstring{$\ast$}{*}pdu, const size\+\_\+t \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}}, const time\+\_\+t timeout)
\begin{DoxyCompactList}\small\item\em A function pointer to a technology specific recv function. \end{DoxyCompactList}\item 
typedef int(\texorpdfstring{$\ast$}{*} \mbox{\hyperlink{group__mod__transport__h_gadc6f1fbce8f7557edd50070069afc0c6}{tr\+\_\+send\+\_\+fp}}) (const void \texorpdfstring{$\ast$}{*}socket, const void \texorpdfstring{$\ast$}{*}pdu, const size\+\_\+t \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}}, const time\+\_\+t timeout)
\begin{DoxyCompactList}\small\item\em A function pointer to a technology specific send function. \end{DoxyCompactList}\item 
typedef const char \texorpdfstring{$\ast$}{*}(\texorpdfstring{$\ast$}{*} \mbox{\hyperlink{group__mod__transport__h_ga02f9d37bf7e41a8990b74af6653cae6c}{tr\+\_\+ident\+\_\+fp}}) (void \texorpdfstring{$\ast$}{*}socket)
\begin{DoxyCompactList}\small\item\em A function pointer to a technology specific info function. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{group__mod__transport__h_ga4493c1dcecd61a8f10a71912f29d2087}{tr\+\_\+rtvals}} \{ \newline
\mbox{\hyperlink{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087afbed3f5722747b105d734585aa0fcba2}{TR\+\_\+\+SUCCESS}} = 0
, \mbox{\hyperlink{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a073c7a28c0dd674b0635178112536a2f}{TR\+\_\+\+ERROR}} = -\/1
, \mbox{\hyperlink{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a9cb0eee91bb5e932bbe89c2f12daadb5}{TR\+\_\+\+WOULDBLOCK}} = -\/2
, \mbox{\hyperlink{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a15019d7ece9eed5882a70243bbdfc0d8}{TR\+\_\+\+INTR}} = -\/3
, \newline
\mbox{\hyperlink{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a347014cc5da178db6cc3970d6e160694}{TR\+\_\+\+CLOSED}} = -\/4
 \}
\begin{DoxyCompactList}\small\item\em The return values for tr\+\_\+ functions. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \mbox{\hyperlink{group__mod__transport__h_ga9a56327f186f88ad78edd7304fa254d9}{tr\+\_\+open}} (struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}socket)
\begin{DoxyCompactList}\small\item\em Establish the connection. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__mod__transport__h_ga7d2f6f44da39e272f9ec1026ba9a630d}{tr\+\_\+close}} (struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}socket)
\begin{DoxyCompactList}\small\item\em Close the socket connection. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__mod__transport__h_ga1e7044b71e93ae593bb8fc5d43a03e6f}{tr\+\_\+free}} (struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}socket)
\begin{DoxyCompactList}\small\item\em Deallocates all memory that the passed socket uses. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__mod__transport__h_gaf46b8fb4d633dfea7925b3d77e14ff6d}{tr\+\_\+recv}} (const struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}socket, void \texorpdfstring{$\ast$}{*}buf, const size\+\_\+t \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}}, const time\+\_\+t timeout)
\begin{DoxyCompactList}\small\item\em Receives \texorpdfstring{$<$}{<}= len Bytes data from the socket. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__mod__transport__h_ga6a23547b7f3073518d70a3afeac5f41b}{tr\+\_\+send}} (const struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}socket, const void \texorpdfstring{$\ast$}{*}pdu, const size\+\_\+t \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}}, const time\+\_\+t timeout)
\begin{DoxyCompactList}\small\item\em Send \texorpdfstring{$<$}{<}= len Bytes data over the socket. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__mod__transport__h_gad1daaae068ce9e79291f700eb9d9d3ac}{tr\+\_\+send\+\_\+all}} (const struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}socket, const void \texorpdfstring{$\ast$}{*}pdu, const size\+\_\+t \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}}, const time\+\_\+t timeout)
\begin{DoxyCompactList}\small\item\em Repeatedly calls tr\+\_\+send(..) till len Bytes were sent, the timeout expired or an error occurred. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group__mod__transport__h_gaf40abd27c26f3c3820ecd5f945b21cff}{tr\+\_\+recv\+\_\+all}} (const struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}socket, const void \texorpdfstring{$\ast$}{*}buf, const size\+\_\+t \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}}, const time\+\_\+t timeout)
\begin{DoxyCompactList}\small\item\em Repeatedly calls tr\+\_\+recv(..) till len Bytes were received, the timeout expired or an error occurred. \end{DoxyCompactList}\item 
const char \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{group__mod__transport__h_ga8e940b6777ffb33558502558bddbdae8}{tr\+\_\+ident}} (struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}socket)
\begin{DoxyCompactList}\small\item\em Returns an identifier for the socket endpoint, eg host\+:port. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The RTR transport sockets implement the communication channel (e.\+g., SSH, TCP, TCP-\/\+AO) between an RTR server and client. 

Before using the transport socket, a \doxylink{structtr__socket}{tr\+\_\+socket} must be initialized based on a protocol-\/dependent init function (e.\+g., \doxylink{group__mod__tcp__transport__h_ga6335c26aa03290ba3524829574e472e0}{tr\+\_\+tcp\+\_\+init()}).~\newline
The tr\+\_\+\texorpdfstring{$\ast$}{*} functions call the corresponding function pointers, which are passed in the \doxylink{structtr__socket}{tr\+\_\+socket} struct, and forward the remaining arguments. 

\doxysubsection{Macro Definition Documentation}
\Hypertarget{group__mod__transport__h_gac27543eee07496666cd6ebf3487aec40}\label{group__mod__transport__h_gac27543eee07496666cd6ebf3487aec40} 
\index{Transport sockets@{Transport sockets}!RTRLIB\_TRANSPORT\_CONNECT\_TIMEOUT\_DEFAULT@{RTRLIB\_TRANSPORT\_CONNECT\_TIMEOUT\_DEFAULT}}
\index{RTRLIB\_TRANSPORT\_CONNECT\_TIMEOUT\_DEFAULT@{RTRLIB\_TRANSPORT\_CONNECT\_TIMEOUT\_DEFAULT}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{RTRLIB\_TRANSPORT\_CONNECT\_TIMEOUT\_DEFAULT}{RTRLIB\_TRANSPORT\_CONNECT\_TIMEOUT\_DEFAULT}}
{\footnotesize\ttfamily \#define RTRLIB\+\_\+\+TRANSPORT\+\_\+\+CONNECT\+\_\+\+TIMEOUT\+\_\+\+DEFAULT~30}



{\ttfamily \#include $<$\mbox{\hyperlink{transport_8h}{rtrlib/transport/transport.\+h}}$>$}



Default connect timeout. 



\doxysubsection{Typedef Documentation}
\Hypertarget{group__mod__transport__h_gad2efbef8b157cd9484c688d6ef67d6b6}\label{group__mod__transport__h_gad2efbef8b157cd9484c688d6ef67d6b6} 
\index{Transport sockets@{Transport sockets}!tr\_close\_fp@{tr\_close\_fp}}
\index{tr\_close\_fp@{tr\_close\_fp}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_close\_fp}{tr\_close\_fp}}
{\footnotesize\ttfamily typedef void(\texorpdfstring{$\ast$}{*} tr\+\_\+close\+\_\+fp) (void \texorpdfstring{$\ast$}{*}socket)}



{\ttfamily \#include $<$\mbox{\hyperlink{transport_8h}{rtrlib/transport/transport.\+h}}$>$}



A function pointer to a technology specific close function. 

\begin{DoxySeeAlso}{See also}
\doxylink{group__mod__transport__h_ga7d2f6f44da39e272f9ec1026ba9a630d}{tr\+\_\+close} 
\end{DoxySeeAlso}
\Hypertarget{group__mod__transport__h_ga333a8d2d3a3dea54a36034c026d0a054}\label{group__mod__transport__h_ga333a8d2d3a3dea54a36034c026d0a054} 
\index{Transport sockets@{Transport sockets}!tr\_free\_fp@{tr\_free\_fp}}
\index{tr\_free\_fp@{tr\_free\_fp}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_free\_fp}{tr\_free\_fp}}
{\footnotesize\ttfamily typedef void(\texorpdfstring{$\ast$}{*} tr\+\_\+free\+\_\+fp) (struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}tr\+\_\+sock)}



{\ttfamily \#include $<$\mbox{\hyperlink{transport_8h}{rtrlib/transport/transport.\+h}}$>$}



A function pointer to a technology specific free function. 

All memory associated with the \doxylink{structtr__socket}{tr\+\_\+socket} will be freed. \begin{DoxySeeAlso}{See also}
\doxylink{group__mod__transport__h_ga1e7044b71e93ae593bb8fc5d43a03e6f}{tr\+\_\+free} 
\end{DoxySeeAlso}
\Hypertarget{group__mod__transport__h_ga02f9d37bf7e41a8990b74af6653cae6c}\label{group__mod__transport__h_ga02f9d37bf7e41a8990b74af6653cae6c} 
\index{Transport sockets@{Transport sockets}!tr\_ident\_fp@{tr\_ident\_fp}}
\index{tr\_ident\_fp@{tr\_ident\_fp}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_ident\_fp}{tr\_ident\_fp}}
{\footnotesize\ttfamily typedef const char \texorpdfstring{$\ast$}{*}(\texorpdfstring{$\ast$}{*} tr\+\_\+ident\+\_\+fp) (void \texorpdfstring{$\ast$}{*}socket)}



{\ttfamily \#include $<$\mbox{\hyperlink{transport_8h}{rtrlib/transport/transport.\+h}}$>$}



A function pointer to a technology specific info function. 

\begin{DoxySeeAlso}{See also}
\doxylink{group__mod__transport__h_ga6a23547b7f3073518d70a3afeac5f41b}{tr\+\_\+send} 
\end{DoxySeeAlso}
\Hypertarget{group__mod__transport__h_ga615d56abf17d32924155fcf0ccc2664c}\label{group__mod__transport__h_ga615d56abf17d32924155fcf0ccc2664c} 
\index{Transport sockets@{Transport sockets}!tr\_open\_fp@{tr\_open\_fp}}
\index{tr\_open\_fp@{tr\_open\_fp}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_open\_fp}{tr\_open\_fp}}
{\footnotesize\ttfamily typedef int(\texorpdfstring{$\ast$}{*} tr\+\_\+open\+\_\+fp) (void \texorpdfstring{$\ast$}{*}socket)}



{\ttfamily \#include $<$\mbox{\hyperlink{transport_8h}{rtrlib/transport/transport.\+h}}$>$}



A function pointer to a technology specific open function. 

\begin{DoxySeeAlso}{See also}
\doxylink{group__mod__transport__h_ga9a56327f186f88ad78edd7304fa254d9}{tr\+\_\+open} 
\end{DoxySeeAlso}
\Hypertarget{group__mod__transport__h_ga257bfa5c831410f1034edaa9b79f303c}\label{group__mod__transport__h_ga257bfa5c831410f1034edaa9b79f303c} 
\index{Transport sockets@{Transport sockets}!tr\_recv\_fp@{tr\_recv\_fp}}
\index{tr\_recv\_fp@{tr\_recv\_fp}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_recv\_fp}{tr\_recv\_fp}}
{\footnotesize\ttfamily typedef int(\texorpdfstring{$\ast$}{*} tr\+\_\+recv\+\_\+fp) (const void \texorpdfstring{$\ast$}{*}socket, void \texorpdfstring{$\ast$}{*}pdu, const size\+\_\+t \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}}, const time\+\_\+t timeout)}



{\ttfamily \#include $<$\mbox{\hyperlink{transport_8h}{rtrlib/transport/transport.\+h}}$>$}



A function pointer to a technology specific recv function. 

\begin{DoxySeeAlso}{See also}
\doxylink{group__mod__transport__h_gaf46b8fb4d633dfea7925b3d77e14ff6d}{tr\+\_\+recv} 
\end{DoxySeeAlso}
\Hypertarget{group__mod__transport__h_gadc6f1fbce8f7557edd50070069afc0c6}\label{group__mod__transport__h_gadc6f1fbce8f7557edd50070069afc0c6} 
\index{Transport sockets@{Transport sockets}!tr\_send\_fp@{tr\_send\_fp}}
\index{tr\_send\_fp@{tr\_send\_fp}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_send\_fp}{tr\_send\_fp}}
{\footnotesize\ttfamily typedef int(\texorpdfstring{$\ast$}{*} tr\+\_\+send\+\_\+fp) (const void \texorpdfstring{$\ast$}{*}socket, const void \texorpdfstring{$\ast$}{*}pdu, const size\+\_\+t \mbox{\hyperlink{rtr__pdus_8h_a96bbf959016e4411c9e6b9812a8be60a}{len}}, const time\+\_\+t timeout)}



{\ttfamily \#include $<$\mbox{\hyperlink{transport_8h}{rtrlib/transport/transport.\+h}}$>$}



A function pointer to a technology specific send function. 

\begin{DoxySeeAlso}{See also}
\doxylink{group__mod__transport__h_ga6a23547b7f3073518d70a3afeac5f41b}{tr\+\_\+send} 
\end{DoxySeeAlso}


\doxysubsection{Enumeration Type Documentation}
\Hypertarget{group__mod__transport__h_ga4493c1dcecd61a8f10a71912f29d2087}\label{group__mod__transport__h_ga4493c1dcecd61a8f10a71912f29d2087} 
\index{Transport sockets@{Transport sockets}!tr\_rtvals@{tr\_rtvals}}
\index{tr\_rtvals@{tr\_rtvals}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_rtvals}{tr\_rtvals}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{group__mod__transport__h_ga4493c1dcecd61a8f10a71912f29d2087}{tr\+\_\+rtvals}}}



{\ttfamily \#include $<$\mbox{\hyperlink{transport_8h}{rtrlib/transport/transport.\+h}}$>$}



The return values for tr\+\_\+ functions. 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{TR\_SUCCESS@{TR\_SUCCESS}!Transport sockets@{Transport sockets}}\index{Transport sockets@{Transport sockets}!TR\_SUCCESS@{TR\_SUCCESS}}}\Hypertarget{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087afbed3f5722747b105d734585aa0fcba2}\label{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087afbed3f5722747b105d734585aa0fcba2} 
TR\+\_\+\+SUCCESS&Operation was successful. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TR\_ERROR@{TR\_ERROR}!Transport sockets@{Transport sockets}}\index{Transport sockets@{Transport sockets}!TR\_ERROR@{TR\_ERROR}}}\Hypertarget{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a073c7a28c0dd674b0635178112536a2f}\label{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a073c7a28c0dd674b0635178112536a2f} 
TR\+\_\+\+ERROR&Error occurred. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TR\_WOULDBLOCK@{TR\_WOULDBLOCK}!Transport sockets@{Transport sockets}}\index{Transport sockets@{Transport sockets}!TR\_WOULDBLOCK@{TR\_WOULDBLOCK}}}\Hypertarget{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a9cb0eee91bb5e932bbe89c2f12daadb5}\label{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a9cb0eee91bb5e932bbe89c2f12daadb5} 
TR\+\_\+\+WOULDBLOCK&No data is available on the socket. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TR\_INTR@{TR\_INTR}!Transport sockets@{Transport sockets}}\index{Transport sockets@{Transport sockets}!TR\_INTR@{TR\_INTR}}}\Hypertarget{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a15019d7ece9eed5882a70243bbdfc0d8}\label{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a15019d7ece9eed5882a70243bbdfc0d8} 
TR\+\_\+\+INTR&Call was interrupted from a signal. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{TR\_CLOSED@{TR\_CLOSED}!Transport sockets@{Transport sockets}}\index{Transport sockets@{Transport sockets}!TR\_CLOSED@{TR\_CLOSED}}}\Hypertarget{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a347014cc5da178db6cc3970d6e160694}\label{group__mod__transport__h_gga4493c1dcecd61a8f10a71912f29d2087a347014cc5da178db6cc3970d6e160694} 
TR\+\_\+\+CLOSED&Connection closed. \\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\Hypertarget{group__mod__transport__h_ga7d2f6f44da39e272f9ec1026ba9a630d}\label{group__mod__transport__h_ga7d2f6f44da39e272f9ec1026ba9a630d} 
\index{Transport sockets@{Transport sockets}!tr\_close@{tr\_close}}
\index{tr\_close@{tr\_close}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_close()}{tr\_close()}}
{\footnotesize\ttfamily void tr\+\_\+close (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}}]{socket }\end{DoxyParamCaption})}



{\ttfamily \#include $<$\mbox{\hyperlink{transport__private_8h}{rtrlib/transport/transport\+\_\+private.\+h}}$>$}



Close the socket connection. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em socket} & Socket that will be closed. \\
\hline
\end{DoxyParams}
\Hypertarget{group__mod__transport__h_ga1e7044b71e93ae593bb8fc5d43a03e6f}\label{group__mod__transport__h_ga1e7044b71e93ae593bb8fc5d43a03e6f} 
\index{Transport sockets@{Transport sockets}!tr\_free@{tr\_free}}
\index{tr\_free@{tr\_free}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_free()}{tr\_free()}}
{\footnotesize\ttfamily void tr\+\_\+free (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}}]{socket }\end{DoxyParamCaption})}



{\ttfamily \#include $<$\mbox{\hyperlink{transport__private_8h}{rtrlib/transport/transport\+\_\+private.\+h}}$>$}



Deallocates all memory that the passed socket uses. 

Socket have to be closed before. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em socket} & which will be freed. \\
\hline
\end{DoxyParams}
\Hypertarget{group__mod__transport__h_ga8e940b6777ffb33558502558bddbdae8}\label{group__mod__transport__h_ga8e940b6777ffb33558502558bddbdae8} 
\index{Transport sockets@{Transport sockets}!tr\_ident@{tr\_ident}}
\index{tr\_ident@{tr\_ident}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_ident()}{tr\_ident()}}
{\footnotesize\ttfamily const char \texorpdfstring{$\ast$}{*} tr\+\_\+ident (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}}]{socket }\end{DoxyParamCaption})}



{\ttfamily \#include $<$\mbox{\hyperlink{transport__private_8h}{rtrlib/transport/transport\+\_\+private.\+h}}$>$}



Returns an identifier for the socket endpoint, eg host\+:port. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em socket} & return Pointer to a \textbackslash{}0 terminated String return NULL on error \\
\hline
\end{DoxyParams}
\Hypertarget{group__mod__transport__h_ga9a56327f186f88ad78edd7304fa254d9}\label{group__mod__transport__h_ga9a56327f186f88ad78edd7304fa254d9} 
\index{Transport sockets@{Transport sockets}!tr\_open@{tr\_open}}
\index{tr\_open@{tr\_open}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_open()}{tr\_open()}}
{\footnotesize\ttfamily int tr\+\_\+open (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}}]{socket }\end{DoxyParamCaption})}



{\ttfamily \#include $<$\mbox{\hyperlink{transport__private_8h}{rtrlib/transport/transport\+\_\+private.\+h}}$>$}



Establish the connection. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em socket} & Socket that will be used. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
TR\+\_\+\+SUCCESS On success. 

TR\+\_\+\+ERROR On error. 
\end{DoxyReturn}
\Hypertarget{group__mod__transport__h_gaf46b8fb4d633dfea7925b3d77e14ff6d}\label{group__mod__transport__h_gaf46b8fb4d633dfea7925b3d77e14ff6d} 
\index{Transport sockets@{Transport sockets}!tr\_recv@{tr\_recv}}
\index{tr\_recv@{tr\_recv}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_recv()}{tr\_recv()}}
{\footnotesize\ttfamily int tr\+\_\+recv (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}}]{socket,  }\item[{void \texorpdfstring{$\ast$}{*}}]{buf,  }\item[{const size\+\_\+t}]{len,  }\item[{const time\+\_\+t}]{timeout }\end{DoxyParamCaption})}



{\ttfamily \#include $<$\mbox{\hyperlink{transport__private_8h}{rtrlib/transport/transport\+\_\+private.\+h}}$>$}



Receives \texorpdfstring{$<$}{<}= len Bytes data from the socket. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em socket} & Socket that will be used. \\
\hline
\mbox{\texttt{ out}}  & {\em buf} & Received data, must be an allocated memory area of \texorpdfstring{$>$}{>}=pdu\+\_\+len bytes. \\
\hline
\mbox{\texttt{ in}}  & {\em len} & Size of pdu in Bytes. \\
\hline
\mbox{\texttt{ in}}  & {\em timeout} & Max. seconds the function will block till len data was received. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\texorpdfstring{$>$}{>}0 Number of Bytes read. 

TR\+\_\+\+ERROR On error. 

TR\+\_\+\+WOULDBLOCK If no data was available at the socket before the timeout expired. 
\end{DoxyReturn}
\Hypertarget{group__mod__transport__h_gaf40abd27c26f3c3820ecd5f945b21cff}\label{group__mod__transport__h_gaf40abd27c26f3c3820ecd5f945b21cff} 
\index{Transport sockets@{Transport sockets}!tr\_recv\_all@{tr\_recv\_all}}
\index{tr\_recv\_all@{tr\_recv\_all}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_recv\_all()}{tr\_recv\_all()}}
{\footnotesize\ttfamily int tr\+\_\+recv\+\_\+all (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}}]{socket,  }\item[{const void \texorpdfstring{$\ast$}{*}}]{buf,  }\item[{const size\+\_\+t}]{len,  }\item[{const time\+\_\+t}]{timeout }\end{DoxyParamCaption})}



{\ttfamily \#include $<$\mbox{\hyperlink{transport__private_8h}{rtrlib/transport/transport\+\_\+private.\+h}}$>$}



Repeatedly calls tr\+\_\+recv(..) till len Bytes were received, the timeout expired or an error occurred. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em socket} & Socket that will be used. \\
\hline
\mbox{\texttt{ out}}  & {\em buf} & Received data, must be an allocated memory area of \texorpdfstring{$>$}{>}=len bytes. \\
\hline
\mbox{\texttt{ in}}  & {\em len} & Size of pdu in Bytes. \\
\hline
\mbox{\texttt{ in}}  & {\em timeout} & Max. seconds the functions should try to receive len data till it returns. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\texorpdfstring{$>$}{>}0 Number of Bytes received. 

TR\+\_\+\+ERROR On error. 

TR\+\_\+\+WOULDBLOCK If send would block. 
\end{DoxyReturn}
\Hypertarget{group__mod__transport__h_ga6a23547b7f3073518d70a3afeac5f41b}\label{group__mod__transport__h_ga6a23547b7f3073518d70a3afeac5f41b} 
\index{Transport sockets@{Transport sockets}!tr\_send@{tr\_send}}
\index{tr\_send@{tr\_send}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_send()}{tr\_send()}}
{\footnotesize\ttfamily int tr\+\_\+send (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}}]{socket,  }\item[{const void \texorpdfstring{$\ast$}{*}}]{pdu,  }\item[{const size\+\_\+t}]{len,  }\item[{const time\+\_\+t}]{timeout }\end{DoxyParamCaption})}



{\ttfamily \#include $<$\mbox{\hyperlink{transport__private_8h}{rtrlib/transport/transport\+\_\+private.\+h}}$>$}



Send \texorpdfstring{$<$}{<}= len Bytes data over the socket. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em socket} & Socket that will be used. \\
\hline
\mbox{\texttt{ out}}  & {\em pdu} & Data that will be be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em len} & Size of pdu in Bytes. \\
\hline
\mbox{\texttt{ in}}  & {\em timeout} & Max. seconds the function should try to send the data till it returns. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\texorpdfstring{$>$}{>}0 Number of Bytes sent. 

TR\+\_\+\+ERROR On error. 
\end{DoxyReturn}
\Hypertarget{group__mod__transport__h_gad1daaae068ce9e79291f700eb9d9d3ac}\label{group__mod__transport__h_gad1daaae068ce9e79291f700eb9d9d3ac} 
\index{Transport sockets@{Transport sockets}!tr\_send\_all@{tr\_send\_all}}
\index{tr\_send\_all@{tr\_send\_all}!Transport sockets@{Transport sockets}}
\doxysubsubsection{\texorpdfstring{tr\_send\_all()}{tr\_send\_all()}}
{\footnotesize\ttfamily int tr\+\_\+send\+\_\+all (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtr__socket}{tr\+\_\+socket}} \texorpdfstring{$\ast$}{*}}]{socket,  }\item[{const void \texorpdfstring{$\ast$}{*}}]{pdu,  }\item[{const size\+\_\+t}]{len,  }\item[{const time\+\_\+t}]{timeout }\end{DoxyParamCaption})}



{\ttfamily \#include $<$\mbox{\hyperlink{transport__private_8h}{rtrlib/transport/transport\+\_\+private.\+h}}$>$}



Repeatedly calls tr\+\_\+send(..) till len Bytes were sent, the timeout expired or an error occurred. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em socket} & Socket that will be used. \\
\hline
\mbox{\texttt{ out}}  & {\em pdu} & Data that will be be sent. \\
\hline
\mbox{\texttt{ in}}  & {\em len} & Size of pdu in Bytes. \\
\hline
\mbox{\texttt{ in}}  & {\em timeout} & Max. seconds the functions should try to send pdu till it returns. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\texorpdfstring{$>$}{>}0 Number of Bytes sent. 

TR\+\_\+\+ERROR On Error. 

TR\+\_\+\+WOULDBLOCK If send would block. 
\end{DoxyReturn}
\input{group__mod__ssh__transport__h}
\input{group__mod__tcp__transport__h}
