\doxysection{Osmocom Stream Socket} \label{group__stream}\index{Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsection*{Files} \begin{DoxyCompactItemize} \item file \textbf{ stream.\+c} \begin{DoxyCompactList}\small\item\em Osmocom stream socket helpers. \end{DoxyCompactList}\item file \textbf{ stream\+\_\+cli.\+c} \begin{DoxyCompactList}\small\item\em Osmocom stream socket helpers (client side) \end{DoxyCompactList}\item file \textbf{ stream\+\_\+srv.\+c} \begin{DoxyCompactList}\small\item\em Osmocom stream socket helpers (server side) \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection*{Data Structures} \begin{DoxyCompactItemize} \item struct \textbf{ osmo\+\_\+stream\+\_\+cli} \item struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} \item struct \textbf{ osmo\+\_\+stream\+\_\+srv} \end{DoxyCompactItemize} \doxysubsection*{Macros} \begin{DoxyCompactItemize} \item \mbox{\label{group__stream_ga123b7866ed4985a81246bfede79a8ea9}} \#define {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+SCTP\+\_\+\+MSG\+\_\+\+FLAGS\+\_\+\+NOTIFICATION}~0x80 /$\ast$ sctp\+\_\+recvmsg() flags=MSG\+\_\+\+NOTIFICATION, msgb\+\_\+data() contains \char`\"{}union sctp\+\_\+notification$\ast$\char`\"{} $\ast$/ \begin{DoxyCompactList}\small\item\em Access SCTP flags from the msgb control buffer. \end{DoxyCompactList}\item \mbox{\label{group__stream_ga745784ba45ae5d91e4bce0ed2acbe57f}} \#define {\bfseries msgb\+\_\+sctp\+\_\+msg\+\_\+flags}(msg)~(msg)-\/$>$cb[2] \item \mbox{\label{group__stream_ga2693c0cc5c6222dd9ed42c8c4bf8aec8}} \#define {\bfseries msgb\+\_\+sctp\+\_\+ppid}(msg)~(msg)-\/$>$cb[3] \begin{DoxyCompactList}\small\item\em Access the SCTP PPID from the msgb control buffer. \end{DoxyCompactList}\item \mbox{\label{group__stream_gac2c359892ad63309b59a4b402f6a3e81}} \#define {\bfseries msgb\+\_\+sctp\+\_\+stream}(msg)~(msg)-\/$>$cb[4] \begin{DoxyCompactList}\small\item\em Access the SCTP Stream ID from the msgb control buffer. \end{DoxyCompactList}\item \#define \textbf{ LOGSCLI}(cli, level, fmt, args...) \item \mbox{\label{group__stream_gae24e1d7bb86fa7bd90b7f38e0c686119}} \#define {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+CLI\+\_\+\+F\+\_\+\+RECONF}~(1 $<$$<$ 0) \item \mbox{\label{group__stream_gaccd8b711532f890d484fb9099f555855}} \#define {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+CLI\+\_\+\+F\+\_\+\+NODELAY}~(1 $<$$<$ 1) \item \#define \textbf{ LOGSLNK}(link, level, fmt, args...) \item \#define \textbf{ LOGSSRV}(srv, level, fmt, args...) \item \mbox{\label{group__stream_gaf1646f040c66d93634755e299dee3ec2}} \#define {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+SRV\+\_\+\+F\+\_\+\+RECONF}~(1 $<$$<$ 0) \item \mbox{\label{group__stream_gaeec66e7d4031dc9606558e6692a805ba}} \#define {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+SRV\+\_\+\+F\+\_\+\+NODELAY}~(1 $<$$<$ 1) \item \mbox{\label{group__stream_ga3ef7f446bbf20daa6188bdaade5b2e94}} \#define {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+SRV\+\_\+\+F\+\_\+\+FLUSH\+\_\+\+DESTROY}~(1 $<$$<$ 0) \end{DoxyCompactItemize} \doxysubsection*{Enumerations} \begin{DoxyCompactItemize} \item \mbox{\label{group__stream_ga4448bfb5af99a9b949c0fe2a23e0806c}} enum {\bfseries osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+param} \{ {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+SRV\+\_\+\+LINK\+\_\+\+PAR\+\_\+\+SCTP\+\_\+\+SOCKOPT\+\_\+\+AUTH\+\_\+\+SUPPORTED} , {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+SRV\+\_\+\+LINK\+\_\+\+PAR\+\_\+\+SCTP\+\_\+\+SOCKOPT\+\_\+\+ASCONF\+\_\+\+SUPPORTED} , {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+SRV\+\_\+\+LINK\+\_\+\+PAR\+\_\+\+SCTP\+\_\+\+INIT\+\_\+\+NUM\+\_\+\+OSTREAMS} , {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+SRV\+\_\+\+LINK\+\_\+\+PAR\+\_\+\+SCTP\+\_\+\+INIT\+\_\+\+MAX\+\_\+\+INSTREAMS} \} \item \mbox{\label{group__stream_ga72a162cb959f4d3145087e076800b816}} enum {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+param} \{ \newline {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+CLI\+\_\+\+PAR\+\_\+\+SCTP\+\_\+\+SOCKOPT\+\_\+\+AUTH\+\_\+\+SUPPORTED} , {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+CLI\+\_\+\+PAR\+\_\+\+SCTP\+\_\+\+SOCKOPT\+\_\+\+ASCONF\+\_\+\+SUPPORTED} , {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+CLI\+\_\+\+PAR\+\_\+\+SCTP\+\_\+\+INIT\+\_\+\+NUM\+\_\+\+OSTREAMS} , {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+CLI\+\_\+\+PAR\+\_\+\+SCTP\+\_\+\+INIT\+\_\+\+MAX\+\_\+\+INSTREAMS} , \newline {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+CLI\+\_\+\+PAR\+\_\+\+SCTP\+\_\+\+INIT\+\_\+\+MAX\+\_\+\+ATTEMPTS} , {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+CLI\+\_\+\+PAR\+\_\+\+SCTP\+\_\+\+INIT\+\_\+\+TIMEOUT} \} \item \mbox{\label{group__stream_ga6c6413e0d581e150712c9f8145d0390e}} enum {\bfseries osmo\+\_\+stream\+\_\+mode} \{ {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+MODE\+\_\+\+UNKNOWN} , {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+MODE\+\_\+\+OSMO\+\_\+\+FD} , {\bfseries OSMO\+\_\+\+STREAM\+\_\+\+MODE\+\_\+\+OSMO\+\_\+\+IO} \} \item \mbox{\label{group__stream_gaefb240abea020971d9a384b5e39826e5}} enum {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+state} \{ \newline {\bfseries STREAM\+\_\+\+CLI\+\_\+\+STATE\+\_\+\+CLOSED} , {\bfseries STREAM\+\_\+\+CLI\+\_\+\+STATE\+\_\+\+WAIT\+\_\+\+RECONNECT} , {\bfseries STREAM\+\_\+\+CLI\+\_\+\+STATE\+\_\+\+CONNECTING} , {\bfseries STREAM\+\_\+\+CLI\+\_\+\+STATE\+\_\+\+CONNECTED} , \newline {\bfseries STREAM\+\_\+\+CLI\+\_\+\+STATE\+\_\+\+MAX} \} \end{DoxyCompactItemize} \doxysubsection*{Functions} \begin{DoxyCompactItemize} \item struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$ \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+create} (void $\ast$ctx) \begin{DoxyCompactList}\small\item\em Create an Osmocom Stream Server Link A Stream Server Link is the listen()+accept() \char`\"{}parent\char`\"{} to individual Stream Servers. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+destroy} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link) \begin{DoxyCompactList}\small\item\em Destroy the stream server link. Closes + Releases Memory. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+name} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, const char $\ast$name) \begin{DoxyCompactList}\small\item\em Set a name on the srv\+\_\+link object (used during logging) \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+nodelay} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, bool nodelay) \begin{DoxyCompactList}\small\item\em Set the NODELAY socket option to avoid Nagle-\/like behavior Setting this to nodelay=true will automatically set the NODELAY socket option on any socket established via this server link, before calling the accept\+\_\+cb() \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+addr} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, const char $\ast$addr) \begin{DoxyCompactList}\small\item\em Set the local address to which we bind. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+addrs} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, const char $\ast$$\ast$addr, size\+\_\+t addrcnt) \begin{DoxyCompactList}\small\item\em Set the local address set to which we bind. Useful for protocols allowing bind on more than one address (such as SCTP) \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+port} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, uint16\+\_\+t port) \begin{DoxyCompactList}\small\item\em Set the local port number to which we bind. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+proto} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, uint16\+\_\+t proto) \begin{DoxyCompactList}\small\item\em Set the protocol for the stream server link. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+type} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, int type) \begin{DoxyCompactList}\small\item\em Set the socket type for the stream server link. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+domain} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, int domain) \begin{DoxyCompactList}\small\item\em Set the socket type for the stream server link. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+accept\+\_\+cb} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, int($\ast$accept\+\_\+cb)(struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, int fd)) \begin{DoxyCompactList}\small\item\em Set the accept() call-\/back of the stream server link. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+data} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, void $\ast$data) \begin{DoxyCompactList}\small\item\em Set application private data of the stream server link. \end{DoxyCompactList}\item void $\ast$ \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+get\+\_\+data} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link) \begin{DoxyCompactList}\small\item\em Get application private data of the stream server link. \end{DoxyCompactList}\item char $\ast$ \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+get\+\_\+sockname} (const struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link) \begin{DoxyCompactList}\small\item\em Get description of the stream server link e. g. 127.\+0.\+0.\+1\+:1234. \end{DoxyCompactList}\item struct osmo\+\_\+fd $\ast$ \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+get\+\_\+ofd} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link) \begin{DoxyCompactList}\small\item\em Get Osmocom File Descriptor of the stream server link. \end{DoxyCompactList}\item bool \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+is\+\_\+opened} (const struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link) \begin{DoxyCompactList}\small\item\em Check whether the stream server link is opened. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+open} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link) \begin{DoxyCompactList}\small\item\em Open the stream server link. This actually initializes the underlying socket and binds it to the configured ip/port. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+close} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link) \begin{DoxyCompactList}\small\item\em Close the stream server link and unregister from select loop Does not destroy the server link, merely closes it! \end{DoxyCompactList}\item \mbox{\label{group__stream_ga759bceb4ce155f88e3e7817ce4c9449d}} int {\bfseries osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+param} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, enum osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+param par, void $\ast$val, size\+\_\+t val\+\_\+len) \item struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$ \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+create} (void $\ast$ctx, struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, int fd, int($\ast$read\+\_\+cb)(struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn), int($\ast$closed\+\_\+cb)(struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn), void $\ast$data) \begin{DoxyCompactList}\small\item\em Create a Stream Server inside the specified link. \end{DoxyCompactList}\item struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$ \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+create2} (void $\ast$ctx, struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, int fd, void $\ast$data) \begin{DoxyCompactList}\small\item\em Create a Stream Server inside the specified link. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+name} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn, const char $\ast$name) \begin{DoxyCompactList}\small\item\em Set a name on the srv object (used during logging) \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+read\+\_\+cb} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn, int($\ast$read\+\_\+cb)(struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn, struct msgb $\ast$msg)) \begin{DoxyCompactList}\small\item\em Set the call-\/back function when data was read from the stream server socket Only for \doxyref{osmo\+\_\+stream\+\_\+srv}{p.}{structosmo__stream__srv} created with \doxyref{osmo\+\_\+stream\+\_\+srv\+\_\+create2()}{p.}{group__stream_ga8be283e1a143e346b4d6ccf33cbb9b98} \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+closed\+\_\+cb} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn, int($\ast$closed\+\_\+cb)(struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn)) \begin{DoxyCompactList}\small\item\em Set the call-\/back function called when the stream server socket was closed. \end{DoxyCompactList}\item void $\ast$ \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+get\+\_\+data} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn) \begin{DoxyCompactList}\small\item\em Get application private data of the stream server. \end{DoxyCompactList}\item struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$ \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+get\+\_\+master} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn) \begin{DoxyCompactList}\small\item\em Get the master (Link) from a Stream Server. \end{DoxyCompactList}\item struct osmo\+\_\+fd $\ast$ \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+get\+\_\+ofd} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn) \begin{DoxyCompactList}\small\item\em Get Osmocom File Descriptor of the stream server. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+destroy} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn) \begin{DoxyCompactList}\small\item\em Destroy given Stream Server This function closes the Stream Server socket, unregisters from select loop, invokes the connection\textquotesingle{}s closed\+\_\+cb() callback to allow API users to clean up any associated state they have for this connection, and then de-\/allocates associated memory. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+flush\+\_\+and\+\_\+destroy} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn) \begin{DoxyCompactList}\small\item\em Prepare to send out all pending messages on the connection\textquotesingle{}s Tx queue and then automatically destroy the stream with \doxyref{osmo\+\_\+stream\+\_\+srv\+\_\+destroy()}{p.}{group__stream_ga47f18e063f64f22cb74d58d8b7243bed}. This function disables queuing of new messages on the connection and also disables reception of new messages on the connection. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+data} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn, void $\ast$data) \begin{DoxyCompactList}\small\item\em Set application private data of the stream server. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+segmentation\+\_\+cb} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn, int($\ast$segmentation\+\_\+cb)(struct msgb $\ast$msg)) \begin{DoxyCompactList}\small\item\em Set the segmentation callback for target \doxyref{osmo\+\_\+stream\+\_\+srv}{p.}{structosmo__stream__srv} structure. The connection has to have been established prior to calling this function. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+send} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn, struct msgb $\ast$msg) \begin{DoxyCompactList}\small\item\em Enqueue data to be sent via an Osmocom stream server. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+recv} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn, struct msgb $\ast$msg) \begin{DoxyCompactList}\small\item\em Receive data via Osmocom stream server. \end{DoxyCompactList}\item \mbox{\label{group__stream_ga4a830f1d9990deb5b9b58f68927cefeb}} void {\bfseries osmo\+\_\+stream\+\_\+srv\+\_\+clear\+\_\+tx\+\_\+queue} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn) \item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+name} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, const char $\ast$name) \begin{DoxyCompactList}\small\item\em Set a name on the cli object (used during logging) \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+nodelay} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, bool nodelay) \begin{DoxyCompactList}\small\item\em Set the NODELAY socket option to avoid Nagle-\/like behavior Setting this to nodelay=true will automatically set the NODELAY socket option on any socket established via \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+open}{p.}{group__stream_ga86b4b9c8e563f8426d3cdae803e3ec38} or any re-\/connect. You have to set this {\itshape before} opening the socket. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+addr} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, const char $\ast$addr) \begin{DoxyCompactList}\small\item\em Set the remote address to which we connect. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+addrs} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, const char $\ast$$\ast$addr, size\+\_\+t addrcnt) \begin{DoxyCompactList}\small\item\em Set the remote address set to which we connect. Useful for protocols allowing connecting to more than one address (such as SCTP) \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+port} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, uint16\+\_\+t port) \begin{DoxyCompactList}\small\item\em Set the remote port number to which we connect. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+type} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, int type) \begin{DoxyCompactList}\small\item\em Set the socket type for the stream server link. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+domain} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, int domain) \begin{DoxyCompactList}\small\item\em Set the socket type for the stream server link. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+proto} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, uint16\+\_\+t proto) \begin{DoxyCompactList}\small\item\em Set the protocol for the stream client socket. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+local\+\_\+addr} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, const char $\ast$addr) \begin{DoxyCompactList}\small\item\em Set the local address for the socket (to be bound to) \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+local\+\_\+addrs} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, const char $\ast$$\ast$addr, size\+\_\+t addrcnt) \begin{DoxyCompactList}\small\item\em Set the local address set to which we connect. Useful for protocols allowing bind to more than one address (such as SCTP) \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+local\+\_\+port} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, uint16\+\_\+t port) \begin{DoxyCompactList}\small\item\em Set the local port number for the socket (to be bound to) \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+data} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, void $\ast$data) \begin{DoxyCompactList}\small\item\em Set application private data of the stream client socket. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+reconnect\+\_\+timeout} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, int timeout) \begin{DoxyCompactList}\small\item\em Set the reconnect time of the stream client socket. \end{DoxyCompactList}\item void $\ast$ \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+get\+\_\+data} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \begin{DoxyCompactList}\small\item\em Get application private data of the stream client socket. \end{DoxyCompactList}\item char $\ast$ \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+get\+\_\+sockname} (const struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \begin{DoxyCompactList}\small\item\em Get the stream client socket description. \end{DoxyCompactList}\item struct osmo\+\_\+fd $\ast$ \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+get\+\_\+ofd} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \begin{DoxyCompactList}\small\item\em Get Osmocom File Descriptor of the stream client socket. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+connect\+\_\+cb} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, int($\ast$connect\+\_\+cb)(struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli)) \begin{DoxyCompactList}\small\item\em Set the call-\/back function called on connect of the stream client socket. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+disconnect\+\_\+cb} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, int($\ast$disconnect\+\_\+cb)(struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli)) \begin{DoxyCompactList}\small\item\em Set the call-\/back function called on disconnect of the stream client socket. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+read\+\_\+cb} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, int($\ast$read\+\_\+cb)(struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli)) \begin{DoxyCompactList}\small\item\em Set the call-\/back function called to read from the stream client socket This function will configure \doxyref{osmo\+\_\+stream\+\_\+cli}{p.}{structosmo__stream__cli} to use osmo\+\_\+ofd internally. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+read\+\_\+cb2} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, int($\ast$read\+\_\+cb)(struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, struct msgb $\ast$msg)) \begin{DoxyCompactList}\small\item\em Set the call-\/back function called to read from the stream client socket This function will configure \doxyref{osmo\+\_\+stream\+\_\+cli}{p.}{structosmo__stream__cli} to use osmo\+\_\+iofd internally. \end{DoxyCompactList}\item \mbox{\label{group__stream_ga11d2615f6197f33073ba7245e5ba95ee}} void {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+reconnect} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \begin{DoxyCompactList}\small\item\em Re-\/connect an Osmocom Stream Client If re-\/connection is enabled for this client (which is the case unless negative timeout was explicitly set via \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+reconnect\+\_\+timeout()}{p.}{group__stream_gade74792afe35f31dd2584c888db3dd62} call), we close any existing connection (if any) and schedule a re-\/connect timer. \end{DoxyCompactList}\item bool \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+is\+\_\+connected} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \begin{DoxyCompactList}\small\item\em Check if Osmocom Stream Client is in connected state. \end{DoxyCompactList}\item struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$ \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+create} (void $\ast$ctx) \begin{DoxyCompactList}\small\item\em Create an Osmocom stream client. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+destroy} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \begin{DoxyCompactList}\small\item\em Destroy a Osmocom stream client (includes close) \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+open} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \begin{DoxyCompactList}\small\item\em Open connection of an Osmocom stream client By default the client will automatically reconnect after default timeout. To disable this, use \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+reconnect\+\_\+timeout()}{p.}{group__stream_gade74792afe35f31dd2584c888db3dd62} before calling this function. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+open2} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, int reconnect) \begin{DoxyCompactList}\small\item\em DEPRECATED\+: use \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+reconnect\+\_\+timeout()}{p.}{group__stream_gade74792afe35f31dd2584c888db3dd62} or \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+reconnect()}{p.}{group__stream_ga11d2615f6197f33073ba7245e5ba95ee} instead! Open connection of an Osmocom stream client. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+close} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \begin{DoxyCompactList}\small\item\em Close an Osmocom Stream Client. \end{DoxyCompactList}\item void \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+send} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, struct msgb $\ast$msg) \begin{DoxyCompactList}\small\item\em Enqueue data to be sent via an Osmocom stream client. \end{DoxyCompactList}\item int \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+recv} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, struct msgb $\ast$msg) \begin{DoxyCompactList}\small\item\em Receive data via an Osmocom stream client. \end{DoxyCompactList}\item \mbox{\label{group__stream_gafa39b1dcc139ad12cbc38d51049bf14f}} void {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+clear\+\_\+tx\+\_\+queue} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \item \mbox{\label{group__stream_ga0638e98001fa4bdd36533718472dfac7}} int {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+param} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, enum osmo\+\_\+stream\+\_\+cli\+\_\+param par, void $\ast$val, size\+\_\+t val\+\_\+len) \item \mbox{\label{group__stream_ga24ddeae7649dfa70f8e227ed7049a4ae}} int {\bfseries stream\+\_\+sctp\+\_\+sock\+\_\+activate\+\_\+events} (int fd) \item \mbox{\label{group__stream_gae3bb8dda8c9ef10538d5841d3f289c4a}} int {\bfseries stream\+\_\+setsockopt\+\_\+nodelay} (int fd, int proto, int on) \item \mbox{\label{group__stream_gaa2731510b111a2ebb5ac8214ab167437}} int {\bfseries stream\+\_\+sctp\+\_\+recvmsg\+\_\+wrapper} (int fd, struct msgb $\ast$msg, const char $\ast$log\+\_\+pfx) \item \mbox{\label{group__stream_ga83e9c9dc2f24f0de95e71a98fbb1ff1e}} static void {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+close\+\_\+iofd} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \item \mbox{\label{group__stream_gafe250e03fa200c939b2ef69a138f0bc9}} static void {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+close\+\_\+ofd} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \item \mbox{\label{group__stream_gac1c9d7bfb800f5fbbc77055d51530647}} static int {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+fd} (const struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \item \mbox{\label{group__stream_gaf2461189e6614fd9a2b69a4821b36187}} static void {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+read} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \item \mbox{\label{group__stream_ga7262b897e83232efbb7b73fff2d14519}} static int {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+write} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \item \mbox{\label{group__stream_ga9a6f3de25795c699a25e0bb7e7f7bb12}} static int {\bfseries \+\_\+setsockopt\+\_\+nosigpipe} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli) \item \mbox{\label{group__stream_ga85911f40e587abef11492e74e8377f01}} static void {\bfseries stream\+\_\+cli\+\_\+handle\+\_\+connecting} (struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, int res) \item \mbox{\label{group__stream_ga7080a18acf6e820aec2d8e33e178d2ae}} static int {\bfseries osmo\+\_\+stream\+\_\+cli\+\_\+fd\+\_\+cb} (struct osmo\+\_\+fd $\ast$ofd, unsigned int what) \item \mbox{\label{group__stream_ga866e541e96ee1f64d2b550e4d502be2c}} static void {\bfseries cli\+\_\+timer\+\_\+cb} (void $\ast$data) \item \mbox{\label{group__stream_ga6460fee62f6a4a60a35d6c4284a18999}} static void {\bfseries stream\+\_\+cli\+\_\+iofd\+\_\+read\+\_\+cb} (struct osmo\+\_\+io\+\_\+fd $\ast$iofd, int res, struct msgb $\ast$msg) \item \mbox{\label{group__stream_ga094b5940d549519651c115ecb6ccd16b}} static void {\bfseries stream\+\_\+cli\+\_\+iofd\+\_\+write\+\_\+cb} (struct osmo\+\_\+io\+\_\+fd $\ast$iofd, int res, struct msgb $\ast$msg) \item \mbox{\label{group__stream_gafcf80da0c8f3b06413ed960e6ba85708}} static int {\bfseries \+\_\+setsockopt\+\_\+nosigpipe} (struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, int new\+\_\+fd) \item \mbox{\label{group__stream_ga4519838c2d6f34f4454605c991a9c144}} static int {\bfseries osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+ofd\+\_\+cb} (struct osmo\+\_\+fd $\ast$ofd, unsigned int what) \item \mbox{\label{group__stream_ga643df48fc079484d66bde70c35d39c58}} static void {\bfseries stream\+\_\+srv\+\_\+iofd\+\_\+read\+\_\+cb} (struct osmo\+\_\+io\+\_\+fd $\ast$iofd, int res, struct msgb $\ast$msg) \item \mbox{\label{group__stream_ga98d62d49c184977083fd6b687ac6ceb2}} static void {\bfseries stream\+\_\+srv\+\_\+iofd\+\_\+write\+\_\+cb} (struct osmo\+\_\+io\+\_\+fd $\ast$iofd, int res, struct msgb $\ast$msg) \item \mbox{\label{group__stream_gaece198aea502c86c3c4447def631045a}} static int {\bfseries osmo\+\_\+stream\+\_\+srv\+\_\+read} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn) \item \mbox{\label{group__stream_ga126a75cba64e9c2ea17dabf8c2126c9f}} static void {\bfseries osmo\+\_\+stream\+\_\+srv\+\_\+write} (struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn) \item \mbox{\label{group__stream_ga66f9ef624e3f777e0ed6dd7d7d480330}} static int {\bfseries osmo\+\_\+stream\+\_\+srv\+\_\+cb} (struct osmo\+\_\+fd $\ast$ofd, unsigned int what) \end{DoxyCompactItemize} \doxysubsection*{Variables} \begin{DoxyCompactItemize} \item static const struct value\+\_\+string \textbf{ stream\+\_\+cli\+\_\+state\+\_\+names} [$\,$] \item static struct osmo\+\_\+io\+\_\+ops \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+ioops} \item static struct osmo\+\_\+io\+\_\+ops \textbf{ srv\+\_\+ioops} \end{DoxyCompactItemize} \doxysubsection{Detailed Description} This code is intended to abstract any use of stream-\/type sockets, such as TCP and SCTP. It offers both server and client side implementations, fully integrated with the libosmocore select loop abstraction. This code is intended to abstract any use of stream-\/type sockets, such as TCP and SCTP. It offers client side implementation, fully integrated with the libosmocore select loop abstraction. This code is intended to abstract any use of stream-\/type sockets, such as TCP and SCTP. It offers server side implementation, fully integrated with the libosmocore select loop abstraction. \doxysubsection{Macro Definition Documentation} \mbox{\label{group__stream_ga93406b98c0c2fa90d3d12b13d5bd63ac}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!LOGSCLI@{LOGSCLI}} \index{LOGSCLI@{LOGSCLI}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{LOGSCLI} {\footnotesize\ttfamily \#define LOGSCLI(\begin{DoxyParamCaption}\item[{}]{cli, }\item[{}]{level, }\item[{}]{fmt, }\item[{}]{args... }\end{DoxyParamCaption})} {\bfseries Value\+:} \begin{DoxyCode}{0} \DoxyCodeLine{ LOGP(DLINP, level, \textcolor{stringliteral}{"{}CLICONN(\%s,\%s)\{\%s\} "{}} fmt, \(\backslash\)} \DoxyCodeLine{ cli-\/>name ? : \textcolor{stringliteral}{"{}"{}}, \(\backslash\)} \DoxyCodeLine{ cli-\/>sockname, \(\backslash\)} \DoxyCodeLine{ get\_value\_string(stream\_cli\_state\_names, (cli)-\/>state), \(\backslash\)} \DoxyCodeLine{ \#\# args)} \end{DoxyCode} \mbox{\label{group__stream_ga342e0d6b27c088873e909cf519a9b625}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!LOGSLNK@{LOGSLNK}} \index{LOGSLNK@{LOGSLNK}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{LOGSLNK} {\footnotesize\ttfamily \#define LOGSLNK(\begin{DoxyParamCaption}\item[{}]{link, }\item[{}]{level, }\item[{}]{fmt, }\item[{}]{args... }\end{DoxyParamCaption})} {\bfseries Value\+:} \begin{DoxyCode}{0} \DoxyCodeLine{ LOGP(DLINP, level, \textcolor{stringliteral}{"{}SRV(\%s,\%s) "{}} fmt, \(\backslash\)} \DoxyCodeLine{ link-\/>name ? : \textcolor{stringliteral}{"{}"{}}, \(\backslash\)} \DoxyCodeLine{ link-\/>sockname, \(\backslash\)} \DoxyCodeLine{ \#\# args)} \end{DoxyCode} \mbox{\label{group__stream_ga3f350c591ee22c0d8505b4f25d19b739}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!LOGSSRV@{LOGSSRV}} \index{LOGSSRV@{LOGSSRV}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{LOGSSRV} {\footnotesize\ttfamily \#define LOGSSRV(\begin{DoxyParamCaption}\item[{}]{srv, }\item[{}]{level, }\item[{}]{fmt, }\item[{}]{args... }\end{DoxyParamCaption})} {\bfseries Value\+:} \begin{DoxyCode}{0} \DoxyCodeLine{ LOGP(DLINP, level, \textcolor{stringliteral}{"{}SRVCONN(\%s,\%s) "{}} fmt, \(\backslash\)} \DoxyCodeLine{ srv-\/>name ? : \textcolor{stringliteral}{"{}"{}}, \(\backslash\)} \DoxyCodeLine{ srv-\/>sockname, \(\backslash\)} \DoxyCodeLine{ \#\# args)} \end{DoxyCode} \doxysubsection{Function Documentation} \mbox{\label{group__stream_gad217c1c1b83ac852e090afd49146db19}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_close@{osmo\_stream\_cli\_close}} \index{osmo\_stream\_cli\_close@{osmo\_stream\_cli\_close}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_close()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+close (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli }\end{DoxyParamCaption})} Close an Osmocom Stream Client. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Osmocom Stream Client to be closed We unregister the socket fd from the osmocom select() loop abstraction and close the socket \\ \hline \end{DoxyParams} Referenced by \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+destroy()}, and \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+reconnect()}. \mbox{\label{group__stream_ga1754a498abc27577a8e0b3b0f236c05b}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_create@{osmo\_stream\_cli\_create}} \index{osmo\_stream\_cli\_create@{osmo\_stream\_cli\_create}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_create()} {\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$ osmo\+\_\+stream\+\_\+cli\+\_\+create (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx }\end{DoxyParamCaption})} Create an Osmocom stream client. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em ctx} & talloc context from which to allocate memory This function allocates a new \doxyref{osmo\+\_\+stream\+\_\+cli}{p.}{structosmo__stream__cli} and initializes it with default values (5s reconnect timer, TCP protocol) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} allocated stream client, or NULL in case of error \end{DoxyReturn} \mbox{\label{group__stream_ga9d0dac2f390c660c85fa347765f4f45a}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_destroy@{osmo\_stream\_cli\_destroy}} \index{osmo\_stream\_cli\_destroy@{osmo\_stream\_cli\_destroy}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_destroy()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+destroy (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli }\end{DoxyParamCaption})} Destroy a Osmocom stream client (includes close) \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to destroy \\ \hline \end{DoxyParams} References \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+close()}. \mbox{\label{group__stream_ga606a53840677f3f5200887dc92f5de4d}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_get\_data@{osmo\_stream\_cli\_get\_data}} \index{osmo\_stream\_cli\_get\_data@{osmo\_stream\_cli\_get\_data}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_get\_data()} {\footnotesize\ttfamily void $\ast$ osmo\+\_\+stream\+\_\+cli\+\_\+get\+\_\+data (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli }\end{DoxyParamCaption})} Get application private data of the stream client socket. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Application private data, as set by \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+data()}{p.}{group__stream_ga5e94c511d537f63337912bb50fb2dc28} \end{DoxyReturn} \mbox{\label{group__stream_ga0615daa4aac253a3d530f35fddbc68bd}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_get\_ofd@{osmo\_stream\_cli\_get\_ofd}} \index{osmo\_stream\_cli\_get\_ofd@{osmo\_stream\_cli\_get\_ofd}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_get\_ofd()} {\footnotesize\ttfamily struct osmo\+\_\+fd $\ast$ osmo\+\_\+stream\+\_\+cli\+\_\+get\+\_\+ofd (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli }\end{DoxyParamCaption})} Get Osmocom File Descriptor of the stream client socket. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Pointer to osmo\+\_\+fd \end{DoxyReturn} \mbox{\label{group__stream_gaecd148ae11f2f619aa52dd2900a15827}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_get\_sockname@{osmo\_stream\_cli\_get\_sockname}} \index{osmo\_stream\_cli\_get\_sockname@{osmo\_stream\_cli\_get\_sockname}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_get\_sockname()} {\footnotesize\ttfamily char $\ast$ osmo\+\_\+stream\+\_\+cli\+\_\+get\+\_\+sockname (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli }\end{DoxyParamCaption})} Get the stream client socket description. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to examine \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Socket description or NULL in case of error \end{DoxyReturn} \mbox{\label{group__stream_ga79a09e9c9b8cc98991cd5eebdb41ed57}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_is\_connected@{osmo\_stream\_cli\_is\_connected}} \index{osmo\_stream\_cli\_is\_connected@{osmo\_stream\_cli\_is\_connected}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_is\_connected()} {\footnotesize\ttfamily bool osmo\+\_\+stream\+\_\+cli\+\_\+is\+\_\+connected (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli }\end{DoxyParamCaption})} Check if Osmocom Stream Client is in connected state. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Osmocom Stream Client \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} true if connected, false otherwise \end{DoxyReturn} \mbox{\label{group__stream_ga86b4b9c8e563f8426d3cdae803e3ec38}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_open@{osmo\_stream\_cli\_open}} \index{osmo\_stream\_cli\_open@{osmo\_stream\_cli\_open}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_open()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+cli\+\_\+open (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli }\end{DoxyParamCaption})} Open connection of an Osmocom stream client By default the client will automatically reconnect after default timeout. To disable this, use \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+reconnect\+\_\+timeout()}{p.}{group__stream_gade74792afe35f31dd2584c888db3dd62} before calling this function. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to connect \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} negative on error, 0 on success \end{DoxyReturn} \mbox{\label{group__stream_ga127866794591d16a0eb7244f2fe666ef}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_open2@{osmo\_stream\_cli\_open2}} \index{osmo\_stream\_cli\_open2@{osmo\_stream\_cli\_open2}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_open2()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+cli\+\_\+open2 (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{int}]{reconnect }\end{DoxyParamCaption})} DEPRECATED\+: use \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+reconnect\+\_\+timeout()}{p.}{group__stream_gade74792afe35f31dd2584c888db3dd62} or \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+reconnect()}{p.}{group__stream_ga11d2615f6197f33073ba7245e5ba95ee} instead! Open connection of an Osmocom stream client. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to connect \\ \hline \mbox{\texttt{ in}} & {\em reconect} & 1 if we should not automatically reconnect \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} negative on error, 0 on success \end{DoxyReturn} \mbox{\label{group__stream_ga06f9743c19068bb720a4949ae8467243}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_recv@{osmo\_stream\_cli\_recv}} \index{osmo\_stream\_cli\_recv@{osmo\_stream\_cli\_recv}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_recv()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+cli\+\_\+recv (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{struct msgb $\ast$}]{msg }\end{DoxyParamCaption})} Receive data via an Osmocom stream client. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client through which we want to send \\ \hline & {\em msg} & pre-\/allocate message buffer to which received data is appended \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} number of bytes read; $<$=0 in case of error \end{DoxyReturn} If conn is an SCTP connection, additional specific considerations shall be taken\+: \begin{DoxyItemize} \item msg-\/$>$cb is always filled with SCTP ppid, and SCTP stream values, see msgb\+\_\+sctp\+\_\+$\ast$() APIs. \item If an SCTP notification was received when reading from the SCTP socket, msgb\+\_\+sctp\+\_\+msg\+\_\+flags(msg) will contain bit flag OSMO\+\_\+\+STREAM\+\_\+\+SCTP\+\_\+\+MSG\+\_\+\+FLAGS\+\_\+\+NOTIFICATION set, and the msgb will contain a \char`\"{}union sctp\+\_\+notification\char`\"{} instead of user data. In this case the return code will be either 0 (if conn is considered dead after the notification) or -\/EAGAIN (if conn is considered still alive after the notification) resembling the standard recv() API. \end{DoxyItemize}\mbox{\label{group__stream_gaacf415b97e1184baadeee5c60387422b}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_send@{osmo\_stream\_cli\_send}} \index{osmo\_stream\_cli\_send@{osmo\_stream\_cli\_send}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_send()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+send (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{struct msgb $\ast$}]{msg }\end{DoxyParamCaption})} Enqueue data to be sent via an Osmocom stream client. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client through which we want to send \\ \hline \mbox{\texttt{ in}} & {\em msg} & Message buffer to enqueue in transmit queue \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga0038e937cf0f36c59e0e3991523219a1}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_addr@{osmo\_stream\_cli\_set\_addr}} \index{osmo\_stream\_cli\_set\_addr@{osmo\_stream\_cli\_set\_addr}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_addr()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+addr (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{const char $\ast$}]{addr }\end{DoxyParamCaption})} Set the remote address to which we connect. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em addr} & Remote IP address \\ \hline \end{DoxyParams} References \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+addrs()}. \mbox{\label{group__stream_gaab1e7ef0ccc88e124c5f7bbb5e46c29c}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_addrs@{osmo\_stream\_cli\_set\_addrs}} \index{osmo\_stream\_cli\_set\_addrs@{osmo\_stream\_cli\_set\_addrs}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_addrs()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+addrs (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{const char $\ast$$\ast$}]{addr, }\item[{size\+\_\+t}]{addrcnt }\end{DoxyParamCaption})} Set the remote address set to which we connect. Useful for protocols allowing connecting to more than one address (such as SCTP) \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em addr} & Remote IP address set \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} negative on error, 0 on success \end{DoxyReturn} Referenced by \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+addr()}. \mbox{\label{group__stream_gab588bfd88a3cc775875981e2ee66e295}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_connect\_cb@{osmo\_stream\_cli\_set\_connect\_cb}} \index{osmo\_stream\_cli\_set\_connect\_cb@{osmo\_stream\_cli\_set\_connect\_cb}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_connect\_cb()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+connect\+\_\+cb (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{int($\ast$)(struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli)}]{connect\+\_\+cb }\end{DoxyParamCaption})} Set the call-\/back function called on connect of the stream client socket. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em connect\+\_\+cb} & Call-\/back function to be called upon connect \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga5e94c511d537f63337912bb50fb2dc28}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_data@{osmo\_stream\_cli\_set\_data}} \index{osmo\_stream\_cli\_set\_data@{osmo\_stream\_cli\_set\_data}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_data()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+data (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{void $\ast$}]{data }\end{DoxyParamCaption})} Set application private data of the stream client socket. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em data} & User-\/specific data (available in call-\/back functions) \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga23e5c1799a8225607543de39a56ca449}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_disconnect\_cb@{osmo\_stream\_cli\_set\_disconnect\_cb}} \index{osmo\_stream\_cli\_set\_disconnect\_cb@{osmo\_stream\_cli\_set\_disconnect\_cb}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_disconnect\_cb()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+disconnect\+\_\+cb (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{int($\ast$)(struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli)}]{disconnect\+\_\+cb }\end{DoxyParamCaption})} Set the call-\/back function called on disconnect of the stream client socket. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em disconnect\+\_\+cb} & Call-\/back function to be called upon disconnect \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga33ce730fc91ebade9b7188fa220656c6}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_domain@{osmo\_stream\_cli\_set\_domain}} \index{osmo\_stream\_cli\_set\_domain@{osmo\_stream\_cli\_set\_domain}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_domain()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+domain (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{int}]{domain }\end{DoxyParamCaption})} Set the socket type for the stream server link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em type} & Socket Domain (like AF\+\_\+\+UNSPEC (default for IP), AF\+\_\+\+UNIX, AF\+\_\+\+INET, ...) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} zero on success, negative on error. \end{DoxyReturn} \mbox{\label{group__stream_ga70420e7c664cc4c4e69ac4d3476e7f53}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_local\_addr@{osmo\_stream\_cli\_set\_local\_addr}} \index{osmo\_stream\_cli\_set\_local\_addr@{osmo\_stream\_cli\_set\_local\_addr}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_local\_addr()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+local\+\_\+addr (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{const char $\ast$}]{addr }\end{DoxyParamCaption})} Set the local address for the socket (to be bound to) \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em port} & Local host name \\ \hline \end{DoxyParams} References \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+local\+\_\+addrs()}. \mbox{\label{group__stream_ga090fc3fcd1706b815ef5a729921c100e}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_local\_addrs@{osmo\_stream\_cli\_set\_local\_addrs}} \index{osmo\_stream\_cli\_set\_local\_addrs@{osmo\_stream\_cli\_set\_local\_addrs}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_local\_addrs()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+local\+\_\+addrs (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{const char $\ast$$\ast$}]{addr, }\item[{size\+\_\+t}]{addrcnt }\end{DoxyParamCaption})} Set the local address set to which we connect. Useful for protocols allowing bind to more than one address (such as SCTP) \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em addr} & Local IP address set \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} negative on error, 0 on success \end{DoxyReturn} Referenced by \textbf{ osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+local\+\_\+addr()}. \mbox{\label{group__stream_ga4d83e3cf7fdf7eb354c2015ff9bed98a}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_local\_port@{osmo\_stream\_cli\_set\_local\_port}} \index{osmo\_stream\_cli\_set\_local\_port@{osmo\_stream\_cli\_set\_local\_port}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_local\_port()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+local\+\_\+port (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{uint16\+\_\+t}]{port }\end{DoxyParamCaption})} Set the local port number for the socket (to be bound to) \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em port} & Local port number \\ \hline \end{DoxyParams} \mbox{\label{group__stream_gaeb712dc553735736047f9b11d9583baa}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_name@{osmo\_stream\_cli\_set\_name}} \index{osmo\_stream\_cli\_set\_name@{osmo\_stream\_cli\_set\_name}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_name()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+name (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{const char $\ast$}]{name }\end{DoxyParamCaption})} Set a name on the cli object (used during logging) \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & stream\+\_\+cli whose name is to be set \\ \hline \mbox{\texttt{ in}} & {\em name} & the name to be set on cli \\ \hline \end{DoxyParams} \mbox{\label{group__stream_gaa196e78db6ca32abb1473566b4f1b04b}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_nodelay@{osmo\_stream\_cli\_set\_nodelay}} \index{osmo\_stream\_cli\_set\_nodelay@{osmo\_stream\_cli\_set\_nodelay}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_nodelay()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+nodelay (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{bool}]{nodelay }\end{DoxyParamCaption})} Set the NODELAY socket option to avoid Nagle-\/like behavior Setting this to nodelay=true will automatically set the NODELAY socket option on any socket established via \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+open}{p.}{group__stream_ga86b4b9c8e563f8426d3cdae803e3ec38} or any re-\/connect. You have to set this {\itshape before} opening the socket. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream client whose sockets are to be configured \\ \hline \mbox{\texttt{ in}} & {\em nodelay} & whether to set (true) NODELAY before connect() \\ \hline \end{DoxyParams} \mbox{\label{group__stream_gab8b9f65bebfeb83c6e33d102e9439770}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_port@{osmo\_stream\_cli\_set\_port}} \index{osmo\_stream\_cli\_set\_port@{osmo\_stream\_cli\_set\_port}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_port()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+port (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{uint16\+\_\+t}]{port }\end{DoxyParamCaption})} Set the remote port number to which we connect. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em port} & Remote port number \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga91d57aa94a370520540d7272af66a23b}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_proto@{osmo\_stream\_cli\_set\_proto}} \index{osmo\_stream\_cli\_set\_proto@{osmo\_stream\_cli\_set\_proto}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_proto()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+proto (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{uint16\+\_\+t}]{proto }\end{DoxyParamCaption})} Set the protocol for the stream client socket. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em proto} & Protocol (like IPPROTO\+\_\+\+TCP (default), IPPROTO\+\_\+\+SCTP, ...) \\ \hline \end{DoxyParams} \mbox{\label{group__stream_gad1d1817f25694ea126779262cddf4fbd}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_read\_cb@{osmo\_stream\_cli\_set\_read\_cb}} \index{osmo\_stream\_cli\_set\_read\_cb@{osmo\_stream\_cli\_set\_read\_cb}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_read\_cb()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+read\+\_\+cb (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{int($\ast$)(struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli)}]{read\+\_\+cb }\end{DoxyParamCaption})} Set the call-\/back function called to read from the stream client socket This function will configure \doxyref{osmo\+\_\+stream\+\_\+cli}{p.}{structosmo__stream__cli} to use osmo\+\_\+ofd internally. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em read\+\_\+cb} & Call-\/back function to be called when we want to read \\ \hline \end{DoxyParams} \mbox{\label{group__stream_gad4c563e88d269092b0d66f33a4764420}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_read\_cb2@{osmo\_stream\_cli\_set\_read\_cb2}} \index{osmo\_stream\_cli\_set\_read\_cb2@{osmo\_stream\_cli\_set\_read\_cb2}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_read\_cb2()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+read\+\_\+cb2 (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{int($\ast$)(struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$cli, struct msgb $\ast$msg)}]{read\+\_\+cb }\end{DoxyParamCaption})} Set the call-\/back function called to read from the stream client socket This function will configure \doxyref{osmo\+\_\+stream\+\_\+cli}{p.}{structosmo__stream__cli} to use osmo\+\_\+iofd internally. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em read\+\_\+cb} & Call-\/back function to be called when data was read from the socket \\ \hline \end{DoxyParams} \mbox{\label{group__stream_gade74792afe35f31dd2584c888db3dd62}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_reconnect\_timeout@{osmo\_stream\_cli\_set\_reconnect\_timeout}} \index{osmo\_stream\_cli\_set\_reconnect\_timeout@{osmo\_stream\_cli\_set\_reconnect\_timeout}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_reconnect\_timeout()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+reconnect\+\_\+timeout (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{int}]{timeout }\end{DoxyParamCaption})} Set the reconnect time of the stream client socket. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em timeout} & Re-\/connect timeout in seconds or negative value to disable auto-\/reconnection \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga5e5c4c9aacc1cd1d303c0295018594cb}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_set\_type@{osmo\_stream\_cli\_set\_type}} \index{osmo\_stream\_cli\_set\_type@{osmo\_stream\_cli\_set\_type}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_set\_type()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+type (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+cli} $\ast$}]{cli, }\item[{int}]{type }\end{DoxyParamCaption})} Set the socket type for the stream server link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em cli} & Stream Client to modify \\ \hline \mbox{\texttt{ in}} & {\em type} & Socket Type (like SOCK\+\_\+\+STREAM (default), SOCK\+\_\+\+SEQPACKET, ...) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} zero on success, negative on error. \end{DoxyReturn} \mbox{\label{group__stream_ga21a5f061ca2cb307906a9552abebb075}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_create@{osmo\_stream\_srv\_create}} \index{osmo\_stream\_srv\_create@{osmo\_stream\_srv\_create}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_create()} {\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$ osmo\+\_\+stream\+\_\+srv\+\_\+create (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx, }\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{int}]{fd, }\item[{int($\ast$)(struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn)}]{read\+\_\+cb, }\item[{int($\ast$)(struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn)}]{closed\+\_\+cb, }\item[{void $\ast$}]{data }\end{DoxyParamCaption})} Create a Stream Server inside the specified link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em ctx} & talloc allocation context from which to allocate \\ \hline \mbox{\texttt{ in}} & {\em link} & Stream Server Link to which we belong \\ \hline \mbox{\texttt{ in}} & {\em fd} & system file descriptor of the new connection \\ \hline \mbox{\texttt{ in}} & {\em read\+\_\+cb} & Call-\/back to call when the socket is readable \\ \hline \mbox{\texttt{ in}} & {\em closed\+\_\+cb} & Call-\/back to call when the connection is closed \\ \hline \mbox{\texttt{ in}} & {\em data} & User data to save in the new Stream Server struct \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Stream Server in case of success; NULL on error \end{DoxyReturn} \mbox{\label{group__stream_ga8be283e1a143e346b4d6ccf33cbb9b98}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_create2@{osmo\_stream\_srv\_create2}} \index{osmo\_stream\_srv\_create2@{osmo\_stream\_srv\_create2}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_create2()} {\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$ osmo\+\_\+stream\+\_\+srv\+\_\+create2 (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx, }\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{int}]{fd, }\item[{void $\ast$}]{data }\end{DoxyParamCaption})} Create a Stream Server inside the specified link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em ctx} & talloc allocation context from which to allocate \\ \hline \mbox{\texttt{ in}} & {\em link} & Stream Server Link to which we belong \\ \hline \mbox{\texttt{ in}} & {\em fd} & system file descriptor of the new connection \\ \hline \mbox{\texttt{ in}} & {\em data} & User data to save in the new Stream Server struct \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Stream Server in case of success; NULL on error \end{DoxyReturn} \mbox{\label{group__stream_ga47f18e063f64f22cb74d58d8b7243bed}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_destroy@{osmo\_stream\_srv\_destroy}} \index{osmo\_stream\_srv\_destroy@{osmo\_stream\_srv\_destroy}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_destroy()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+destroy (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn }\end{DoxyParamCaption})} Destroy given Stream Server This function closes the Stream Server socket, unregisters from select loop, invokes the connection\textquotesingle{}s closed\+\_\+cb() callback to allow API users to clean up any associated state they have for this connection, and then de-\/allocates associated memory. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & Stream Server to be destroyed \\ \hline \end{DoxyParams} \mbox{\label{group__stream_gae2a0ef01097d964c71e38600b4c078d5}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_get\_data@{osmo\_stream\_srv\_get\_data}} \index{osmo\_stream\_srv\_get\_data@{osmo\_stream\_srv\_get\_data}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_get\_data()} {\footnotesize\ttfamily void $\ast$ osmo\+\_\+stream\+\_\+srv\+\_\+get\+\_\+data (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn }\end{DoxyParamCaption})} Get application private data of the stream server. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & Stream Server \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Application private data, as set by \doxyref{osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+data()}{p.}{group__stream_ga9891663b20714d72f992e44ad1e92eea} \end{DoxyReturn} \mbox{\label{group__stream_ga9cf689935bf6ffac4f86f56219d73c8e}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_get\_master@{osmo\_stream\_srv\_get\_master}} \index{osmo\_stream\_srv\_get\_master@{osmo\_stream\_srv\_get\_master}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_get\_master()} {\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$ osmo\+\_\+stream\+\_\+srv\+\_\+get\+\_\+master (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn }\end{DoxyParamCaption})} Get the master (Link) from a Stream Server. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & Stream Server of which we want to know the Link \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Link through which the given Stream Server is established \end{DoxyReturn} \mbox{\label{group__stream_ga47bbca4f12717db2e6158eefe6310b9b}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_get\_ofd@{osmo\_stream\_srv\_get\_ofd}} \index{osmo\_stream\_srv\_get\_ofd@{osmo\_stream\_srv\_get\_ofd}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_get\_ofd()} {\footnotesize\ttfamily struct osmo\+\_\+fd $\ast$ osmo\+\_\+stream\+\_\+srv\+\_\+get\+\_\+ofd (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn }\end{DoxyParamCaption})} Get Osmocom File Descriptor of the stream server. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & Stream Server \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Pointer to osmo\+\_\+fd \end{DoxyReturn} \mbox{\label{group__stream_gad325d97b09c724e830c98d76b890520d}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_close@{osmo\_stream\_srv\_link\_close}} \index{osmo\_stream\_srv\_link\_close@{osmo\_stream\_srv\_link\_close}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_close()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+close (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link }\end{DoxyParamCaption})} Close the stream server link and unregister from select loop Does not destroy the server link, merely closes it! \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to close \\ \hline \end{DoxyParams} References \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+is\+\_\+opened()}. Referenced by \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+destroy()}. \mbox{\label{group__stream_gaad262988c7ac365566f03843c560f892}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_create@{osmo\_stream\_srv\_link\_create}} \index{osmo\_stream\_srv\_link\_create@{osmo\_stream\_srv\_link\_create}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_create()} {\footnotesize\ttfamily struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+create (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx }\end{DoxyParamCaption})} Create an Osmocom Stream Server Link A Stream Server Link is the listen()+accept() \char`\"{}parent\char`\"{} to individual Stream Servers. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em ctx} & talloc allocation context \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Stream Server Link with default values (TCP) \end{DoxyReturn} \mbox{\label{group__stream_ga882acaaa5935422b0e09a2ce8c8019ec}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_destroy@{osmo\_stream\_srv\_link\_destroy}} \index{osmo\_stream\_srv\_link\_destroy@{osmo\_stream\_srv\_link\_destroy}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_destroy()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+destroy (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link }\end{DoxyParamCaption})} Destroy the stream server link. Closes + Releases Memory. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link \\ \hline \end{DoxyParams} References \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+close()}. \mbox{\label{group__stream_gacb5d68c2a6a9663f99266c70747bce04}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_get\_data@{osmo\_stream\_srv\_link\_get\_data}} \index{osmo\_stream\_srv\_link\_get\_data@{osmo\_stream\_srv\_link\_get\_data}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_get\_data()} {\footnotesize\ttfamily void $\ast$ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+get\+\_\+data (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link }\end{DoxyParamCaption})} Get application private data of the stream server link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to modify \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Application private data, as set by \doxyref{osmo\+\_\+stream\+\_\+cli\+\_\+set\+\_\+data()}{p.}{group__stream_ga5e94c511d537f63337912bb50fb2dc28} \end{DoxyReturn} \mbox{\label{group__stream_ga7b8981351a154c357fcefd39c31ad42a}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_get\_ofd@{osmo\_stream\_srv\_link\_get\_ofd}} \index{osmo\_stream\_srv\_link\_get\_ofd@{osmo\_stream\_srv\_link\_get\_ofd}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_get\_ofd()} {\footnotesize\ttfamily struct osmo\+\_\+fd $\ast$ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+get\+\_\+ofd (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link }\end{DoxyParamCaption})} Get Osmocom File Descriptor of the stream server link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Pointer to osmo\+\_\+fd \end{DoxyReturn} \mbox{\label{group__stream_ga7d7b6af7df24e90dc758a088bae6316d}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_get\_sockname@{osmo\_stream\_srv\_link\_get\_sockname}} \index{osmo\_stream\_srv\_link\_get\_sockname@{osmo\_stream\_srv\_link\_get\_sockname}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_get\_sockname()} {\footnotesize\ttfamily char $\ast$ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+get\+\_\+sockname (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link }\end{DoxyParamCaption})} Get description of the stream server link e. g. 127.\+0.\+0.\+1\+:1234. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to examine \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} Link description or NULL in case of error \end{DoxyReturn} \mbox{\label{group__stream_ga28243be108ed0302b0f5a9d1dfc96b22}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_is\_opened@{osmo\_stream\_srv\_link\_is\_opened}} \index{osmo\_stream\_srv\_link\_is\_opened@{osmo\_stream\_srv\_link\_is\_opened}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_is\_opened()} {\footnotesize\ttfamily bool osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+is\+\_\+opened (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link }\end{DoxyParamCaption})} Check whether the stream server link is opened. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to check \\ \hline \end{DoxyParams} Referenced by \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+close()}. \mbox{\label{group__stream_ga603b89074d3e8c0fb44144ab1864f0d4}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_open@{osmo\_stream\_srv\_link\_open}} \index{osmo\_stream\_srv\_link\_open@{osmo\_stream\_srv\_link\_open}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_open()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+open (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link }\end{DoxyParamCaption})} Open the stream server link. This actually initializes the underlying socket and binds it to the configured ip/port. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to open \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} negative on error, 0 on success \end{DoxyReturn} \mbox{\label{group__stream_ga1eea525d4e1e7a24c9c08881994ceb7e}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_set\_accept\_cb@{osmo\_stream\_srv\_link\_set\_accept\_cb}} \index{osmo\_stream\_srv\_link\_set\_accept\_cb@{osmo\_stream\_srv\_link\_set\_accept\_cb}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_set\_accept\_cb()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+accept\+\_\+cb (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{int($\ast$)(struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$link, int fd)}]{accept\+\_\+cb }\end{DoxyParamCaption})} Set the accept() call-\/back of the stream server link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link \\ \hline \mbox{\texttt{ in}} & {\em accept\+\_\+cb} & Call-\/back function executed upon accept() \\ \hline \end{DoxyParams} \mbox{\label{group__stream_gacece90116484e34540def69b05c66f57}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_set\_addr@{osmo\_stream\_srv\_link\_set\_addr}} \index{osmo\_stream\_srv\_link\_set\_addr@{osmo\_stream\_srv\_link\_set\_addr}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_set\_addr()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+addr (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{const char $\ast$}]{addr }\end{DoxyParamCaption})} Set the local address to which we bind. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to modify \\ \hline \mbox{\texttt{ in}} & {\em addr} & Local IP address \\ \hline \end{DoxyParams} References \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+addrs()}. \mbox{\label{group__stream_gaadabca7d23c52c39e291bf7e05f0055b}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_set\_addrs@{osmo\_stream\_srv\_link\_set\_addrs}} \index{osmo\_stream\_srv\_link\_set\_addrs@{osmo\_stream\_srv\_link\_set\_addrs}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_set\_addrs()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+addrs (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{const char $\ast$$\ast$}]{addr, }\item[{size\+\_\+t}]{addrcnt }\end{DoxyParamCaption})} Set the local address set to which we bind. Useful for protocols allowing bind on more than one address (such as SCTP) \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to modify \\ \hline \mbox{\texttt{ in}} & {\em addr} & Local IP address \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} negative on error, 0 on success \end{DoxyReturn} Referenced by \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+addr()}. \mbox{\label{group__stream_ga5ef0f0c85a52c08e8c10d36a8f44e392}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_set\_data@{osmo\_stream\_srv\_link\_set\_data}} \index{osmo\_stream\_srv\_link\_set\_data@{osmo\_stream\_srv\_link\_set\_data}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_set\_data()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+data (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{void $\ast$}]{data }\end{DoxyParamCaption})} Set application private data of the stream server link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to modify \\ \hline \mbox{\texttt{ in}} & {\em data} & User-\/specific data (available in call-\/back functions) \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga9629b516297c31f34af48e4630973dab}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_set\_domain@{osmo\_stream\_srv\_link\_set\_domain}} \index{osmo\_stream\_srv\_link\_set\_domain@{osmo\_stream\_srv\_link\_set\_domain}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_set\_domain()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+domain (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{int}]{domain }\end{DoxyParamCaption})} Set the socket type for the stream server link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to modify \\ \hline \mbox{\texttt{ in}} & {\em type} & Socket Domain (like AF\+\_\+\+UNSPEC (default for IP), AF\+\_\+\+UNIX, AF\+\_\+\+INET, ...) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} zero on success, negative on error. \end{DoxyReturn} \mbox{\label{group__stream_gadef998825a4739660b198151fcee4201}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_set\_name@{osmo\_stream\_srv\_link\_set\_name}} \index{osmo\_stream\_srv\_link\_set\_name@{osmo\_stream\_srv\_link\_set\_name}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_set\_name()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+name (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{const char $\ast$}]{name }\end{DoxyParamCaption})} Set a name on the srv\+\_\+link object (used during logging) \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & server link whose name is to be set \\ \hline \mbox{\texttt{ in}} & {\em name} & the name to be set on link \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga41e8ad2c761aaa00313aa11d1f29a3ed}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_set\_nodelay@{osmo\_stream\_srv\_link\_set\_nodelay}} \index{osmo\_stream\_srv\_link\_set\_nodelay@{osmo\_stream\_srv\_link\_set\_nodelay}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_set\_nodelay()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+nodelay (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{bool}]{nodelay }\end{DoxyParamCaption})} Set the NODELAY socket option to avoid Nagle-\/like behavior Setting this to nodelay=true will automatically set the NODELAY socket option on any socket established via this server link, before calling the accept\+\_\+cb() \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & server link whose sockets are to be configured \\ \hline \mbox{\texttt{ in}} & {\em nodelay} & whether to set (true) NODELAY after accept \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga76bbbafd1d8dc9c9ebffd301503b6dd9}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_set\_port@{osmo\_stream\_srv\_link\_set\_port}} \index{osmo\_stream\_srv\_link\_set\_port@{osmo\_stream\_srv\_link\_set\_port}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_set\_port()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+port (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{uint16\+\_\+t}]{port }\end{DoxyParamCaption})} Set the local port number to which we bind. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to modify \\ \hline \mbox{\texttt{ in}} & {\em port} & Local port number \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga2508987133a93863d2a50103004b0f36}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_set\_proto@{osmo\_stream\_srv\_link\_set\_proto}} \index{osmo\_stream\_srv\_link\_set\_proto@{osmo\_stream\_srv\_link\_set\_proto}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_set\_proto()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+proto (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{uint16\+\_\+t}]{proto }\end{DoxyParamCaption})} Set the protocol for the stream server link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to modify \\ \hline \mbox{\texttt{ in}} & {\em proto} & Protocol (like IPPROTO\+\_\+\+TCP (default), IPPROTO\+\_\+\+SCTP, ...) \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga1903f9aa2e6f9283ebcf20f573b1d970}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_link\_set\_type@{osmo\_stream\_srv\_link\_set\_type}} \index{osmo\_stream\_srv\_link\_set\_type@{osmo\_stream\_srv\_link\_set\_type}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_link\_set\_type()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+srv\+\_\+link\+\_\+set\+\_\+type (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv\+\_\+link} $\ast$}]{link, }\item[{int}]{type }\end{DoxyParamCaption})} Set the socket type for the stream server link. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em link} & Stream Server Link to modify \\ \hline \mbox{\texttt{ in}} & {\em type} & Socket Type (like SOCK\+\_\+\+STREAM (default), SOCK\+\_\+\+SEQPACKET, ...) \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} zero on success, negative on error. \end{DoxyReturn} \mbox{\label{group__stream_gac86242c41223c525c770ff7e7515d83e}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_recv@{osmo\_stream\_srv\_recv}} \index{osmo\_stream\_srv\_recv@{osmo\_stream\_srv\_recv}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_recv()} {\footnotesize\ttfamily int osmo\+\_\+stream\+\_\+srv\+\_\+recv (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn, }\item[{struct msgb $\ast$}]{msg }\end{DoxyParamCaption})} Receive data via Osmocom stream server. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & Stream Server from which to receive \\ \hline & {\em msg} & pre-\/allocate message buffer to which received data is appended \\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} number of bytes read, negative on error. \end{DoxyReturn} If conn is an SCTP connection, additional specific considerations shall be taken\+: \begin{DoxyItemize} \item msg-\/$>$cb is always filled with SCTP ppid, and SCTP stream values, see msgb\+\_\+sctp\+\_\+$\ast$() APIs. \item If an SCTP notification was received when reading from the SCTP socket, msgb\+\_\+sctp\+\_\+msg\+\_\+flags(msg) will contain bit flag OSMO\+\_\+\+STREAM\+\_\+\+SCTP\+\_\+\+MSG\+\_\+\+FLAGS\+\_\+\+NOTIFICATION set, and the msgb will contain a \char`\"{}union sctp\+\_\+notification\char`\"{} instead of user data. In this case the return code will be either 0 (if conn is considered dead after the notification) or -\/EAGAIN (if conn is considered still alive after the notification) resembling the standard recv() API. \end{DoxyItemize}\mbox{\label{group__stream_gaa1589994cf6eab27742cafee6b7fb491}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_send@{osmo\_stream\_srv\_send}} \index{osmo\_stream\_srv\_send@{osmo\_stream\_srv\_send}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_send()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+send (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn, }\item[{struct msgb $\ast$}]{msg }\end{DoxyParamCaption})} Enqueue data to be sent via an Osmocom stream server. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & Stream Server through which we want to send \\ \hline \mbox{\texttt{ in}} & {\em msg} & Message buffer to enqueue in transmit queue \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga78d44fbda720218be1700d351691e60a}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_set\_closed\_cb@{osmo\_stream\_srv\_set\_closed\_cb}} \index{osmo\_stream\_srv\_set\_closed\_cb@{osmo\_stream\_srv\_set\_closed\_cb}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_set\_closed\_cb()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+closed\+\_\+cb (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn, }\item[{int($\ast$)(struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn)}]{closed\+\_\+cb }\end{DoxyParamCaption})} Set the call-\/back function called when the stream server socket was closed. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & Stream Server to modify \\ \hline \mbox{\texttt{ in}} & {\em closed\+\_\+cb} & Call-\/back function to be called when the connection was closed \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga9891663b20714d72f992e44ad1e92eea}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_set\_data@{osmo\_stream\_srv\_set\_data}} \index{osmo\_stream\_srv\_set\_data@{osmo\_stream\_srv\_set\_data}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_set\_data()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+data (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn, }\item[{void $\ast$}]{data }\end{DoxyParamCaption})} Set application private data of the stream server. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & Stream Server to modify \\ \hline \mbox{\texttt{ in}} & {\em data} & User-\/specific data (available in call-\/back functions) \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga8390ce6740e56eb22215e1c5805c95f1}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_set\_flush\_and\_destroy@{osmo\_stream\_srv\_set\_flush\_and\_destroy}} \index{osmo\_stream\_srv\_set\_flush\_and\_destroy@{osmo\_stream\_srv\_set\_flush\_and\_destroy}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_set\_flush\_and\_destroy()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+flush\+\_\+and\+\_\+destroy (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn }\end{DoxyParamCaption})} Prepare to send out all pending messages on the connection\textquotesingle{}s Tx queue and then automatically destroy the stream with \doxyref{osmo\+\_\+stream\+\_\+srv\+\_\+destroy()}{p.}{group__stream_ga47f18e063f64f22cb74d58d8b7243bed}. This function disables queuing of new messages on the connection and also disables reception of new messages on the connection. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & Stream Server to modify \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga196834d254fd94922d6be91b7b5b1ed3}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_set\_name@{osmo\_stream\_srv\_set\_name}} \index{osmo\_stream\_srv\_set\_name@{osmo\_stream\_srv\_set\_name}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_set\_name()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+name (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn, }\item[{const char $\ast$}]{name }\end{DoxyParamCaption})} Set a name on the srv object (used during logging) \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & server whose name is to be set \\ \hline \mbox{\texttt{ in}} & {\em name} & the name to be set on conn \\ \hline \end{DoxyParams} \mbox{\label{group__stream_gab98cc1a9428b5ac82fd8255d07563726}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_set\_read\_cb@{osmo\_stream\_srv\_set\_read\_cb}} \index{osmo\_stream\_srv\_set\_read\_cb@{osmo\_stream\_srv\_set\_read\_cb}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_set\_read\_cb()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+read\+\_\+cb (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn, }\item[{int($\ast$)(struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$conn, struct msgb $\ast$msg)}]{read\+\_\+cb }\end{DoxyParamCaption})} Set the call-\/back function when data was read from the stream server socket Only for \doxyref{osmo\+\_\+stream\+\_\+srv}{p.}{structosmo__stream__srv} created with \doxyref{osmo\+\_\+stream\+\_\+srv\+\_\+create2()}{p.}{group__stream_ga8be283e1a143e346b4d6ccf33cbb9b98} \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in}} & {\em conn} & Stream Server to modify \\ \hline \mbox{\texttt{ in}} & {\em read\+\_\+cb} & Call-\/back function to be called when data was read \\ \hline \end{DoxyParams} \mbox{\label{group__stream_ga27052cc04e7f50b71492d4f8aaf7ed61}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_srv\_set\_segmentation\_cb@{osmo\_stream\_srv\_set\_segmentation\_cb}} \index{osmo\_stream\_srv\_set\_segmentation\_cb@{osmo\_stream\_srv\_set\_segmentation\_cb}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_srv\_set\_segmentation\_cb()} {\footnotesize\ttfamily void osmo\+\_\+stream\+\_\+srv\+\_\+set\+\_\+segmentation\+\_\+cb (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stream\+\_\+srv} $\ast$}]{conn, }\item[{int($\ast$)(struct msgb $\ast$msg)}]{segmentation\+\_\+cb }\end{DoxyParamCaption})} Set the segmentation callback for target \doxyref{osmo\+\_\+stream\+\_\+srv}{p.}{structosmo__stream__srv} structure. The connection has to have been established prior to calling this function. \begin{DoxyParams}[1]{Parameters} \mbox{\texttt{ in,out}} & {\em conn} & Target Stream Server to modify \\ \hline \mbox{\texttt{ in}} & {\em segmentation\+\_\+cb} & Segmentation callback to be set \\ \hline \end{DoxyParams} \doxysubsection{Variable Documentation} \mbox{\label{group__stream_ga1f0bfb5fa67d4bbcd72c744a6a769e35}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!osmo\_stream\_cli\_ioops@{osmo\_stream\_cli\_ioops}} \index{osmo\_stream\_cli\_ioops@{osmo\_stream\_cli\_ioops}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{osmo\_stream\_cli\_ioops} {\footnotesize\ttfamily struct osmo\+\_\+io\+\_\+ops osmo\+\_\+stream\+\_\+cli\+\_\+ioops\hspace{0.3cm}{\ttfamily [static]}} {\bfseries Initial value\+:} \begin{DoxyCode}{0} \DoxyCodeLine{= \{} \DoxyCodeLine{ .read\_cb = stream\_cli\_iofd\_read\_cb,} \DoxyCodeLine{ .write\_cb = stream\_cli\_iofd\_write\_cb,} \DoxyCodeLine{} \DoxyCodeLine{ .segmentation\_cb = NULL,} \DoxyCodeLine{\}} \end{DoxyCode} \mbox{\label{group__stream_ga7909b3003027eb09a4ef69ccfb0b967c}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!srv\_ioops@{srv\_ioops}} \index{srv\_ioops@{srv\_ioops}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{srv\_ioops} {\footnotesize\ttfamily struct osmo\+\_\+io\+\_\+ops srv\+\_\+ioops\hspace{0.3cm}{\ttfamily [static]}} {\bfseries Initial value\+:} \begin{DoxyCode}{0} \DoxyCodeLine{= \{} \DoxyCodeLine{ .read\_cb = stream\_srv\_iofd\_read\_cb,} \DoxyCodeLine{ .write\_cb = stream\_srv\_iofd\_write\_cb,} \DoxyCodeLine{\}} \end{DoxyCode} \mbox{\label{group__stream_gabc297deef700516694f2eab8d4455113}} \index{Osmocom Stream Socket@{Osmocom Stream Socket}!stream\_cli\_state\_names@{stream\_cli\_state\_names}} \index{stream\_cli\_state\_names@{stream\_cli\_state\_names}!Osmocom Stream Socket@{Osmocom Stream Socket}} \doxysubsubsection{stream\_cli\_state\_names} {\footnotesize\ttfamily const struct value\+\_\+string stream\+\_\+cli\+\_\+state\+\_\+names[$\,$]\hspace{0.3cm}{\ttfamily [static]}} {\bfseries Initial value\+:} \begin{DoxyCode}{0} \DoxyCodeLine{= \{} \DoxyCodeLine{ \{ STREAM\_CLI\_STATE\_CLOSED, \textcolor{stringliteral}{"{}CLOSED"{}} \},} \DoxyCodeLine{ \{ STREAM\_CLI\_STATE\_WAIT\_RECONNECT, \textcolor{stringliteral}{"{}WAIT\_RECONNECT"{}} \},} \DoxyCodeLine{ \{ STREAM\_CLI\_STATE\_CONNECTING, \textcolor{stringliteral}{"{}CONNECTING"{}} \},} \DoxyCodeLine{ \{ STREAM\_CLI\_STATE\_CONNECTED, \textcolor{stringliteral}{"{}CONNECTED"{}} \},} \DoxyCodeLine{ \{ 0, NULL \}} \DoxyCodeLine{\}} \end{DoxyCode}