\section{src/osmux\+\_\+input.c File Reference}
\label{osmux__input_8c}\index{src/osmux\+\_\+input.\+c@{src/osmux\+\_\+input.\+c}}


Osmocom multiplex protocol helpers (input)  


{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$inttypes.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/timer.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/timer\+\_\+compat.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/select.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/talloc.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/netif/amr.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/netif/rtp.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/netif/osmux.\+h$>$}\newline
{\ttfamily \#include $<$arpa/inet.\+h$>$}\newline
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmux\+\_\+batch}
\item 
struct \textbf{ osmux\+\_\+circuit}
\item 
struct \textbf{ osmux\+\_\+input\+\_\+state}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bfseries D\+E\+L\+T\+A\+\_\+\+R\+T\+P\+\_\+\+M\+SG}~20000
\item 
\#define {\bfseries D\+E\+L\+T\+A\+\_\+\+R\+T\+P\+\_\+\+T\+I\+M\+E\+S\+T\+A\+MP}~160
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static uint32\+\_\+t {\bfseries osmux\+\_\+ft\+\_\+dummy\+\_\+size} (uint8\+\_\+t amr\+\_\+ft, uint8\+\_\+t batch\+\_\+factor)
\item 
static int {\bfseries osmux\+\_\+circuit\+\_\+enqueue} (struct \textbf{ osmux\+\_\+circuit} $\ast$circuit, struct msgb $\ast$msg, uint8\+\_\+t batch\+\_\+factor)
\item 
static void {\bfseries osmux\+\_\+circuit\+\_\+dequeue} (struct \textbf{ osmux\+\_\+circuit} $\ast$circuit, struct msgb $\ast$msg)
\item 
static void {\bfseries osmux\+\_\+circuit\+\_\+del\+\_\+msgs} (struct \textbf{ osmux\+\_\+batch} $\ast$batch, struct \textbf{ osmux\+\_\+circuit} $\ast$circuit)
\item 
static int {\bfseries osmux\+\_\+batch\+\_\+put} (struct \textbf{ osmux\+\_\+batch} $\ast$batch, struct \textbf{ osmux\+\_\+input\+\_\+state} $\ast$state)
\item 
static void {\bfseries osmux\+\_\+encode\+\_\+dummy} (struct \textbf{ osmux\+\_\+batch} $\ast$batch, uint8\+\_\+t batch\+\_\+factor, struct \textbf{ osmux\+\_\+input\+\_\+state} $\ast$state)
\item 
static struct msgb $\ast$ {\bfseries osmux\+\_\+build\+\_\+batch} (struct \textbf{ osmux\+\_\+batch} $\ast$batch, uint32\+\_\+t batch\+\_\+size, uint8\+\_\+t batch\+\_\+factor)
\item 
void {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+deliver} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h)
\item 
static void {\bfseries osmux\+\_\+batch\+\_\+timer\+\_\+expired} (void $\ast$data)
\item 
static int {\bfseries osmux\+\_\+rtp\+\_\+amr\+\_\+payload\+\_\+len} (struct \textbf{ amr\+\_\+hdr} $\ast$amrh, uint32\+\_\+t amr\+\_\+len)
\item 
static int {\bfseries osmux\+\_\+circuit\+\_\+get\+\_\+last\+\_\+stored\+\_\+amr\+\_\+ft} (struct \textbf{ osmux\+\_\+circuit} $\ast$circuit)
\item 
static int {\bfseries osmux\+\_\+replay\+\_\+lost\+\_\+packets} (struct \textbf{ osmux\+\_\+circuit} $\ast$circuit, struct \textbf{ rtp\+\_\+hdr} $\ast$cur\+\_\+rtph, int batch\+\_\+factor)
\item 
static struct \textbf{ osmux\+\_\+circuit} $\ast$ {\bfseries osmux\+\_\+batch\+\_\+find\+\_\+circuit} (struct \textbf{ osmux\+\_\+batch} $\ast$batch, int ccid)
\item 
static void {\bfseries osmux\+\_\+batch\+\_\+del\+\_\+circuit} (struct \textbf{ osmux\+\_\+batch} $\ast$batch, struct \textbf{ osmux\+\_\+circuit} $\ast$circuit)
\item 
static int {\bfseries osmux\+\_\+batch\+\_\+add} (struct \textbf{ osmux\+\_\+batch} $\ast$batch, uint32\+\_\+t batch\+\_\+factor, struct msgb $\ast$msg, struct \textbf{ rtp\+\_\+hdr} $\ast$rtph, int ccid)
\item 
int \textbf{ osmux\+\_\+xfrm\+\_\+input} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h, struct msgb $\ast$msg, int ccid)
\item 
static int {\bfseries osmux\+\_\+xfrm\+\_\+input\+\_\+talloc\+\_\+destructor} (struct \textbf{ osmux\+\_\+in\+\_\+handle} $\ast$h)
\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 
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 
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`\"{})
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static void $\ast$ {\bfseries osmux\+\_\+ctx}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Osmocom multiplex protocol helpers (input) 

