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


Osmocom multiplex protocol helpers (output)  


{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$string.\+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\+\_\+tx\+\_\+handle}
\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 
\mbox{\label{osmux__output_8c_gaf756352e90aa8ab0e96c0f43f23c36d3}} 
static uint32\+\_\+t {\bfseries osmux\+\_\+ft\+\_\+dummy\+\_\+size} (uint8\+\_\+t amr\+\_\+ft, uint8\+\_\+t batch\+\_\+factor)
\item 
struct \textbf{ osmux\+\_\+hdr} $\ast$ {\bfseries osmux\+\_\+xfrm\+\_\+output\+\_\+pull} (struct msgb $\ast$msg)
\item 
static struct msgb $\ast$ {\bfseries osmux\+\_\+rebuild\+\_\+rtp} (struct \textbf{ osmux\+\_\+out\+\_\+handle} $\ast$h, struct \textbf{ osmux\+\_\+hdr} $\ast$osmuxh, void $\ast$payload, int payload\+\_\+len, bool first\+\_\+pkt)
\item 
static void {\bfseries osmux\+\_\+xfrm\+\_\+output\+\_\+trigger} (void $\ast$data)
\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 
static int {\bfseries osmux\+\_\+xfrm\+\_\+output\+\_\+talloc\+\_\+destructor} (struct \textbf{ osmux\+\_\+out\+\_\+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\+\_\+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 {\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 \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 
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}\end{DoxyCompactItemize}


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

