\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{1 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{2 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#include <stdbool.h>}}
\DoxyCodeLine{4 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{5 }
\DoxyCodeLine{6 \textcolor{preprocessor}{\#include <osmocom/core/socket.h>}}
\DoxyCodeLine{7 }
\DoxyCodeLine{8 \textcolor{preprocessor}{\#include "{}config.h"{}}}
\DoxyCodeLine{9 }
\DoxyCodeLine{10 \textcolor{preprocessor}{\#ifdef HAVE\_LIBSCTP}}
\DoxyCodeLine{11 \textcolor{preprocessor}{\#include <netinet/sctp.h>}}
\DoxyCodeLine{12 \textcolor{preprocessor}{        \#define OSMO\_STREAM\_MAX\_ADDRS OSMO\_SOCK\_MAX\_ADDRS}}
\DoxyCodeLine{13         \textcolor{comment}{/*}}
\DoxyCodeLine{14 \textcolor{comment}{        * Platforms that don't have MSG\_NOSIGNAL (which disables SIGPIPE)}}
\DoxyCodeLine{15 \textcolor{comment}{        * usually have SO\_NOSIGPIPE (set via setsockopt).}}
\DoxyCodeLine{16 \textcolor{comment}{        */}}
\DoxyCodeLine{17 \textcolor{preprocessor}{        \#ifndef MSG\_NOSIGNAL}}
\DoxyCodeLine{18 \textcolor{preprocessor}{        \#define MSG\_NOSIGNAL 0}}
\DoxyCodeLine{19 \textcolor{preprocessor}{        \#endif}}
\DoxyCodeLine{20 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{21 \textcolor{preprocessor}{        \#define OSMO\_STREAM\_MAX\_ADDRS 1}}
\DoxyCodeLine{22 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{23 }
\DoxyCodeLine{26 \textcolor{keyword}{enum} osmo\_stream\_mode \{}
\DoxyCodeLine{27         OSMO\_STREAM\_MODE\_UNKNOWN,}
\DoxyCodeLine{28         OSMO\_STREAM\_MODE\_OSMO\_FD,}
\DoxyCodeLine{29         OSMO\_STREAM\_MODE\_OSMO\_IO,}
\DoxyCodeLine{30 \};}
\DoxyCodeLine{31 }
\DoxyCodeLine{32 \textcolor{keyword}{struct }stream\_tcp\_keepalive\_pars \{}
\DoxyCodeLine{33         \textcolor{keywordtype}{bool} enable;}
\DoxyCodeLine{34         \textcolor{keywordtype}{bool} time\_present;}
\DoxyCodeLine{35         \textcolor{keywordtype}{bool} intvl\_present;}
\DoxyCodeLine{36         \textcolor{keywordtype}{bool} probes\_present;}
\DoxyCodeLine{37         \textcolor{keywordtype}{int} time\_value; \textcolor{comment}{/* seconds */}}
\DoxyCodeLine{38         \textcolor{keywordtype}{int} intvl\_value; \textcolor{comment}{/* seconds */}}
\DoxyCodeLine{39         \textcolor{keywordtype}{int} probes\_value;}
\DoxyCodeLine{40 \};}
\DoxyCodeLine{41 \textcolor{keywordtype}{int} stream\_setsockopt\_tcp\_keepalive(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{int} on);}
\DoxyCodeLine{42 \textcolor{keywordtype}{int} stream\_setsockopt\_tcp\_keepidle(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{int} keepalive\_time);}
\DoxyCodeLine{43 \textcolor{keywordtype}{int} stream\_setsockopt\_tcp\_keepintvl(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{int} keepalive\_intvl);}
\DoxyCodeLine{44 \textcolor{keywordtype}{int} stream\_setsockopt\_tcp\_keepcnt(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{int} keepalive\_probes);}
\DoxyCodeLine{45 \textcolor{keywordtype}{int} stream\_tcp\_keepalive\_pars\_apply(\textcolor{keywordtype}{int} fd, \textcolor{keyword}{const} \textcolor{keyword}{struct} stream\_tcp\_keepalive\_pars *tkp);}
\DoxyCodeLine{46 }
\DoxyCodeLine{47 \textcolor{keyword}{struct }stream\_tcp\_pars \{}
\DoxyCodeLine{48         \textcolor{keyword}{struct }stream\_tcp\_keepalive\_pars ka;}
\DoxyCodeLine{49         \textcolor{keywordtype}{bool} user\_timeout\_present;}
\DoxyCodeLine{50         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} user\_timeout\_value;}
\DoxyCodeLine{51 \};}
\DoxyCodeLine{52 \textcolor{keywordtype}{int} stream\_setsockopt\_tcp\_user\_timeout(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} user\_timeout);}
\DoxyCodeLine{53 }
\DoxyCodeLine{54 \textcolor{keyword}{struct }osmo\_io\_fd;}
\DoxyCodeLine{55 \textcolor{keyword}{struct }msghdr;}
\DoxyCodeLine{56 }
\DoxyCodeLine{57 \textcolor{keywordtype}{int} stream\_sctp\_sock\_activate\_events(\textcolor{keywordtype}{int} fd);}
\DoxyCodeLine{58 \textcolor{keywordtype}{int} stream\_setsockopt\_nodelay(\textcolor{keywordtype}{int} fd, \textcolor{keywordtype}{int} proto, \textcolor{keywordtype}{int} on);}
\DoxyCodeLine{59 \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{60 }
\DoxyCodeLine{61 \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{62 \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{63 }

\end{DoxyCode}
