\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{1 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{2 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{4 \textcolor{preprocessor}{\#include <stdbool.h>}}
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <time.h>}}
\DoxyCodeLine{6 }
\DoxyCodeLine{7 \textcolor{preprocessor}{\#include <osmocom/core/timer.h>}}
\DoxyCodeLine{8 }
\DoxyCodeLine{17 \textcolor{keyword}{typedef} void (*osmo\_jibuf\_dequeue\_cb)(\textcolor{keyword}{struct }msgb *msg, \textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{18 }
\DoxyCodeLine{20 \textcolor{keyword}{struct }osmo\_jibuf \{}
\DoxyCodeLine{21         \textcolor{keywordtype}{void} *talloc\_ctx;}
\DoxyCodeLine{22         \textcolor{keywordtype}{bool} started;}
\DoxyCodeLine{23         \textcolor{keyword}{struct }osmo\_timer\_list timer;}
\DoxyCodeLine{24         \textcolor{keyword}{struct }llist\_head msg\_list; \textcolor{comment}{/* sorted by output ts */}}
\DoxyCodeLine{25         uint32\_t min\_delay; \textcolor{comment}{/* in msec */}}
\DoxyCodeLine{26         uint32\_t max\_delay; \textcolor{comment}{/* in msec */}}
\DoxyCodeLine{27         uint32\_t threshold\_delay; \textcolor{comment}{/* in msec */}}
\DoxyCodeLine{28 }
\DoxyCodeLine{29         osmo\_jibuf\_dequeue\_cb dequeue\_cb;}
\DoxyCodeLine{30         \textcolor{keywordtype}{void} *dequeue\_cb\_data;}
\DoxyCodeLine{31 }
\DoxyCodeLine{32         \textcolor{comment}{/* number of pkt drops since we last changed the buffer size */}}
\DoxyCodeLine{33         uint32\_t last\_dropped;}
\DoxyCodeLine{34         uint32\_t consecutive\_drops;}
\DoxyCodeLine{35 }
\DoxyCodeLine{36         uint32\_t ref\_rx\_ts;}
\DoxyCodeLine{37         uint32\_t ref\_tx\_ts;}
\DoxyCodeLine{38         uint16\_t ref\_tx\_seq;}
\DoxyCodeLine{39 }
\DoxyCodeLine{40         \textcolor{keyword}{struct }timeval last\_enqueue\_time;}
\DoxyCodeLine{41         \textcolor{keyword}{struct }timeval next\_dequeue\_time;}
\DoxyCodeLine{42 }
\DoxyCodeLine{43         \textcolor{keywordtype}{bool} skew\_enabled;}
\DoxyCodeLine{44         int32\_t skew\_us; \textcolor{comment}{/* src clock skew, in usec */}}
\DoxyCodeLine{45 }
\DoxyCodeLine{46         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{47                 uint32\_t total\_enqueued;}
\DoxyCodeLine{48                 uint64\_t total\_dropped;}
\DoxyCodeLine{49         \} stats;}
\DoxyCodeLine{50 \};}
\DoxyCodeLine{51 }
\DoxyCodeLine{52 }
\DoxyCodeLine{53 \textcolor{keyword}{struct }osmo\_jibuf *osmo\_jibuf\_alloc(\textcolor{keywordtype}{void} *talloc\_ctx);}
\DoxyCodeLine{54 }
\DoxyCodeLine{55 \textcolor{keywordtype}{void} osmo\_jibuf\_delete(\textcolor{keyword}{struct} osmo\_jibuf *jb);}
\DoxyCodeLine{56 }
\DoxyCodeLine{57 \textcolor{keywordtype}{int} osmo\_jibuf\_enqueue(\textcolor{keyword}{struct} osmo\_jibuf *jb, \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{58 }
\DoxyCodeLine{59 \textcolor{keywordtype}{bool} osmo\_jibuf\_empty(\textcolor{keyword}{struct} osmo\_jibuf *jb);}
\DoxyCodeLine{60 }
\DoxyCodeLine{61 \textcolor{keywordtype}{void} osmo\_jibuf\_set\_min\_delay(\textcolor{keyword}{struct} osmo\_jibuf *jb, uint32\_t min\_delay);}
\DoxyCodeLine{62 \textcolor{keywordtype}{void} osmo\_jibuf\_set\_max\_delay(\textcolor{keyword}{struct} osmo\_jibuf *jb, uint32\_t max\_delay);}
\DoxyCodeLine{63 }
\DoxyCodeLine{64 \textcolor{keywordtype}{void} osmo\_jibuf\_enable\_skew\_compensation(\textcolor{keyword}{struct} osmo\_jibuf *jb, \textcolor{keywordtype}{bool} enable);}
\DoxyCodeLine{65 }
\DoxyCodeLine{66 \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{67 }

\end{DoxyCode}
