\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{1 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{2 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#include <stdbool.h>}}
\DoxyCodeLine{4 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <unistd.h>}}
\DoxyCodeLine{6 }
\DoxyCodeLine{7 \textcolor{preprocessor}{\#include <osmocom/core/msgb.h>}}
\DoxyCodeLine{8 }
\DoxyCodeLine{12 \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{13 \textcolor{preprocessor}{\#define msgb\_sctp\_msg\_flags(msg)        (msg)-\/>cb[2]}}
\DoxyCodeLine{14 }
\DoxyCodeLine{16 \textcolor{preprocessor}{\#define msgb\_sctp\_ppid(msg)             (msg)-\/>cb[3]}}
\DoxyCodeLine{18 \textcolor{preprocessor}{\#define msgb\_sctp\_stream(msg)           (msg)-\/>cb[4]}}
\DoxyCodeLine{19 }
\DoxyCodeLine{66 \textcolor{keyword}{struct }osmo\_stream\_srv\_link;}
\DoxyCodeLine{67 }
\DoxyCodeLine{68 \textcolor{keyword}{typedef} int (*osmo\_stream\_srv\_link\_accept\_cb\_t)(\textcolor{keyword}{struct }osmo\_stream\_srv\_link *link, \textcolor{keywordtype}{int} fd);}
\DoxyCodeLine{69 }
\DoxyCodeLine{70 \textcolor{keyword}{struct }osmo\_stream\_srv\_link *osmo\_stream\_srv\_link\_create(\textcolor{keywordtype}{void} *ctx);}
\DoxyCodeLine{71 \textcolor{keywordtype}{void} osmo\_stream\_srv\_link\_destroy(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link);}
\DoxyCodeLine{72 }
\DoxyCodeLine{73 \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{74 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_stream\_srv\_link\_get\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_srv\_link *link);}
\DoxyCodeLine{75 \textcolor{keywordtype}{void} osmo\_stream\_srv\_link\_set\_nodelay(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link, \textcolor{keywordtype}{bool} nodelay);}
\DoxyCodeLine{76 \textcolor{keywordtype}{int} osmo\_stream\_srv\_link\_set\_priority(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link, \textcolor{keywordtype}{int} sk\_prio);}
\DoxyCodeLine{77 \textcolor{keywordtype}{int} osmo\_stream\_srv\_link\_set\_ip\_dscp(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link, uint8\_t ip\_dscp);}
\DoxyCodeLine{78 \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{79 \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{80 \textcolor{keywordtype}{void} osmo\_stream\_srv\_link\_set\_port(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link, uint16\_t port);}
\DoxyCodeLine{81 \textcolor{keywordtype}{void} osmo\_stream\_srv\_link\_set\_proto(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link, uint16\_t proto);}
\DoxyCodeLine{82 \textcolor{keywordtype}{int} osmo\_stream\_srv\_link\_set\_type(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link, \textcolor{keywordtype}{int} type);}
\DoxyCodeLine{83 \textcolor{keywordtype}{int} osmo\_stream\_srv\_link\_set\_domain(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link, \textcolor{keywordtype}{int} domain);}
\DoxyCodeLine{84 \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{85 \textcolor{keywordtype}{void} osmo\_stream\_srv\_link\_set\_data(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link, \textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{86 \textcolor{keywordtype}{void} *osmo\_stream\_srv\_link\_get\_data(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link);}
\DoxyCodeLine{87 \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{88 \textcolor{keywordtype}{char} *osmo\_stream\_srv\_link\_get\_sockname(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_srv\_link *link);}
\DoxyCodeLine{89 \textcolor{keyword}{struct }osmo\_fd *osmo\_stream\_srv\_link\_get\_ofd(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link);}
\DoxyCodeLine{90 \textcolor{keywordtype}{int} osmo\_stream\_srv\_link\_get\_fd(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_srv\_link *link);}
\DoxyCodeLine{91 \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{92 \textcolor{keywordtype}{bool} osmo\_stream\_srv\_link\_is\_opened(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_srv\_link *link);}
\DoxyCodeLine{93 \textcolor{keywordtype}{int} osmo\_stream\_srv\_link\_open(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link);}
\DoxyCodeLine{94 \textcolor{keywordtype}{void} osmo\_stream\_srv\_link\_close(\textcolor{keyword}{struct} osmo\_stream\_srv\_link *link);}
\DoxyCodeLine{95 }
\DoxyCodeLine{96 \textcolor{keyword}{enum} osmo\_stream\_srv\_link\_param \{}
\DoxyCodeLine{97         OSMO\_STREAM\_SRV\_LINK\_PAR\_SCTP\_SOCKOPT\_AUTH\_SUPPORTED, \textcolor{comment}{/* uint8\_t: 0 disable, 1 enable, 2 force disable, 3 force enable */}}
\DoxyCodeLine{98         OSMO\_STREAM\_SRV\_LINK\_PAR\_SCTP\_SOCKOPT\_ASCONF\_SUPPORTED, \textcolor{comment}{/* uint8\_t: 0 disable, 1 enable, 2 force disable, 3 force enable */}}
\DoxyCodeLine{99         OSMO\_STREAM\_SRV\_LINK\_PAR\_SCTP\_INIT\_NUM\_OSTREAMS, \textcolor{comment}{/* uint16\_t: amount of streams */}}
\DoxyCodeLine{100         OSMO\_STREAM\_SRV\_LINK\_PAR\_SCTP\_INIT\_MAX\_INSTREAMS, \textcolor{comment}{/* uint16\_t: amount of streams */}}
\DoxyCodeLine{101 }
\DoxyCodeLine{102         OSMO\_STREAM\_SRV\_LINK\_PAR\_TCP\_SOCKOPT\_KEEPALIVE = 256, \textcolor{comment}{/* uint8\_t: 0 disable, 1 enable */}}
\DoxyCodeLine{103         OSMO\_STREAM\_SRV\_LINK\_PAR\_TCP\_SOCKOPT\_KEEPIDLE, \textcolor{comment}{/* int: seconds */}}
\DoxyCodeLine{104         OSMO\_STREAM\_SRV\_LINK\_PAR\_TCP\_SOCKOPT\_KEEPINTVL, \textcolor{comment}{/* int: seconds */}}
\DoxyCodeLine{105         OSMO\_STREAM\_SRV\_LINK\_PAR\_TCP\_SOCKOPT\_KEEPCNT, \textcolor{comment}{/* int: Number of probes */}}
\DoxyCodeLine{106         OSMO\_STREAM\_SRV\_LINK\_PAR\_TCP\_SOCKOPT\_USER\_TIMEOUT, \textcolor{comment}{/* unsigned int: 0 "{}system default"{}, >0 see sockopt TCP\_USER\_TIMEOUT */}}
\DoxyCodeLine{107 \};}
\DoxyCodeLine{108 }
\DoxyCodeLine{109 \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{110                                    \textcolor{keywordtype}{void} *val, \textcolor{keywordtype}{size\_t} val\_len);}
\DoxyCodeLine{111 }
\DoxyCodeLine{114 \textcolor{keyword}{struct }osmo\_stream\_srv;}
\DoxyCodeLine{115 }
\DoxyCodeLine{116 \textcolor{keyword}{typedef} int (*osmo\_stream\_srv\_read\_cb\_t)(\textcolor{keyword}{struct }osmo\_stream\_srv *conn);}
\DoxyCodeLine{117 \textcolor{keyword}{typedef} int (*osmo\_stream\_srv\_closed\_cb\_t)(\textcolor{keyword}{struct }osmo\_stream\_srv *conn);}
\DoxyCodeLine{118 }
\DoxyCodeLine{124 \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{125 }
\DoxyCodeLine{126 \textcolor{keyword}{typedef} int (*osmo\_stream\_srv\_segmentation\_cb\_t)(\textcolor{keyword}{struct }msgb *msg);}
\DoxyCodeLine{127 \textcolor{keyword}{typedef} int (*osmo\_stream\_srv\_segmentation\_cb2\_t)(\textcolor{keyword}{struct }osmo\_stream\_srv *conn, \textcolor{keyword}{struct }msgb *msg);}
\DoxyCodeLine{128 }
\DoxyCodeLine{129 \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{130                                                osmo\_stream\_srv\_read\_cb\_t read\_cb,}
\DoxyCodeLine{131                                                osmo\_stream\_srv\_closed\_cb\_t closed\_cb,}
\DoxyCodeLine{132                                                \textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{133 \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{134 \textcolor{keywordtype}{void} osmo\_stream\_srv\_set\_name(\textcolor{keyword}{struct} osmo\_stream\_srv *conn, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{135 \textcolor{keywordtype}{void} osmo\_stream\_srv\_set\_name\_f(\textcolor{keyword}{struct} osmo\_stream\_srv *conn, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *fmt, ...);}
\DoxyCodeLine{136 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_stream\_srv\_get\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_srv *conn);}
\DoxyCodeLine{137 \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{138 \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{139 \textcolor{keywordtype}{void} *osmo\_stream\_srv\_get\_data(\textcolor{keyword}{struct} osmo\_stream\_srv *conn);}
\DoxyCodeLine{140 \textcolor{keywordtype}{int} osmo\_stream\_srv\_set\_tx\_queue\_max\_length(\textcolor{keyword}{struct} osmo\_stream\_srv *conn, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} size);}
\DoxyCodeLine{141 \textcolor{keyword}{struct }osmo\_stream\_srv\_link *osmo\_stream\_srv\_get\_master(\textcolor{keyword}{struct} osmo\_stream\_srv *conn);}
\DoxyCodeLine{142 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_stream\_srv\_get\_sockname(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_srv *conn);}
\DoxyCodeLine{143 \textcolor{keyword}{struct }osmo\_fd *osmo\_stream\_srv\_get\_ofd(\textcolor{keyword}{struct} osmo\_stream\_srv *srv);}
\DoxyCodeLine{144 \textcolor{keywordtype}{int} osmo\_stream\_srv\_get\_fd(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_srv *srv);}
\DoxyCodeLine{145 \textcolor{keyword}{struct }osmo\_io\_fd *osmo\_stream\_srv\_get\_iofd(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_srv *srv);}
\DoxyCodeLine{146 \textcolor{keywordtype}{void} osmo\_stream\_srv\_destroy(\textcolor{keyword}{struct} osmo\_stream\_srv *conn);}
\DoxyCodeLine{147 }
\DoxyCodeLine{148 \textcolor{keywordtype}{void} osmo\_stream\_srv\_set\_flush\_and\_destroy(\textcolor{keyword}{struct} osmo\_stream\_srv *conn);}
\DoxyCodeLine{149 \textcolor{keywordtype}{void} osmo\_stream\_srv\_set\_data(\textcolor{keyword}{struct} osmo\_stream\_srv *conn, \textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{150 }
\DoxyCodeLine{151 \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{152 \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{153 }
\DoxyCodeLine{154 \textcolor{keywordtype}{void} osmo\_stream\_srv\_send(\textcolor{keyword}{struct} osmo\_stream\_srv *conn, \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{155 \textcolor{keywordtype}{int} osmo\_stream\_srv\_recv(\textcolor{keyword}{struct} osmo\_stream\_srv *conn, \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{156 }
\DoxyCodeLine{157 \textcolor{keywordtype}{void} osmo\_stream\_srv\_clear\_tx\_queue(\textcolor{keyword}{struct} osmo\_stream\_srv *conn);}
\DoxyCodeLine{158 }
\DoxyCodeLine{159 \textcolor{keyword}{enum} osmo\_stream\_srv\_param \{}
\DoxyCodeLine{160         OSMO\_STREAM\_SRV\_PAR\_TCP\_SOCKOPT\_KEEPALIVE = 256, \textcolor{comment}{/* uint8\_t: 0 disable, 1 enable */}}
\DoxyCodeLine{161         OSMO\_STREAM\_SRV\_PAR\_TCP\_SOCKOPT\_KEEPIDLE, \textcolor{comment}{/* int: seconds */}}
\DoxyCodeLine{162         OSMO\_STREAM\_SRV\_PAR\_TCP\_SOCKOPT\_KEEPINTVL, \textcolor{comment}{/* int: seconds */}}
\DoxyCodeLine{163         OSMO\_STREAM\_SRV\_PAR\_TCP\_SOCKOPT\_KEEPCNT, \textcolor{comment}{/* int: Number of probes */}}
\DoxyCodeLine{164         OSMO\_STREAM\_SRV\_PAR\_TCP\_SOCKOPT\_USER\_TIMEOUT, \textcolor{comment}{/* unsigned int: 0 "{}system default"{}, >0 see sockopt TCP\_USER\_TIMEOUT */}}
\DoxyCodeLine{165 \};}
\DoxyCodeLine{166 \textcolor{keywordtype}{int} osmo\_stream\_srv\_set\_param(\textcolor{keyword}{struct} osmo\_stream\_srv *conn, \textcolor{keyword}{enum} osmo\_stream\_srv\_param par,}
\DoxyCodeLine{167                                \textcolor{keywordtype}{void} *val, \textcolor{keywordtype}{size\_t} val\_len);}
\DoxyCodeLine{168 }
\DoxyCodeLine{207 \textcolor{keyword}{struct }osmo\_stream\_cli;}
\DoxyCodeLine{208 }
\DoxyCodeLine{209 \textcolor{keyword}{typedef} int (*osmo\_stream\_cli\_connect\_cb\_t)(\textcolor{keyword}{struct }osmo\_stream\_cli *cli);}
\DoxyCodeLine{210 \textcolor{keyword}{typedef} int (*osmo\_stream\_cli\_disconnect\_cb\_t)(\textcolor{keyword}{struct }osmo\_stream\_cli *cli);}
\DoxyCodeLine{211 \textcolor{keyword}{typedef} int (*osmo\_stream\_cli\_read\_cb\_t)(\textcolor{keyword}{struct }osmo\_stream\_cli *cli);}
\DoxyCodeLine{212 }
\DoxyCodeLine{218 \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{219 }
\DoxyCodeLine{220 \textcolor{keyword}{typedef} int (*osmo\_stream\_cli\_segmentation\_cb\_t)(\textcolor{keyword}{struct }msgb *msg);}
\DoxyCodeLine{221 \textcolor{keyword}{typedef} int (*osmo\_stream\_cli\_segmentation\_cb2\_t)(\textcolor{keyword}{struct }osmo\_stream\_cli *cli, \textcolor{keyword}{struct }msgb *msg);}
\DoxyCodeLine{222 }
\DoxyCodeLine{223 \textcolor{keywordtype}{void} osmo\_stream\_cli\_set\_name(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{224 \textcolor{keywordtype}{void} osmo\_stream\_cli\_set\_name\_f(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *fmt, ...);}
\DoxyCodeLine{225 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_stream\_cli\_get\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{226 \textcolor{keywordtype}{void} osmo\_stream\_cli\_set\_nodelay(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keywordtype}{bool} nodelay);}
\DoxyCodeLine{227 \textcolor{keywordtype}{int} osmo\_stream\_cli\_set\_priority(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keywordtype}{int} sk\_prio);}
\DoxyCodeLine{228 \textcolor{keywordtype}{int} osmo\_stream\_cli\_set\_ip\_dscp(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, uint8\_t ip\_dscp);}
\DoxyCodeLine{229 \textcolor{keywordtype}{void} osmo\_stream\_cli\_set\_addr(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *addr);}
\DoxyCodeLine{230 \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{231 \textcolor{keywordtype}{void} osmo\_stream\_cli\_set\_port(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, uint16\_t port);}
\DoxyCodeLine{232 \textcolor{keywordtype}{int} osmo\_stream\_cli\_set\_type(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keywordtype}{int} type);}
\DoxyCodeLine{233 \textcolor{keywordtype}{int} osmo\_stream\_cli\_set\_domain(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keywordtype}{int} domain);}
\DoxyCodeLine{234 \textcolor{keywordtype}{void} osmo\_stream\_cli\_set\_proto(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, uint16\_t proto);}
\DoxyCodeLine{235 \textcolor{keywordtype}{void} osmo\_stream\_cli\_set\_local\_addr(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *addr);}
\DoxyCodeLine{236 \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{237 \textcolor{keywordtype}{void} osmo\_stream\_cli\_set\_local\_port(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, uint16\_t port);}
\DoxyCodeLine{238 \textcolor{keywordtype}{void} osmo\_stream\_cli\_set\_data(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{239 \textcolor{keywordtype}{void} osmo\_stream\_cli\_set\_reconnect\_timeout(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keywordtype}{int} timeout);}
\DoxyCodeLine{240 \textcolor{keywordtype}{void} *osmo\_stream\_cli\_get\_data(\textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{241 \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{242 \textcolor{keywordtype}{char} *osmo\_stream\_cli\_get\_sockname(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{243 \textcolor{keyword}{struct }osmo\_fd *osmo\_stream\_cli\_get\_ofd(\textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{244 \textcolor{keywordtype}{int} osmo\_stream\_cli\_get\_fd(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{245 \textcolor{keyword}{struct }osmo\_io\_fd *osmo\_stream\_cli\_get\_iofd(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{246 \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{247 \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{248 \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{249 \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{250 \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{251 \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{252 \textcolor{keywordtype}{void} osmo\_stream\_cli\_reconnect(\textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{253 \textcolor{keywordtype}{bool} osmo\_stream\_cli\_is\_connected(\textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{254 }
\DoxyCodeLine{255 \textcolor{keyword}{struct }osmo\_stream\_cli *osmo\_stream\_cli\_create(\textcolor{keywordtype}{void} *ctx);}
\DoxyCodeLine{256 \textcolor{keywordtype}{void} osmo\_stream\_cli\_destroy(\textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{257 }
\DoxyCodeLine{258 \textcolor{keywordtype}{int} osmo\_stream\_cli\_open(\textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{259 \textcolor{keywordtype}{int} osmo\_stream\_cli\_open2(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keywordtype}{int} reconnect) \(\backslash\)}
\DoxyCodeLine{260         OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use osmo\_stream\_cli\_set\_reconnect\_timeout() or osmo\_stream\_cli\_reconnect() instead"{}});}
\DoxyCodeLine{261 \textcolor{keywordtype}{void} osmo\_stream\_cli\_close(\textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{262 }
\DoxyCodeLine{263 \textcolor{keywordtype}{void} osmo\_stream\_cli\_send(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{264 \textcolor{keywordtype}{int} osmo\_stream\_cli\_recv(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{265 }
\DoxyCodeLine{266 \textcolor{keywordtype}{void} osmo\_stream\_cli\_clear\_tx\_queue(\textcolor{keyword}{struct} osmo\_stream\_cli *cli);}
\DoxyCodeLine{267 }
\DoxyCodeLine{268 \textcolor{keyword}{enum} osmo\_stream\_cli\_param \{}
\DoxyCodeLine{269         OSMO\_STREAM\_CLI\_PAR\_SCTP\_SOCKOPT\_AUTH\_SUPPORTED, \textcolor{comment}{/* uint8\_t: 0 disable, 1 enable, 2 force disable, 3 force enable */}}
\DoxyCodeLine{270         OSMO\_STREAM\_CLI\_PAR\_SCTP\_SOCKOPT\_ASCONF\_SUPPORTED, \textcolor{comment}{/* uint8\_t: 0 disable, 1 enable, 2 force disable, 3 force enable */}}
\DoxyCodeLine{271         OSMO\_STREAM\_CLI\_PAR\_SCTP\_INIT\_NUM\_OSTREAMS, \textcolor{comment}{/* uint16\_t: amount of streams */}}
\DoxyCodeLine{272         OSMO\_STREAM\_CLI\_PAR\_SCTP\_INIT\_MAX\_INSTREAMS, \textcolor{comment}{/* uint16\_t: amount of streams */}}
\DoxyCodeLine{273         OSMO\_STREAM\_CLI\_PAR\_SCTP\_INIT\_MAX\_ATTEMPTS, \textcolor{comment}{/* uint16\_t: amount of attempts */}}
\DoxyCodeLine{274         OSMO\_STREAM\_CLI\_PAR\_SCTP\_INIT\_TIMEOUT, \textcolor{comment}{/* uint16\_t: milliseconds */}}
\DoxyCodeLine{275 }
\DoxyCodeLine{276         OSMO\_STREAM\_CLI\_PAR\_TCP\_SOCKOPT\_KEEPALIVE = 256, \textcolor{comment}{/* uint8\_t: 0 disable, 1 enable */}}
\DoxyCodeLine{277         OSMO\_STREAM\_CLI\_PAR\_TCP\_SOCKOPT\_KEEPIDLE, \textcolor{comment}{/* int: seconds */}}
\DoxyCodeLine{278         OSMO\_STREAM\_CLI\_PAR\_TCP\_SOCKOPT\_KEEPINTVL, \textcolor{comment}{/* int: seconds */}}
\DoxyCodeLine{279         OSMO\_STREAM\_CLI\_PAR\_TCP\_SOCKOPT\_KEEPCNT, \textcolor{comment}{/* int: Number of probes */}}
\DoxyCodeLine{280         OSMO\_STREAM\_CLI\_PAR\_TCP\_SOCKOPT\_USER\_TIMEOUT, \textcolor{comment}{/* unsigned int: 0 "{}system default"{}, >0 see sockopt TCP\_USER\_TIMEOUT */}}
\DoxyCodeLine{281 \};}
\DoxyCodeLine{282 }
\DoxyCodeLine{283 \textcolor{keywordtype}{int} osmo\_stream\_cli\_set\_param(\textcolor{keyword}{struct} osmo\_stream\_cli *cli, \textcolor{keyword}{enum} osmo\_stream\_cli\_param par,}
\DoxyCodeLine{284                               \textcolor{keywordtype}{void} *val, \textcolor{keywordtype}{size\_t} val\_len);}
\DoxyCodeLine{285 }

\end{DoxyCode}
