\section{include/osmocom/netif/osmux.h File Reference}
\label{osmux_8h}\index{include/osmocom/netif/osmux.\+h@{include/osmocom/netif/osmux.\+h}}
{\ttfamily \#include $<$osmocom/core/endian.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/timer.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmux\+\_\+hdr}
\item 
struct \textbf{ osmux\+\_\+in\+\_\+handle}
\item 
struct \textbf{ osmux\+\_\+out\+\_\+handle}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bfseries O\+S\+M\+U\+X\+\_\+\+D\+E\+F\+A\+U\+L\+T\+\_\+\+P\+O\+RT}~1984
\item 
\#define {\bfseries O\+S\+M\+U\+X\+\_\+\+F\+T\+\_\+\+S\+I\+G\+N\+AL}~0
\item 
\#define {\bfseries O\+S\+M\+U\+X\+\_\+\+F\+T\+\_\+\+V\+O\+I\+C\+E\+\_\+\+A\+MR}~1
\item 
\#define {\bfseries O\+S\+M\+U\+X\+\_\+\+F\+T\+\_\+\+D\+U\+M\+MY}~2
\item 
\mbox{\label{osmux_8h_aa2b0cfe6dad6635ea3313fd5009332cd}} 
\#define {\bfseries O\+S\+M\+U\+X\+\_\+\+C\+I\+D\+\_\+\+M\+AX}~255	/$\ast$ determined by circuit\+\_\+id $\ast$/
\item 
\#define {\bfseries O\+S\+M\+U\+X\+\_\+\+M\+A\+X\+\_\+\+C\+O\+N\+C\+U\+R\+R\+E\+N\+T\+\_\+\+C\+A\+L\+LS}~8
\item 
\#define {\bfseries O\+S\+M\+U\+X\+\_\+\+B\+A\+T\+C\+H\+\_\+\+D\+E\+F\+A\+U\+L\+T\+\_\+\+M\+AX}~1472
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct msgb $\ast$($\ast$ {\bfseries rtp\+\_\+msgb\+\_\+alloc\+\_\+cb\+\_\+t}) (void $\ast$rtp\+\_\+msgb\+\_\+alloc\+\_\+priv\+\_\+data, unsigned int msg\+\_\+len)
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmux\+\_\+hdr} {\bfseries \+\_\+\+\_\+attribute\+\_\+\+\_\+} ((packed))
\item 
static uint8\+\_\+t $\ast$ {\bfseries osmux\+\_\+get\+\_\+payload} (struct \textbf{ osmux\+\_\+hdr} $\ast$osmuxh)
\item 
int \textbf{ osmux\+\_\+snprintf} (char $\ast$buf, size\+\_\+t size, struct msgb $\ast$msg)
\item 
struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$ \textbf{ osmux\+\_\+xfrm\+\_\+input\+\_\+alloc} (void $\ast$ctx)
\begin{DoxyCompactList}\small\item\em Allocate a new osmux in handle (osmux source, tx side) \end{DoxyCompactList}\item 
void {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+init} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h) O\+S\+M\+O\+\_\+\+D\+E\+P\+R\+E\+C\+A\+T\+ED(\char`\"{}Use \textbf{ osmux\+\_\+xfrm\+\_\+input\+\_\+alloc}() instead\char`\"{})
\item 
void {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+fini} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h) O\+S\+M\+O\+\_\+\+D\+E\+P\+R\+E\+C\+A\+T\+ED(\char`\"{}Use talloc\+\_\+free() instead\char`\"{})
\item 
int {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+set\+\_\+batch\+\_\+factor} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h, uint8\+\_\+t batch\+\_\+factor)
\item 
void {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+set\+\_\+batch\+\_\+size} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h, uint16\+\_\+t batch\+\_\+size)
\item 
void {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+set\+\_\+initial\+\_\+seqnum} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h, uint8\+\_\+t osmux\+\_\+seqnum)
\item 
void {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+set\+\_\+deliver\+\_\+cb} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h, void($\ast$deliver\+\_\+cb)(struct msgb $\ast$msg, void $\ast$data), void $\ast$data)
\item 
void $\ast$ {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+get\+\_\+deliver\+\_\+cb\+\_\+data} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h)
\item 
int {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+open\+\_\+circuit} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h, int ccid, int dummy)
\item 
void {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+close\+\_\+circuit} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h, int ccid)
\item 
int \textbf{ osmux\+\_\+xfrm\+\_\+input} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h, struct msgb $\ast$msg, int ccid)
\item 
void {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+deliver} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h)
\item 
struct \textbf{ osmux\+\_\+out\+\_\+handle} $\ast$ \textbf{ osmux\+\_\+xfrm\+\_\+output\+\_\+alloc} (void $\ast$ctx)
\begin{DoxyCompactList}\small\item\em Allocate a new osmux out handle. \end{DoxyCompactList}\item 
void {\bfseries osmux\+\_\+xfrm\+\_\+output\+\_\+init} (struct \textbf{ osmux\+\_\+out\+\_\+handle} $\ast$h, uint32\+\_\+t rtp\+\_\+ssrc) O\+S\+M\+O\+\_\+\+D\+E\+P\+R\+E\+C\+A\+T\+ED(\char`\"{}Use \textbf{ osmux\+\_\+xfrm\+\_\+output\+\_\+alloc}() and osmux\+\_\+xfrm\+\_\+output\+\_\+set\+\_\+rtp\+\_\+$\ast$() instead\char`\"{})
\item 
void {\bfseries osmux\+\_\+xfrm\+\_\+output\+\_\+init2} (struct \textbf{ osmux\+\_\+out\+\_\+handle} $\ast$h, uint32\+\_\+t rtp\+\_\+ssrc, uint8\+\_\+t rtp\+\_\+payload\+\_\+type) O\+S\+M\+O\+\_\+\+D\+E\+P\+R\+E\+C\+A\+T\+ED(\char`\"{}Use \textbf{ osmux\+\_\+xfrm\+\_\+output\+\_\+alloc}() and osmux\+\_\+xfrm\+\_\+output\+\_\+set\+\_\+rtp\+\_\+$\ast$() instead\char`\"{})
\item 
void \textbf{ osmux\+\_\+xfrm\+\_\+output\+\_\+set\+\_\+rtp\+\_\+ssrc} (struct \textbf{ osmux\+\_\+out\+\_\+handle} $\ast$h, uint32\+\_\+t rtp\+\_\+ssrc)
\begin{DoxyCompactList}\small\item\em Set S\+S\+RC of generated R\+TP packets from Osmux frames. \end{DoxyCompactList}\item 
void \textbf{ osmux\+\_\+xfrm\+\_\+output\+\_\+set\+\_\+rtp\+\_\+pl\+\_\+type} (struct \textbf{ osmux\+\_\+out\+\_\+handle} $\ast$h, uint32\+\_\+t rtp\+\_\+payload\+\_\+type)
\begin{DoxyCompactList}\small\item\em Set Payload Type of generated R\+TP packets from Osmux frames. \end{DoxyCompactList}\item 
void \textbf{ osmux\+\_\+xfrm\+\_\+output\+\_\+set\+\_\+tx\+\_\+cb} (struct \textbf{ osmux\+\_\+out\+\_\+handle} $\ast$h, void($\ast$tx\+\_\+cb)(struct msgb $\ast$msg, void $\ast$data), void $\ast$data)
\begin{DoxyCompactList}\small\item\em Set transmission callback to call when a generated R\+TP packet is to be transmitted. \end{DoxyCompactList}\item 
void \textbf{ osmux\+\_\+xfrm\+\_\+output\+\_\+set\+\_\+rtp\+\_\+msgb\+\_\+alloc\+\_\+cb} (struct \textbf{ osmux\+\_\+out\+\_\+handle} $\ast$h, rtp\+\_\+msgb\+\_\+alloc\+\_\+cb\+\_\+t cb, void $\ast$cb\+\_\+data)
\begin{DoxyCompactList}\small\item\em Set callback to call when an R\+TP packet to be generated is to be allocated. \end{DoxyCompactList}\item 
int \textbf{ osmux\+\_\+xfrm\+\_\+output\+\_\+sched} (struct \textbf{ osmux\+\_\+out\+\_\+handle} $\ast$h, struct \textbf{ osmux\+\_\+hdr} $\ast$osmuxh)
\begin{DoxyCompactList}\small\item\em Generate R\+TP packets from osmux frame A\+MR payload set and schedule them for transmission at appropriate time. \end{DoxyCompactList}\item 
void \textbf{ osmux\+\_\+xfrm\+\_\+output\+\_\+flush} (struct \textbf{ osmux\+\_\+out\+\_\+handle} $\ast$h)
\begin{DoxyCompactList}\small\item\em Flush all scheduled R\+TP packets still pending to be transmitted. \end{DoxyCompactList}\item 
struct \textbf{ osmux\+\_\+hdr} $\ast$ {\bfseries osmux\+\_\+xfrm\+\_\+output\+\_\+pull} (struct msgb $\ast$msg)
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{osmux_8h_a3f47451edd2274525a52e40f4e26c399}} 
uint8\+\_\+t {\bfseries seq}
\item 
\mbox{\label{osmux_8h_a1bb0153eecb7f155fd9a8052df877a60}} 
uint8\+\_\+t {\bfseries circuit\+\_\+id}
\item 
struct \textbf{ osmux\+\_\+in\+\_\+handle} {\bfseries \+\_\+\+\_\+attribute\+\_\+\+\_\+}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Osmocom multiplex protocol helpers 