\doxysection{jibuf.\+h}
\label{jibuf_8h_source}\index{include/osmocom/netif/jibuf.h@{include/osmocom/netif/jibuf.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00002\ }
\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#include\ <stdint.h>}}
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <stdbool.h>}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <time.h>}}
\DoxyCodeLine{00006\ }
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ <osmocom/core/timer.h>}}
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00017\ \textcolor{keyword}{typedef}\ void\ (*osmo\_jibuf\_dequeue\_cb)(\textcolor{keyword}{struct\ }msgb\ *msg,\ \textcolor{keywordtype}{void}\ *data);}
\DoxyCodeLine{00018\ }
\DoxyCodeLine{00020\ \textcolor{keyword}{struct\ }osmo\_jibuf\ \{}
\DoxyCodeLine{00021\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *talloc\_ctx;}
\DoxyCodeLine{00022\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ started;}
\DoxyCodeLine{00023\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }osmo\_timer\_list\ timer;}
\DoxyCodeLine{00024\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }llist\_head\ msg\_list;\ \textcolor{comment}{/*\ sorted\ by\ output\ ts\ */}}
\DoxyCodeLine{00025\ \ \ \ \ \ \ \ \ uint32\_t\ min\_delay;\ \textcolor{comment}{/*\ in\ msec\ */}}
\DoxyCodeLine{00026\ \ \ \ \ \ \ \ \ uint32\_t\ max\_delay;\ \textcolor{comment}{/*\ in\ msec\ */}}
\DoxyCodeLine{00027\ \ \ \ \ \ \ \ \ uint32\_t\ threshold\_delay;\ \textcolor{comment}{/*\ in\ msec\ */}}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00029\ \ \ \ \ \ \ \ \ osmo\_jibuf\_dequeue\_cb\ dequeue\_cb;}
\DoxyCodeLine{00030\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *dequeue\_cb\_data;}
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00032\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ number\ of\ pkt\ drops\ since\ we\ last\ changed\ the\ buffer\ size\ */}}
\DoxyCodeLine{00033\ \ \ \ \ \ \ \ \ uint32\_t\ last\_dropped;}
\DoxyCodeLine{00034\ \ \ \ \ \ \ \ \ uint32\_t\ consecutive\_drops;}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00036\ \ \ \ \ \ \ \ \ uint32\_t\ ref\_rx\_ts;}
\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ uint32\_t\ ref\_tx\_ts;}
\DoxyCodeLine{00038\ \ \ \ \ \ \ \ \ uint16\_t\ ref\_tx\_seq;}
\DoxyCodeLine{00039\ }
\DoxyCodeLine{00040\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }timeval\ last\_enqueue\_time;}
\DoxyCodeLine{00041\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }timeval\ next\_dequeue\_time;}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00043\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ skew\_enabled;}
\DoxyCodeLine{00044\ \ \ \ \ \ \ \ \ int32\_t\ skew\_us;\ \textcolor{comment}{/*\ src\ clock\ skew,\ in\ usec\ */}}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }\{}
\DoxyCodeLine{00047\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\_t\ total\_enqueued;}
\DoxyCodeLine{00048\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint64\_t\ total\_dropped;}
\DoxyCodeLine{00049\ \ \ \ \ \ \ \ \ \}\ stats;}
\DoxyCodeLine{00050\ \};}
\DoxyCodeLine{00051\ }
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ \textcolor{keyword}{struct\ }osmo\_jibuf\ *osmo\_jibuf\_alloc(\textcolor{keywordtype}{void}\ *talloc\_ctx);}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00055\ \textcolor{keywordtype}{void}\ osmo\_jibuf\_delete(\textcolor{keyword}{struct}\ osmo\_jibuf\ *jb);}
\DoxyCodeLine{00056\ }
\DoxyCodeLine{00057\ \textcolor{keywordtype}{int}\ osmo\_jibuf\_enqueue(\textcolor{keyword}{struct}\ osmo\_jibuf\ *jb,\ \textcolor{keyword}{struct}\ msgb\ *msg);}
\DoxyCodeLine{00058\ }
\DoxyCodeLine{00059\ \textcolor{keywordtype}{bool}\ osmo\_jibuf\_empty(\textcolor{keyword}{struct}\ osmo\_jibuf\ *jb);}
\DoxyCodeLine{00060\ }
\DoxyCodeLine{00061\ \textcolor{keywordtype}{void}\ osmo\_jibuf\_set\_min\_delay(\textcolor{keyword}{struct}\ osmo\_jibuf\ *jb,\ uint32\_t\ min\_delay);}
\DoxyCodeLine{00062\ \textcolor{keywordtype}{void}\ osmo\_jibuf\_set\_max\_delay(\textcolor{keyword}{struct}\ osmo\_jibuf\ *jb,\ uint32\_t\ max\_delay);}
\DoxyCodeLine{00063\ }
\DoxyCodeLine{00064\ \textcolor{keywordtype}{void}\ osmo\_jibuf\_enable\_skew\_compensation(\textcolor{keyword}{struct}\ osmo\_jibuf\ *jb,\ \textcolor{keywordtype}{bool}\ enable);}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00066\ \textcolor{keywordtype}{void}\ osmo\_jibuf\_set\_dequeue\_cb(\textcolor{keyword}{struct}\ osmo\_jibuf\ *jb,\ osmo\_jibuf\_dequeue\_cb\ dequeue\_cb,\ \textcolor{keywordtype}{void}*\ cb\_data);}
\DoxyCodeLine{00067\ }

\end{DoxyCode}
