\doxysection{stream.\+h}
\label{stream_8h_source}\index{include/osmocom/netif/stream.h@{include/osmocom/netif/stream.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00002\ }
\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#include\ <stdbool.h>}}
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <stdint.h>}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <unistd.h>}}
\DoxyCodeLine{00006\ }
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ <osmocom/core/msgb.h>}}
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#define\ OSMO\_STREAM\_SCTP\_MSG\_FLAGS\_NOTIFICATION\ 0x80\ }\textcolor{comment}{/*\ sctp\_recvmsg()\ flags=MSG\_NOTIFICATION,\ msgb\_data()\ contains\ "{}union\ sctp\_notification*"{}\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#define\ msgb\_sctp\_msg\_flags(msg)\ \ \ \ \ \ \ \ (msg)-\/>cb[2]}}
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#define\ msgb\_sctp\_ppid(msg)\ \ \ \ \ \ \ \ \ \ \ \ \ (msg)-\/>cb[3]}}
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#define\ msgb\_sctp\_stream(msg)\ \ \ \ \ \ \ \ \ \ \ (msg)-\/>cb[4]}}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00066\ \textcolor{keyword}{struct\ }osmo\_stream\_srv\_link;}
\DoxyCodeLine{00067\ }
\DoxyCodeLine{00068\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_srv\_link\_accept\_cb\_t)(\textcolor{keyword}{struct\ }osmo\_stream\_srv\_link\ *link,\ \textcolor{keywordtype}{int}\ fd);}
\DoxyCodeLine{00069\ }
\DoxyCodeLine{00070\ \textcolor{keyword}{struct\ }osmo\_stream\_srv\_link\ *osmo\_stream\_srv\_link\_create(\textcolor{keywordtype}{void}\ *ctx);}
\DoxyCodeLine{00071\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_link\_destroy(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link);}
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00073\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_link\_set\_name(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name);}
\DoxyCodeLine{00074\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *osmo\_stream\_srv\_link\_get\_name(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link);}
\DoxyCodeLine{00075\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_link\_set\_nodelay(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keywordtype}{bool}\ nodelay);}
\DoxyCodeLine{00076\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_link\_set\_priority(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keywordtype}{int}\ sk\_prio);}
\DoxyCodeLine{00077\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_link\_set\_ip\_dscp(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ uint8\_t\ ip\_dscp);}
\DoxyCodeLine{00078\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_link\_set\_addr(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *addr);}
\DoxyCodeLine{00079\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_link\_set\_addrs(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ **addr,\ \textcolor{keywordtype}{size\_t}\ addrcnt);}
\DoxyCodeLine{00080\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_link\_set\_port(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ uint16\_t\ port);}
\DoxyCodeLine{00081\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_link\_set\_proto(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ uint16\_t\ proto);}
\DoxyCodeLine{00082\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_link\_set\_type(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keywordtype}{int}\ type);}
\DoxyCodeLine{00083\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_link\_set\_domain(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keywordtype}{int}\ domain);}
\DoxyCodeLine{00084\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_link\_set\_accept\_cb(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ osmo\_stream\_srv\_link\_accept\_cb\_t\ accept\_cb);}
\DoxyCodeLine{00085\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_link\_set\_data(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keywordtype}{void}\ *data);}
\DoxyCodeLine{00086\ \textcolor{keywordtype}{void}\ *osmo\_stream\_srv\_link\_get\_data(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link);}
\DoxyCodeLine{00087\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_link\_set\_tx\_queue\_max\_length(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ size);}
\DoxyCodeLine{00088\ \textcolor{keywordtype}{char}\ *osmo\_stream\_srv\_link\_get\_sockname(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link);}
\DoxyCodeLine{00089\ \textcolor{keyword}{struct\ }osmo\_fd\ *osmo\_stream\_srv\_link\_get\_ofd(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link);}
\DoxyCodeLine{00090\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_link\_get\_fd(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link);}
\DoxyCodeLine{00091\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_link\_set\_msgb\_alloc\_info(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ size,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ headroom);}
\DoxyCodeLine{00092\ \textcolor{keywordtype}{bool}\ osmo\_stream\_srv\_link\_is\_opened(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link);}
\DoxyCodeLine{00093\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_link\_open(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link);}
\DoxyCodeLine{00094\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_link\_close(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link);}
\DoxyCodeLine{00095\ }
\DoxyCodeLine{00096\ \textcolor{keyword}{enum}\ osmo\_stream\_srv\_link\_param\ \{}
\DoxyCodeLine{00097\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_LINK\_PAR\_SCTP\_SOCKOPT\_AUTH\_SUPPORTED,\ \textcolor{comment}{/*\ uint8\_t:\ 0\ disable,\ 1\ enable,\ 2\ force\ disable,\ 3\ force\ enable\ */}}
\DoxyCodeLine{00098\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_LINK\_PAR\_SCTP\_SOCKOPT\_ASCONF\_SUPPORTED,\ \textcolor{comment}{/*\ uint8\_t:\ 0\ disable,\ 1\ enable,\ 2\ force\ disable,\ 3\ force\ enable\ */}}
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_LINK\_PAR\_SCTP\_INIT\_NUM\_OSTREAMS,\ \textcolor{comment}{/*\ uint16\_t:\ amount\ of\ streams\ */}}
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_LINK\_PAR\_SCTP\_INIT\_MAX\_INSTREAMS,\ \textcolor{comment}{/*\ uint16\_t:\ amount\ of\ streams\ */}}
\DoxyCodeLine{00101\ }
\DoxyCodeLine{00102\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_LINK\_PAR\_TCP\_SOCKOPT\_KEEPALIVE\ =\ 256,\ \textcolor{comment}{/*\ uint8\_t:\ 0\ disable,\ 1\ enable\ */}}
\DoxyCodeLine{00103\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_LINK\_PAR\_TCP\_SOCKOPT\_KEEPIDLE,\ \textcolor{comment}{/*\ int:\ seconds\ */}}
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_LINK\_PAR\_TCP\_SOCKOPT\_KEEPINTVL,\ \textcolor{comment}{/*\ int:\ seconds\ */}}
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_LINK\_PAR\_TCP\_SOCKOPT\_KEEPCNT,\ \textcolor{comment}{/*\ int:\ Number\ of\ probes\ */}}
\DoxyCodeLine{00106\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_LINK\_PAR\_TCP\_SOCKOPT\_USER\_TIMEOUT,\ \textcolor{comment}{/*\ unsigned\ int:\ 0\ "{}system\ default"{},\ >0\ see\ sockopt\ TCP\_USER\_TIMEOUT\ */}}
\DoxyCodeLine{00107\ \};}
\DoxyCodeLine{00108\ }
\DoxyCodeLine{00109\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_link\_set\_param(\textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keyword}{enum}\ osmo\_stream\_srv\_link\_param\ par,}
\DoxyCodeLine{00110\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *val,\ \textcolor{keywordtype}{size\_t}\ val\_len);}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00114\ \textcolor{keyword}{struct\ }osmo\_stream\_srv;}
\DoxyCodeLine{00115\ }
\DoxyCodeLine{00116\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_srv\_read\_cb\_t)(\textcolor{keyword}{struct\ }osmo\_stream\_srv\ *conn);}
\DoxyCodeLine{00117\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_srv\_closed\_cb\_t)(\textcolor{keyword}{struct\ }osmo\_stream\_srv\ *conn);}
\DoxyCodeLine{00118\ }
\DoxyCodeLine{00124\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_srv\_read\_cb2\_t)(\textcolor{keyword}{struct\ }osmo\_stream\_srv\ *conn,\ \textcolor{keywordtype}{int}\ res,\ \textcolor{keyword}{struct\ }msgb\ *msg);}
\DoxyCodeLine{00125\ }
\DoxyCodeLine{00126\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_srv\_segmentation\_cb\_t)(\textcolor{keyword}{struct\ }msgb\ *msg);}
\DoxyCodeLine{00127\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_srv\_segmentation\_cb2\_t)(\textcolor{keyword}{struct\ }osmo\_stream\_srv\ *conn,\ \textcolor{keyword}{struct\ }msgb\ *msg);}
\DoxyCodeLine{00128\ }
\DoxyCodeLine{00129\ \textcolor{keyword}{struct\ }osmo\_stream\_srv\ *osmo\_stream\_srv\_create(\textcolor{keywordtype}{void}\ *ctx,\ \textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keywordtype}{int}\ fd,}
\DoxyCodeLine{00130\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ osmo\_stream\_srv\_read\_cb\_t\ read\_cb,}
\DoxyCodeLine{00131\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ osmo\_stream\_srv\_closed\_cb\_t\ closed\_cb,}
\DoxyCodeLine{00132\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *data);}
\DoxyCodeLine{00133\ \textcolor{keyword}{struct\ }osmo\_stream\_srv\ *osmo\_stream\_srv\_create2(\textcolor{keywordtype}{void}\ *ctx,\ \textcolor{keyword}{struct}\ osmo\_stream\_srv\_link\ *link,\ \textcolor{keywordtype}{int}\ fd,\ \textcolor{keywordtype}{void}\ *data);}
\DoxyCodeLine{00134\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_set\_name(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name);}
\DoxyCodeLine{00135\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_set\_name\_f(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *fmt,\ ...);}
\DoxyCodeLine{00136\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *osmo\_stream\_srv\_get\_name(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn);}
\DoxyCodeLine{00137\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_set\_read\_cb(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn,\ osmo\_stream\_srv\_read\_cb2\_t\ read\_cb);}
\DoxyCodeLine{00138\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_set\_closed\_cb(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn,\ osmo\_stream\_srv\_closed\_cb\_t\ close\_cb);}
\DoxyCodeLine{00139\ \textcolor{keywordtype}{void}\ *osmo\_stream\_srv\_get\_data(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn);}
\DoxyCodeLine{00140\ \textcolor{keyword}{struct\ }osmo\_stream\_srv\_link\ *osmo\_stream\_srv\_get\_master(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn);}
\DoxyCodeLine{00141\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *osmo\_stream\_srv\_get\_sockname(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn);}
\DoxyCodeLine{00142\ \textcolor{keyword}{struct\ }osmo\_fd\ *osmo\_stream\_srv\_get\_ofd(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *srv);}
\DoxyCodeLine{00143\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_get\_fd(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_srv\ *srv);}
\DoxyCodeLine{00144\ \textcolor{keyword}{struct\ }osmo\_io\_fd\ *osmo\_stream\_srv\_get\_iofd(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_srv\ *srv);}
\DoxyCodeLine{00145\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_destroy(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn);}
\DoxyCodeLine{00146\ }
\DoxyCodeLine{00147\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_set\_flush\_and\_destroy(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn);}
\DoxyCodeLine{00148\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_set\_data(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn,\ \textcolor{keywordtype}{void}\ *data);}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00150\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_set\_segmentation\_cb(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn,\ osmo\_stream\_srv\_segmentation\_cb\_t\ segmentation\_cb);}
\DoxyCodeLine{00151\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_set\_segmentation\_cb2(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn,\ osmo\_stream\_srv\_segmentation\_cb2\_t\ segmentation\_cb2);}
\DoxyCodeLine{00152\ }
\DoxyCodeLine{00153\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_send(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn,\ \textcolor{keyword}{struct}\ msgb\ *msg);}
\DoxyCodeLine{00154\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_recv(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn,\ \textcolor{keyword}{struct}\ msgb\ *msg);}
\DoxyCodeLine{00155\ }
\DoxyCodeLine{00156\ \textcolor{keywordtype}{void}\ osmo\_stream\_srv\_clear\_tx\_queue(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn);}
\DoxyCodeLine{00157\ }
\DoxyCodeLine{00158\ \textcolor{keyword}{enum}\ osmo\_stream\_srv\_param\ \{}
\DoxyCodeLine{00159\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_PAR\_TCP\_SOCKOPT\_KEEPALIVE\ =\ 256,\ \textcolor{comment}{/*\ uint8\_t:\ 0\ disable,\ 1\ enable\ */}}
\DoxyCodeLine{00160\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_PAR\_TCP\_SOCKOPT\_KEEPIDLE,\ \textcolor{comment}{/*\ int:\ seconds\ */}}
\DoxyCodeLine{00161\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_PAR\_TCP\_SOCKOPT\_KEEPINTVL,\ \textcolor{comment}{/*\ int:\ seconds\ */}}
\DoxyCodeLine{00162\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_PAR\_TCP\_SOCKOPT\_KEEPCNT,\ \textcolor{comment}{/*\ int:\ Number\ of\ probes\ */}}
\DoxyCodeLine{00163\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_SRV\_PAR\_TCP\_SOCKOPT\_USER\_TIMEOUT,\ \textcolor{comment}{/*\ unsigned\ int:\ 0\ "{}system\ default"{},\ >0\ see\ sockopt\ TCP\_USER\_TIMEOUT\ */}}
\DoxyCodeLine{00164\ \};}
\DoxyCodeLine{00165\ \textcolor{keywordtype}{int}\ osmo\_stream\_srv\_set\_param(\textcolor{keyword}{struct}\ osmo\_stream\_srv\ *conn,\ \textcolor{keyword}{enum}\ osmo\_stream\_srv\_param\ par,}
\DoxyCodeLine{00166\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *val,\ \textcolor{keywordtype}{size\_t}\ val\_len);}
\DoxyCodeLine{00167\ }
\DoxyCodeLine{00206\ \textcolor{keyword}{struct\ }osmo\_stream\_cli;}
\DoxyCodeLine{00207\ }
\DoxyCodeLine{00208\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_cli\_connect\_cb\_t)(\textcolor{keyword}{struct\ }osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00209\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_cli\_disconnect\_cb\_t)(\textcolor{keyword}{struct\ }osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00210\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_cli\_read\_cb\_t)(\textcolor{keyword}{struct\ }osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00211\ }
\DoxyCodeLine{00217\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_cli\_read\_cb2\_t)(\textcolor{keyword}{struct\ }osmo\_stream\_cli\ *cli,\ \textcolor{keywordtype}{int}\ res,\ \textcolor{keyword}{struct\ }msgb\ *msg);}
\DoxyCodeLine{00218\ }
\DoxyCodeLine{00219\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_cli\_segmentation\_cb\_t)(\textcolor{keyword}{struct\ }msgb\ *msg);}
\DoxyCodeLine{00220\ \textcolor{keyword}{typedef}\ int\ (*osmo\_stream\_cli\_segmentation\_cb2\_t)(\textcolor{keyword}{struct\ }osmo\_stream\_cli\ *cli,\ \textcolor{keyword}{struct\ }msgb\ *msg);}
\DoxyCodeLine{00221\ }
\DoxyCodeLine{00222\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_name(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name);}
\DoxyCodeLine{00223\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_name\_f(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *fmt,\ ...);}
\DoxyCodeLine{00224\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *osmo\_stream\_cli\_get\_name(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00225\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_nodelay(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keywordtype}{bool}\ nodelay);}
\DoxyCodeLine{00226\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_set\_priority(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keywordtype}{int}\ sk\_prio);}
\DoxyCodeLine{00227\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_set\_ip\_dscp(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ uint8\_t\ ip\_dscp);}
\DoxyCodeLine{00228\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_addr(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *addr);}
\DoxyCodeLine{00229\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_set\_addrs(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ **addr,\ \textcolor{keywordtype}{size\_t}\ addrcnt);}
\DoxyCodeLine{00230\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_port(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ uint16\_t\ port);}
\DoxyCodeLine{00231\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_set\_type(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keywordtype}{int}\ type);}
\DoxyCodeLine{00232\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_set\_domain(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keywordtype}{int}\ domain);}
\DoxyCodeLine{00233\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_proto(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ uint16\_t\ proto);}
\DoxyCodeLine{00234\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_local\_addr(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *addr);}
\DoxyCodeLine{00235\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_set\_local\_addrs(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ **addr,\ \textcolor{keywordtype}{size\_t}\ addrcnt);}
\DoxyCodeLine{00236\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_local\_port(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ uint16\_t\ port);}
\DoxyCodeLine{00237\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_data(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keywordtype}{void}\ *data);}
\DoxyCodeLine{00238\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_reconnect\_timeout(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keywordtype}{int}\ timeout);}
\DoxyCodeLine{00239\ \textcolor{keywordtype}{void}\ *osmo\_stream\_cli\_get\_data(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00240\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_set\_tx\_queue\_max\_length(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ size);}
\DoxyCodeLine{00241\ \textcolor{keywordtype}{char}\ *osmo\_stream\_cli\_get\_sockname(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00242\ \textcolor{keyword}{struct\ }osmo\_fd\ *osmo\_stream\_cli\_get\_ofd(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00243\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_get\_fd(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00244\ \textcolor{keyword}{struct\ }osmo\_io\_fd\ *osmo\_stream\_cli\_get\_iofd(\textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00245\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_connect\_cb(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ osmo\_stream\_cli\_connect\_cb\_t\ connect\_cb);}
\DoxyCodeLine{00246\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_disconnect\_cb(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ osmo\_stream\_cli\_disconnect\_cb\_t\ disconnect\_cb);}
\DoxyCodeLine{00247\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_read\_cb(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ osmo\_stream\_cli\_read\_cb\_t\ read\_cb);}
\DoxyCodeLine{00248\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_read\_cb2(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ osmo\_stream\_cli\_read\_cb2\_t\ read\_cb);}
\DoxyCodeLine{00249\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_segmentation\_cb(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ osmo\_stream\_cli\_segmentation\_cb\_t\ segmentation\_cb);}
\DoxyCodeLine{00250\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_set\_segmentation\_cb2(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ osmo\_stream\_cli\_segmentation\_cb2\_t\ segmentation\_cb2);}
\DoxyCodeLine{00251\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_reconnect(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00252\ \textcolor{keywordtype}{bool}\ osmo\_stream\_cli\_is\_connected(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00253\ }
\DoxyCodeLine{00254\ \textcolor{keyword}{struct\ }osmo\_stream\_cli\ *osmo\_stream\_cli\_create(\textcolor{keywordtype}{void}\ *ctx);}
\DoxyCodeLine{00255\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_destroy(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00256\ }
\DoxyCodeLine{00257\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_open(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00258\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_open2(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keywordtype}{int}\ reconnect)\ \(\backslash\)}
\DoxyCodeLine{00259\ \ \ \ \ \ \ \ \ OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use\ osmo\_stream\_cli\_set\_reconnect\_timeout()\ or\ osmo\_stream\_cli\_reconnect()\ instead"{}});}
\DoxyCodeLine{00260\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_close(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00261\ }
\DoxyCodeLine{00262\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_send(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keyword}{struct}\ msgb\ *msg);}
\DoxyCodeLine{00263\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_recv(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keyword}{struct}\ msgb\ *msg);}
\DoxyCodeLine{00264\ }
\DoxyCodeLine{00265\ \textcolor{keywordtype}{void}\ osmo\_stream\_cli\_clear\_tx\_queue(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli);}
\DoxyCodeLine{00266\ }
\DoxyCodeLine{00267\ \textcolor{keyword}{enum}\ osmo\_stream\_cli\_param\ \{}
\DoxyCodeLine{00268\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_SCTP\_SOCKOPT\_AUTH\_SUPPORTED,\ \textcolor{comment}{/*\ uint8\_t:\ 0\ disable,\ 1\ enable,\ 2\ force\ disable,\ 3\ force\ enable\ */}}
\DoxyCodeLine{00269\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_SCTP\_SOCKOPT\_ASCONF\_SUPPORTED,\ \textcolor{comment}{/*\ uint8\_t:\ 0\ disable,\ 1\ enable,\ 2\ force\ disable,\ 3\ force\ enable\ */}}
\DoxyCodeLine{00270\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_SCTP\_INIT\_NUM\_OSTREAMS,\ \textcolor{comment}{/*\ uint16\_t:\ amount\ of\ streams\ */}}
\DoxyCodeLine{00271\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_SCTP\_INIT\_MAX\_INSTREAMS,\ \textcolor{comment}{/*\ uint16\_t:\ amount\ of\ streams\ */}}
\DoxyCodeLine{00272\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_SCTP\_INIT\_MAX\_ATTEMPTS,\ \textcolor{comment}{/*\ uint16\_t:\ amount\ of\ attempts\ */}}
\DoxyCodeLine{00273\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_SCTP\_INIT\_TIMEOUT,\ \textcolor{comment}{/*\ uint16\_t:\ milliseconds\ */}}
\DoxyCodeLine{00274\ }
\DoxyCodeLine{00275\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_TCP\_SOCKOPT\_KEEPALIVE\ =\ 256,\ \textcolor{comment}{/*\ uint8\_t:\ 0\ disable,\ 1\ enable\ */}}
\DoxyCodeLine{00276\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_TCP\_SOCKOPT\_KEEPIDLE,\ \textcolor{comment}{/*\ int:\ seconds\ */}}
\DoxyCodeLine{00277\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_TCP\_SOCKOPT\_KEEPINTVL,\ \textcolor{comment}{/*\ int:\ seconds\ */}}
\DoxyCodeLine{00278\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_TCP\_SOCKOPT\_KEEPCNT,\ \textcolor{comment}{/*\ int:\ Number\ of\ probes\ */}}
\DoxyCodeLine{00279\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_CLI\_PAR\_TCP\_SOCKOPT\_USER\_TIMEOUT,\ \textcolor{comment}{/*\ unsigned\ int:\ 0\ "{}system\ default"{},\ >0\ see\ sockopt\ TCP\_USER\_TIMEOUT\ */}}
\DoxyCodeLine{00280\ \};}
\DoxyCodeLine{00281\ }
\DoxyCodeLine{00282\ \textcolor{keywordtype}{int}\ osmo\_stream\_cli\_set\_param(\textcolor{keyword}{struct}\ osmo\_stream\_cli\ *cli,\ \textcolor{keyword}{enum}\ osmo\_stream\_cli\_param\ par,}
\DoxyCodeLine{00283\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *val,\ \textcolor{keywordtype}{size\_t}\ val\_len);}
\DoxyCodeLine{00284\ }

\end{DoxyCode}
