\doxysection{stream\+\_\+private.\+h}
\label{stream__private_8h_source}\index{include/osmocom/netif/stream\_private.h@{include/osmocom/netif/stream\_private.h}}

\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\ }
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ <osmocom/core/socket.h>}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ "{}config.h"{}}}
\DoxyCodeLine{00009\ }
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#ifdef\ HAVE\_LIBSCTP}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <netinet/sctp.h>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#define\ OSMO\_STREAM\_MAX\_ADDRS\ OSMO\_SOCK\_MAX\_ADDRS}}
\DoxyCodeLine{00013\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ \ \ \ \ \ \ \ *\ Platforms\ that\ don't\ have\ MSG\_NOSIGNAL\ (which\ disables\ SIGPIPE)}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ \ \ \ \ \ \ \ *\ usually\ have\ SO\_NOSIGPIPE\ (set\ via\ setsockopt).}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ \ \ \ \ \ \ \ */}}
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#ifndef\ MSG\_NOSIGNAL}}
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#define\ MSG\_NOSIGNAL\ 0}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#endif}}
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \#define\ OSMO\_STREAM\_MAX\_ADDRS\ 1}}
\DoxyCodeLine{00022\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00026\ \textcolor{keyword}{enum}\ osmo\_stream\_mode\ \{}
\DoxyCodeLine{00027\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_MODE\_UNKNOWN,}
\DoxyCodeLine{00028\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_MODE\_OSMO\_FD,}
\DoxyCodeLine{00029\ \ \ \ \ \ \ \ \ OSMO\_STREAM\_MODE\_OSMO\_IO,}
\DoxyCodeLine{00030\ \};}
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00032\ \textcolor{keyword}{struct\ }stream\_tcp\_keepalive\_pars\ \{}
\DoxyCodeLine{00033\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ enable;}
\DoxyCodeLine{00034\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ time\_present;}
\DoxyCodeLine{00035\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ intvl\_present;}
\DoxyCodeLine{00036\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ probes\_present;}
\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ time\_value;\ \textcolor{comment}{/*\ seconds\ */}}
\DoxyCodeLine{00038\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ intvl\_value;\ \textcolor{comment}{/*\ seconds\ */}}
\DoxyCodeLine{00039\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ probes\_value;}
\DoxyCodeLine{00040\ \};}
\DoxyCodeLine{00041\ \textcolor{keywordtype}{int}\ stream\_setsockopt\_tcp\_keepalive(\textcolor{keywordtype}{int}\ fd,\ \textcolor{keywordtype}{int}\ on);}
\DoxyCodeLine{00042\ \textcolor{keywordtype}{int}\ stream\_setsockopt\_tcp\_keepidle(\textcolor{keywordtype}{int}\ fd,\ \textcolor{keywordtype}{int}\ keepalive\_time);}
\DoxyCodeLine{00043\ \textcolor{keywordtype}{int}\ stream\_setsockopt\_tcp\_keepintvl(\textcolor{keywordtype}{int}\ fd,\ \textcolor{keywordtype}{int}\ keepalive\_intvl);}
\DoxyCodeLine{00044\ \textcolor{keywordtype}{int}\ stream\_setsockopt\_tcp\_keepcnt(\textcolor{keywordtype}{int}\ fd,\ \textcolor{keywordtype}{int}\ keepalive\_probes);}
\DoxyCodeLine{00045\ \textcolor{keywordtype}{int}\ stream\_tcp\_keepalive\_pars\_apply(\textcolor{keywordtype}{int}\ fd,\ \textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ stream\_tcp\_keepalive\_pars\ *tkp);}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00047\ \textcolor{keyword}{struct\ }stream\_tcp\_pars\ \{}
\DoxyCodeLine{00048\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }stream\_tcp\_keepalive\_pars\ ka;}
\DoxyCodeLine{00049\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ user\_timeout\_present;}
\DoxyCodeLine{00050\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ user\_timeout\_value;}
\DoxyCodeLine{00051\ \};}
\DoxyCodeLine{00052\ \textcolor{keywordtype}{int}\ stream\_setsockopt\_tcp\_user\_timeout(\textcolor{keywordtype}{int}\ fd,\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ user\_timeout);}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00054\ \textcolor{keyword}{struct\ }osmo\_io\_fd;}
\DoxyCodeLine{00055\ \textcolor{keyword}{struct\ }msghdr;}
\DoxyCodeLine{00056\ }
\DoxyCodeLine{00057\ \textcolor{keywordtype}{int}\ stream\_sctp\_sock\_activate\_events(\textcolor{keywordtype}{int}\ fd);}
\DoxyCodeLine{00058\ \textcolor{keywordtype}{int}\ stream\_setsockopt\_nodelay(\textcolor{keywordtype}{int}\ fd,\ \textcolor{keywordtype}{int}\ proto,\ \textcolor{keywordtype}{int}\ on);}
\DoxyCodeLine{00059\ \textcolor{keywordtype}{int}\ stream\_sctp\_recvmsg\_wrapper(\textcolor{keywordtype}{int}\ fd,\ \textcolor{keyword}{struct}\ msgb\ *msg,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *log\_pfx);}
\DoxyCodeLine{00060\ }
\DoxyCodeLine{00061\ \textcolor{keywordtype}{int}\ stream\_iofd\_sctp\_send\_msgb(\textcolor{keyword}{struct}\ osmo\_io\_fd\ *iofd,\ \textcolor{keyword}{struct}\ msgb\ *msg,\ \textcolor{keywordtype}{int}\ sendmsg\_flags);}
\DoxyCodeLine{00062\ \textcolor{keywordtype}{int}\ stream\_iofd\_sctp\_recvmsg\_trailer(\textcolor{keyword}{struct}\ osmo\_io\_fd\ *iofd,\ \textcolor{keyword}{struct}\ msgb\ *msg,\ \textcolor{keywordtype}{int}\ ret,\ \textcolor{keyword}{const}\ \textcolor{keyword}{struct}\ msghdr\ *msgh);}
\DoxyCodeLine{00063\ }

\end{DoxyCode}
