\doxysection{Osmocom timers}
\label{group__timer}\index{Osmocom timers@{Osmocom timers}}


Timer management\+:  


\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ timer.\+h}
\begin{DoxyCompactList}\small\item\em Osmocom timer handling routines. \end{DoxyCompactList}\item 
file \textbf{ timer\+\_\+compat.\+h}
\begin{DoxyCompactList}\small\item\em Compatibility header with some helpers. \end{DoxyCompactList}\item 
file \textbf{ timer.\+c}
\item 
file \textbf{ timer\+\_\+clockgettime.\+c}
\begin{DoxyCompactList}\small\item\em Overriding Time\+: \doxyref{osmo\+\_\+clock\+\_\+gettime()}{p.}{group__timer_gac11a65dfcd1245fa716356d3650d2a6e} \end{DoxyCompactList}\item 
file \textbf{ timer\+\_\+clockgettime.\+c}
\begin{DoxyCompactList}\small\item\em Overriding Time\+: \doxyref{osmo\+\_\+clock\+\_\+gettime()}{p.}{group__timer_gac11a65dfcd1245fa716356d3650d2a6e} \end{DoxyCompactList}\item 
file \textbf{ timer\+\_\+gettimeofday.\+c}
\begin{DoxyCompactList}\small\item\em Overriding Time\+: \doxyref{osmo\+\_\+gettimeofday()}{p.}{group__timer_ga8c559c124f4720d0a54af5f206681049} \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+timer\+\_\+list}
\begin{DoxyCompactList}\small\item\em A structure representing a single instance of a timer. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ OSMO\+\_\+\+SEC2\+MIN}(\textbf{ sec})~((\textbf{ sec} \% (60 $\ast$ 60)) / 60)
\item 
\#define \textbf{ OSMO\+\_\+\+SEC2\+HRS}(\textbf{ sec})~((\textbf{ sec} \% (60 $\ast$ 60 $\ast$ 24)) / (60 $\ast$ 60))
\item 
\#define \textbf{ OSMO\+\_\+\+SEC2\+DAY}(\textbf{ sec})~((\textbf{ sec} \% (60 $\ast$ 60 $\ast$ 24 $\ast$ 365)) / (60 $\ast$ 60 $\ast$ 24)) /$\ast$ we ignore leap year \textbf{ for} simplicity $\ast$/
\item 
\#define \textbf{ timerisset}(tvp)~((tvp)-\/$>$tv\+\_\+sec $\vert$$\vert$ (tvp)-\/$>$tv\+\_\+usec)
\item 
\#define \textbf{ timerclear}(tvp)~((tvp)-\/$>$tv\+\_\+sec = (tvp)-\/$>$tv\+\_\+usec = 0)
\item 
\#define \textbf{ timercmp}(a,  b,  CMP)
\item 
\#define \textbf{ timeradd}(a,  b,  result)
\item 
\#define \textbf{ timersub}(a,  b,  result)
\item 
\#define \textbf{ timespecisset}(tvp)~((tvp)-\/$>$tv\+\_\+sec $\vert$$\vert$ (tvp)-\/$>$tv\+\_\+nsec)
\item 
\#define \textbf{ timespecclear}(tvp)~((tvp)-\/$>$tv\+\_\+sec = (tvp)-\/$>$tv\+\_\+nsec = 0)
\item 
\#define \textbf{ timespeccmp}(a,  b,  CMP)
\item 
\#define \textbf{ timespecadd}(a,  b,  result)
\item 
\#define \textbf{ timespecsub}(a,  b,  result)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ osmo\+\_\+timer\+\_\+setup} (struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer, void($\ast$cb)(void $\ast$\textbf{ data}), void $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em set up timer callback and data \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+timer\+\_\+add} (struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer)
\begin{DoxyCompactList}\small\item\em add a new timer to the timer management \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+timer\+\_\+schedule} (struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer, int seconds, int microseconds)
\begin{DoxyCompactList}\small\item\em schedule a timer at a given future relative time \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+timer\+\_\+del} (struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer)
\begin{DoxyCompactList}\small\item\em delete a timer from timer management \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+timer\+\_\+pending} (const struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer)
\begin{DoxyCompactList}\small\item\em check if given timer is still pending \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+timer\+\_\+remaining} (const struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer, const struct timeval $\ast$now, struct timeval $\ast$remaining)
\begin{DoxyCompactList}\small\item\em compute the remaining time of a timer \end{DoxyCompactList}\item 
struct timeval $\ast$ \textbf{ osmo\+\_\+timers\+\_\+nearest} (void)
\begin{DoxyCompactList}\small\item\em Determine time between now and the nearest timer. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+timers\+\_\+nearest\+\_\+ms} (void)
\begin{DoxyCompactList}\small\item\em Determine time between now and the nearest timer in milliseconds. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+timers\+\_\+prepare} (void)
\begin{DoxyCompactList}\small\item\em Find the nearest time and update nearest\+\_\+p. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+timers\+\_\+update} (void)
\begin{DoxyCompactList}\small\item\em fire all timers... and remove them \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+timers\+\_\+check} (void)
\begin{DoxyCompactList}\small\item\em Check how many timers we have in the system. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+gettimeofday} (struct timeval $\ast$tv, struct timezone $\ast$tz)
\begin{DoxyCompactList}\small\item\em shim around gettimeofday to be able to set the time manually. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+clock\+\_\+gettime} (clockid\+\_\+t clk\+\_\+id, struct timespec $\ast$tp)
\item 
void \textbf{ osmo\+\_\+gettimeofday\+\_\+override\+\_\+add} (time\+\_\+t secs, suseconds\+\_\+t usecs)
\begin{DoxyCompactList}\small\item\em convenience function to advance the fake time. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+clock\+\_\+override\+\_\+enable} (clockid\+\_\+t clk\+\_\+id, bool enable)
\item 
void \textbf{ osmo\+\_\+clock\+\_\+override\+\_\+add} (clockid\+\_\+t clk\+\_\+id, time\+\_\+t secs, long nsecs)
\item 
struct timespec $\ast$ \textbf{ osmo\+\_\+clock\+\_\+override\+\_\+gettimespec} (clockid\+\_\+t clk\+\_\+id)
\item 
static void \textbf{ \+\_\+\+\_\+add\+\_\+timer} (struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$timer)
\item 
static void \textbf{ update\+\_\+nearest} (struct timeval $\ast$cand, struct timeval $\ast$current)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
bool \textbf{ osmo\+\_\+gettimeofday\+\_\+override}
\item 
struct timeval \textbf{ osmo\+\_\+gettimeofday\+\_\+override\+\_\+time}
\item 
static \+\_\+\+\_\+thread struct timeval \textbf{ nearest}
\item 
static \+\_\+\+\_\+thread struct timeval $\ast$ \textbf{ nearest\+\_\+p}
\item 
static \+\_\+\+\_\+thread struct \textbf{ rb\+\_\+root} \textbf{ timer\+\_\+root} = \textbf{ RB\+\_\+\+ROOT}
\item 
bool \textbf{ osmo\+\_\+gettimeofday\+\_\+override} = false
\item 
struct timeval \textbf{ osmo\+\_\+gettimeofday\+\_\+override\+\_\+time} = \{ 23, 424242 \}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Timer management\+: 

Osmocom timer abstraction; modelled after linux kernel timers.


\begin{DoxyItemize}
\item Create a struct \doxyref{osmo\+\_\+timer\+\_\+list}{p.}{structosmo__timer__list}
\item Fill out timeout and use \doxyref{osmo\+\_\+timer\+\_\+add()}{p.}{group__timer_ga8eb1bef581081eb105265e56b15945fa}, or use \doxyref{osmo\+\_\+timer\+\_\+schedule()}{p.}{group__timer_ga93a296b92775fc08c60eb154a3389e5b} to schedule a timer in x seconds and microseconds from now...
\item Use \doxyref{osmo\+\_\+timer\+\_\+del()}{p.}{group__timer_ga1aa977a3eb2d5b5447b8acd32002b6cf} to remove the timer
\end{DoxyItemize}

Internally\+:
\begin{DoxyItemize}
\item We hook into select.\+c to give a timeval of the nearest timer. On already passed timers we give it a 0 to immediately fire after the select
\item \doxyref{osmo\+\_\+timers\+\_\+update()}{p.}{group__timer_gaf8d555ef1c2e59ed54f0e12e2ee1f41c} will call the callbacks and remove the timers. 
\end{DoxyItemize}

\doxysubsection{Macro Definition Documentation}
\mbox{\label{group__timer_gaef03caac6db664db7f175d1343408bec}} 
\index{Osmocom timers@{Osmocom timers}!OSMO\_SEC2DAY@{OSMO\_SEC2DAY}}
\index{OSMO\_SEC2DAY@{OSMO\_SEC2DAY}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{OSMO\_SEC2DAY}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SEC2\+DAY(\begin{DoxyParamCaption}\item[{}]{\textbf{ sec} }\end{DoxyParamCaption})~((\textbf{ sec} \% (60 $\ast$ 60 $\ast$ 24 $\ast$ 365)) / (60 $\ast$ 60 $\ast$ 24)) /$\ast$ we ignore leap year \textbf{ for} simplicity $\ast$/}

\mbox{\label{group__timer_ga5bd927eac440e0f201f75db8807fac16}} 
\index{Osmocom timers@{Osmocom timers}!OSMO\_SEC2HRS@{OSMO\_SEC2HRS}}
\index{OSMO\_SEC2HRS@{OSMO\_SEC2HRS}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{OSMO\_SEC2HRS}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SEC2\+HRS(\begin{DoxyParamCaption}\item[{}]{\textbf{ sec} }\end{DoxyParamCaption})~((\textbf{ sec} \% (60 $\ast$ 60 $\ast$ 24)) / (60 $\ast$ 60))}

\mbox{\label{group__timer_gaeb0aef725070ccb9dde39f04560edd87}} 
\index{Osmocom timers@{Osmocom timers}!OSMO\_SEC2MIN@{OSMO\_SEC2MIN}}
\index{OSMO\_SEC2MIN@{OSMO\_SEC2MIN}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{OSMO\_SEC2MIN}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SEC2\+MIN(\begin{DoxyParamCaption}\item[{}]{\textbf{ sec} }\end{DoxyParamCaption})~((\textbf{ sec} \% (60 $\ast$ 60)) / 60)}

\mbox{\label{group__timer_ga7c04f2eb10391cb3ca3b47882d23d2de}} 
\index{Osmocom timers@{Osmocom timers}!timeradd@{timeradd}}
\index{timeradd@{timeradd}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timeradd}
{\footnotesize\ttfamily \#define timeradd(\begin{DoxyParamCaption}\item[{}]{a,  }\item[{}]{b,  }\item[{}]{result }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{  \textcolor{keywordflow}{do} \{                                                                        \(\backslash\)}
\DoxyCodeLine{    (result)-\/>tv\_sec = (a)-\/>tv\_sec + (b)-\/>tv\_sec;                             \(\backslash\)}
\DoxyCodeLine{    (result)-\/>tv\_usec = (a)-\/>tv\_usec + (b)-\/>tv\_usec;                          \(\backslash\)}
\DoxyCodeLine{    if ((result)-\/>tv\_usec >= 1000000)                                         \(\backslash\)}
\DoxyCodeLine{      \{                                                                       \(\backslash\)}
\DoxyCodeLine{        ++(result)-\/>tv\_sec;                                                   \(\backslash\)}
\DoxyCodeLine{        (result)-\/>tv\_usec -\/= 1000000;                                         \(\backslash\)}
\DoxyCodeLine{      \}                                                                       \(\backslash\)}
\DoxyCodeLine{  \} \textcolor{keywordflow}{while} (0)}

\end{DoxyCode}
\mbox{\label{group__timer_gab95d90a9147b65d4ec1fab6bd2db6d1f}} 
\index{Osmocom timers@{Osmocom timers}!timerclear@{timerclear}}
\index{timerclear@{timerclear}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timerclear}
{\footnotesize\ttfamily \#define timerclear(\begin{DoxyParamCaption}\item[{}]{tvp }\end{DoxyParamCaption})~((tvp)-\/$>$tv\+\_\+sec = (tvp)-\/$>$tv\+\_\+usec = 0)}

\mbox{\label{group__timer_ga9740b405322c5d2a83d93426df96f79a}} 
\index{Osmocom timers@{Osmocom timers}!timercmp@{timercmp}}
\index{timercmp@{timercmp}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timercmp}
{\footnotesize\ttfamily \#define timercmp(\begin{DoxyParamCaption}\item[{}]{a,  }\item[{}]{b,  }\item[{}]{CMP }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{  (((a)-\/>tv\_sec == (b)-\/>tv\_sec) ?                                             \(\backslash\)}
\DoxyCodeLine{   ((a)-\/>tv\_usec CMP (b)-\/>tv\_usec) :                                          \(\backslash\)}
\DoxyCodeLine{   ((a)-\/>tv\_sec CMP (b)-\/>tv\_sec))}

\end{DoxyCode}
\mbox{\label{group__timer_ga7a6810e8127f008279242fba997a26a3}} 
\index{Osmocom timers@{Osmocom timers}!timerisset@{timerisset}}
\index{timerisset@{timerisset}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timerisset}
{\footnotesize\ttfamily \#define timerisset(\begin{DoxyParamCaption}\item[{}]{tvp }\end{DoxyParamCaption})~((tvp)-\/$>$tv\+\_\+sec $\vert$$\vert$ (tvp)-\/$>$tv\+\_\+usec)}

\mbox{\label{group__timer_ga8b18f762e42417ce5d86090331d3e4eb}} 
\index{Osmocom timers@{Osmocom timers}!timersub@{timersub}}
\index{timersub@{timersub}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timersub}
{\footnotesize\ttfamily \#define timersub(\begin{DoxyParamCaption}\item[{}]{a,  }\item[{}]{b,  }\item[{}]{result }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{  \textcolor{keywordflow}{do} \{                                                                        \(\backslash\)}
\DoxyCodeLine{    (result)-\/>tv\_sec = (a)-\/>tv\_sec -\/ (b)-\/>tv\_sec;                             \(\backslash\)}
\DoxyCodeLine{    (result)-\/>tv\_usec = (a)-\/>tv\_usec -\/ (b)-\/>tv\_usec;                          \(\backslash\)}
\DoxyCodeLine{    if ((result)-\/>tv\_usec < 0) \{                                              \(\backslash\)}
\DoxyCodeLine{      -\/-\/(result)-\/>tv\_sec;                                                     \(\backslash\)}
\DoxyCodeLine{      (result)-\/>tv\_usec += 1000000;                                           \(\backslash\)}
\DoxyCodeLine{    \}                                                                         \(\backslash\)}
\DoxyCodeLine{  \} \textcolor{keywordflow}{while} (0)}

\end{DoxyCode}
\mbox{\label{group__timer_ga9b866aa4069676f631f63d80a61d1116}} 
\index{Osmocom timers@{Osmocom timers}!timespecadd@{timespecadd}}
\index{timespecadd@{timespecadd}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timespecadd}
{\footnotesize\ttfamily \#define timespecadd(\begin{DoxyParamCaption}\item[{}]{a,  }\item[{}]{b,  }\item[{}]{result }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{  \textcolor{keywordflow}{do} \{                                                                        \(\backslash\)}
\DoxyCodeLine{    (result)-\/>tv\_sec = (a)-\/>tv\_sec + (b)-\/>tv\_sec;                             \(\backslash\)}
\DoxyCodeLine{    (result)-\/>tv\_nsec = (a)-\/>tv\_nsec + (b)-\/>tv\_nsec;                          \(\backslash\)}
\DoxyCodeLine{    if ((result)-\/>tv\_nsec >= 1000000000)                                      \(\backslash\)}
\DoxyCodeLine{      \{                                                                       \(\backslash\)}
\DoxyCodeLine{        ++(result)-\/>tv\_sec;                                                   \(\backslash\)}
\DoxyCodeLine{        (result)-\/>tv\_nsec -\/= 1000000000;                                      \(\backslash\)}
\DoxyCodeLine{      \}                                                                       \(\backslash\)}
\DoxyCodeLine{  \} \textcolor{keywordflow}{while} (0)}

\end{DoxyCode}
\mbox{\label{group__timer_ga22bb57ee2311580af998bad329a7a914}} 
\index{Osmocom timers@{Osmocom timers}!timespecclear@{timespecclear}}
\index{timespecclear@{timespecclear}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timespecclear}
{\footnotesize\ttfamily \#define timespecclear(\begin{DoxyParamCaption}\item[{}]{tvp }\end{DoxyParamCaption})~((tvp)-\/$>$tv\+\_\+sec = (tvp)-\/$>$tv\+\_\+nsec = 0)}

\mbox{\label{group__timer_gac4d93ba1cba658e2cf0d52b93593055e}} 
\index{Osmocom timers@{Osmocom timers}!timespeccmp@{timespeccmp}}
\index{timespeccmp@{timespeccmp}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timespeccmp}
{\footnotesize\ttfamily \#define timespeccmp(\begin{DoxyParamCaption}\item[{}]{a,  }\item[{}]{b,  }\item[{}]{CMP }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{  (((a)-\/>tv\_sec == (b)-\/>tv\_sec) ?                                             \(\backslash\)}
\DoxyCodeLine{   ((a)-\/>tv\_nsec CMP (b)-\/>tv\_nsec) :                                          \(\backslash\)}
\DoxyCodeLine{   ((a)-\/>tv\_sec CMP (b)-\/>tv\_sec))}

\end{DoxyCode}
\mbox{\label{group__timer_ga51ac4b0f81c859d848603902aa4589cb}} 
\index{Osmocom timers@{Osmocom timers}!timespecisset@{timespecisset}}
\index{timespecisset@{timespecisset}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timespecisset}
{\footnotesize\ttfamily \#define timespecisset(\begin{DoxyParamCaption}\item[{}]{tvp }\end{DoxyParamCaption})~((tvp)-\/$>$tv\+\_\+sec $\vert$$\vert$ (tvp)-\/$>$tv\+\_\+nsec)}

\mbox{\label{group__timer_gaaf525183a6e0d9903a2511619c57d2ce}} 
\index{Osmocom timers@{Osmocom timers}!timespecsub@{timespecsub}}
\index{timespecsub@{timespecsub}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timespecsub}
{\footnotesize\ttfamily \#define timespecsub(\begin{DoxyParamCaption}\item[{}]{a,  }\item[{}]{b,  }\item[{}]{result }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{  \textcolor{keywordflow}{do} \{                                                                        \(\backslash\)}
\DoxyCodeLine{    (result)-\/>tv\_sec = (a)-\/>tv\_sec -\/ (b)-\/>tv\_sec;                             \(\backslash\)}
\DoxyCodeLine{    (result)-\/>tv\_nsec = (a)-\/>tv\_nsec -\/ (b)-\/>tv\_nsec;                          \(\backslash\)}
\DoxyCodeLine{    if ((result)-\/>tv\_nsec < 0) \{                                              \(\backslash\)}
\DoxyCodeLine{      -\/-\/(result)-\/>tv\_sec;                                                     \(\backslash\)}
\DoxyCodeLine{      (result)-\/>tv\_nsec += 1000000000;                                        \(\backslash\)}
\DoxyCodeLine{    \}                                                                         \(\backslash\)}
\DoxyCodeLine{  \} \textcolor{keywordflow}{while} (0)}

\end{DoxyCode}


\doxysubsection{Function Documentation}
\mbox{\label{group__timer_ga372d9a79777dbdec72e7a19476111b63}} 
\index{Osmocom timers@{Osmocom timers}!\_\_add\_timer@{\_\_add\_timer}}
\index{\_\_add\_timer@{\_\_add\_timer}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{\_\_add\_timer()}
{\footnotesize\ttfamily static void \+\_\+\+\_\+add\+\_\+timer (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$}]{timer }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ container\+\_\+of}, \textbf{ node}, \textbf{ osmo\+\_\+timer\+\_\+list\+::node}, \textbf{ rb\+\_\+insert\+\_\+color()}, \textbf{ rb\+\_\+link\+\_\+node()}, \textbf{ rb\+\_\+root\+::rb\+\_\+node}, \textbf{ osmo\+\_\+timer\+\_\+list\+::timeout}, \textbf{ timer\+\_\+root}, and \textbf{ timercmp}.



Referenced by \textbf{ osmo\+\_\+timer\+\_\+add()}.

\mbox{\label{group__timer_gac11a65dfcd1245fa716356d3650d2a6e}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_clock\_gettime@{osmo\_clock\_gettime}}
\index{osmo\_clock\_gettime@{osmo\_clock\_gettime}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_clock\_gettime()}
{\footnotesize\ttfamily int osmo\+\_\+clock\+\_\+gettime (\begin{DoxyParamCaption}\item[{clockid\+\_\+t}]{clk\+\_\+id,  }\item[{struct timespec $\ast$}]{tp }\end{DoxyParamCaption})}

\mbox{\label{group__timer_ga86a811781179d144f268c0986b7140a9}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_clock\_override\_add@{osmo\_clock\_override\_add}}
\index{osmo\_clock\_override\_add@{osmo\_clock\_override\_add}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_clock\_override\_add()}
{\footnotesize\ttfamily void osmo\+\_\+clock\+\_\+override\+\_\+add (\begin{DoxyParamCaption}\item[{clockid\+\_\+t}]{clk\+\_\+id,  }\item[{time\+\_\+t}]{secs,  }\item[{long}]{nsecs }\end{DoxyParamCaption})}

\mbox{\label{group__timer_ga3e8cfe4cad482612d1bd8a3df75d2d02}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_clock\_override\_enable@{osmo\_clock\_override\_enable}}
\index{osmo\_clock\_override\_enable@{osmo\_clock\_override\_enable}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_clock\_override\_enable()}
{\footnotesize\ttfamily void osmo\+\_\+clock\+\_\+override\+\_\+enable (\begin{DoxyParamCaption}\item[{clockid\+\_\+t}]{clk\+\_\+id,  }\item[{bool}]{enable }\end{DoxyParamCaption})}

\mbox{\label{group__timer_ga08c514dddc196eaa1422dbdee8250b70}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_clock\_override\_gettimespec@{osmo\_clock\_override\_gettimespec}}
\index{osmo\_clock\_override\_gettimespec@{osmo\_clock\_override\_gettimespec}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_clock\_override\_gettimespec()}
{\footnotesize\ttfamily struct timespec $\ast$ osmo\+\_\+clock\+\_\+override\+\_\+gettimespec (\begin{DoxyParamCaption}\item[{clockid\+\_\+t}]{clk\+\_\+id }\end{DoxyParamCaption})}

\mbox{\label{group__timer_ga8c559c124f4720d0a54af5f206681049}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_gettimeofday@{osmo\_gettimeofday}}
\index{osmo\_gettimeofday@{osmo\_gettimeofday}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_gettimeofday()}
{\footnotesize\ttfamily int osmo\+\_\+gettimeofday (\begin{DoxyParamCaption}\item[{struct timeval $\ast$}]{tv,  }\item[{struct timezone $\ast$}]{tz }\end{DoxyParamCaption})}



shim around gettimeofday to be able to set the time manually. 

To override, set osmo\+\_\+gettimeofday\+\_\+override == true and set the desired current time in osmo\+\_\+gettimeofday\+\_\+override\+\_\+time.

N. B\+: gettimeofday() is affected by discontinuous jumps in the system time (e.\+g., if the system administrator manually changes the system time). Hence this should NEVER be used for elapsed time computation. Instead, \doxyref{osmo\+\_\+clock\+\_\+gettime()}{p.}{group__timer_gac11a65dfcd1245fa716356d3650d2a6e} with CLOCK\+\_\+\+MONOTONIC should be used for that. 

References \textbf{ osmo\+\_\+gettimeofday\+\_\+override}, and \textbf{ osmo\+\_\+gettimeofday\+\_\+override\+\_\+time}.



Referenced by \textbf{ \+\_\+gsmtap\+\_\+raw\+\_\+output()}, \textbf{ log\+\_\+output\+\_\+buf()}, \textbf{ osmo\+\_\+timer\+\_\+remaining()}, \textbf{ osmo\+\_\+timer\+\_\+schedule()}, \textbf{ osmo\+\_\+timers\+\_\+prepare()}, and \textbf{ osmo\+\_\+timers\+\_\+update()}.

\mbox{\label{group__timer_gafcbae57ab2c2635d0dd248ec3011bd1c}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_gettimeofday\_override\_add@{osmo\_gettimeofday\_override\_add}}
\index{osmo\_gettimeofday\_override\_add@{osmo\_gettimeofday\_override\_add}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_gettimeofday\_override\_add()}
{\footnotesize\ttfamily void osmo\+\_\+gettimeofday\+\_\+override\+\_\+add (\begin{DoxyParamCaption}\item[{time\+\_\+t}]{secs,  }\item[{suseconds\+\_\+t}]{usecs }\end{DoxyParamCaption})}



convenience function to advance the fake time. 

Add the given values to osmo\+\_\+gettimeofday\+\_\+override\+\_\+time. 

References \textbf{ osmo\+\_\+gettimeofday\+\_\+override\+\_\+time}, and \textbf{ timeradd}.

\mbox{\label{group__timer_ga8eb1bef581081eb105265e56b15945fa}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timer\_add@{osmo\_timer\_add}}
\index{osmo\_timer\_add@{osmo\_timer\_add}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timer\_add()}
{\footnotesize\ttfamily void osmo\+\_\+timer\+\_\+add (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$}]{timer }\end{DoxyParamCaption})}



add a new timer to the timer management 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em timer} & the timer that should be added \\
\hline
\end{DoxyParams}


References \textbf{ \+\_\+\+\_\+add\+\_\+timer()}, \textbf{ osmo\+\_\+timer\+\_\+list\+::active}, \textbf{ INIT\+\_\+\+LLIST\+\_\+\+HEAD}, \textbf{ osmo\+\_\+timer\+\_\+list\+::list}, and \textbf{ osmo\+\_\+timer\+\_\+del()}.



Referenced by \textbf{ osmo\+\_\+timer\+\_\+schedule()}.

\mbox{\label{group__timer_ga1aa977a3eb2d5b5447b8acd32002b6cf}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timer\_del@{osmo\_timer\_del}}
\index{osmo\_timer\_del@{osmo\_timer\_del}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timer\_del()}
{\footnotesize\ttfamily void osmo\+\_\+timer\+\_\+del (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$}]{timer }\end{DoxyParamCaption})}



delete a timer from timer management 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em timer} & the to-\/be-\/deleted timer\\
\hline
\end{DoxyParams}
This function can be used to delete a previously added/scheduled timer from the timer management code. 

References \textbf{ osmo\+\_\+timer\+\_\+list\+::active}, \textbf{ osmo\+\_\+timer\+\_\+list\+::list}, \textbf{ llist\+\_\+del\+\_\+init()}, \textbf{ llist\+\_\+empty()}, \textbf{ osmo\+\_\+timer\+\_\+list\+::node}, \textbf{ rb\+\_\+erase()}, and \textbf{ timer\+\_\+root}.



Referenced by \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+free()}, \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+flush\+\_\+rx()}, \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+free()}, \textbf{ osmo\+\_\+timer\+\_\+add()}, \textbf{ osmo\+\_\+timers\+\_\+update()}, and \textbf{ state\+\_\+chg()}.

\mbox{\label{group__timer_gacf319b1650bff4a8d1536d7557b45563}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timer\_pending@{osmo\_timer\_pending}}
\index{osmo\_timer\_pending@{osmo\_timer\_pending}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timer\_pending()}
{\footnotesize\ttfamily int osmo\+\_\+timer\+\_\+pending (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$}]{timer }\end{DoxyParamCaption})}



check if given timer is still pending 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em timer} & the to-\/be-\/checked timer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if pending, 0 otherwise
\end{DoxyReturn}
This function can be used to determine whether a given timer has alredy expired (returns 0) or is still pending (returns 1) 

References \textbf{ osmo\+\_\+timer\+\_\+list\+::active}.



Referenced by \textbf{ state\+\_\+chg()}.

\mbox{\label{group__timer_ga0e6d99128b6f5e318df78a20c022c068}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timer\_remaining@{osmo\_timer\_remaining}}
\index{osmo\_timer\_remaining@{osmo\_timer\_remaining}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timer\_remaining()}
{\footnotesize\ttfamily int osmo\+\_\+timer\+\_\+remaining (\begin{DoxyParamCaption}\item[{const struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$}]{timer,  }\item[{const struct timeval $\ast$}]{now,  }\item[{struct timeval $\ast$}]{remaining }\end{DoxyParamCaption})}



compute the remaining time of a timer 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em timer} & the to-\/be-\/checked timer \\
\hline
\mbox{\texttt{ in}}  & {\em now} & the current time (NULL if not known) \\
\hline
\mbox{\texttt{ out}}  & {\em remaining} & remaining time until timer fires \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if timer has not expired yet, -\/1 if it has
\end{DoxyReturn}
This function can be used to determine the amount of time remaining until the expiration of the timer. 

References \textbf{ osmo\+\_\+gettimeofday()}, \textbf{ osmo\+\_\+timer\+\_\+list\+::timeout}, and \textbf{ timersub}.



Referenced by \textbf{ state\+\_\+chg()}.

\mbox{\label{group__timer_ga93a296b92775fc08c60eb154a3389e5b}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timer\_schedule@{osmo\_timer\_schedule}}
\index{osmo\_timer\_schedule@{osmo\_timer\_schedule}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timer\_schedule()}
{\footnotesize\ttfamily void osmo\+\_\+timer\+\_\+schedule (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$}]{timer,  }\item[{int}]{seconds,  }\item[{int}]{microseconds }\end{DoxyParamCaption})}



schedule a timer at a given future relative time 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em timer} & the to-\/be-\/added timer \\
\hline
\mbox{\texttt{ in}}  & {\em seconds} & number of seconds from now \\
\hline
\mbox{\texttt{ in}}  & {\em microseconds} & number of microseconds from now\\
\hline
\end{DoxyParams}
This function can be used to (re-\/)schedule a given timer at a specified number of seconds+microseconds in the future. It will internally add it to the timer management data structures, thus \doxyref{osmo\+\_\+timer\+\_\+add()}{p.}{group__timer_ga8eb1bef581081eb105265e56b15945fa} is automatically called. 

References \textbf{ osmo\+\_\+gettimeofday()}, \textbf{ osmo\+\_\+timer\+\_\+add()}, \textbf{ osmo\+\_\+timer\+\_\+list\+::timeout}, and \textbf{ timeradd}.



Referenced by \textbf{ state\+\_\+chg()}, and \textbf{ suart\+\_\+rx\+\_\+ch()}.

\mbox{\label{group__timer_ga7d8def422a9bf39b4d5aefa1fec319e0}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timer\_setup@{osmo\_timer\_setup}}
\index{osmo\_timer\_setup@{osmo\_timer\_setup}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timer\_setup()}
{\footnotesize\ttfamily void osmo\+\_\+timer\+\_\+setup (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+timer\+\_\+list} $\ast$}]{timer,  }\item[{void($\ast$)(void $\ast$\textbf{ data})}]{cb,  }\item[{void $\ast$}]{data }\end{DoxyParamCaption})}



set up timer callback and data 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em timer} & the timer that should be added \\
\hline
\mbox{\texttt{ in}}  & {\em cb} & function to be called when timer expires \\
\hline
\mbox{\texttt{ in}}  & {\em data} & pointer to data that passed to the callback function \\
\hline
\end{DoxyParams}


References \textbf{ osmo\+\_\+timer\+\_\+list\+::cb}, \textbf{ data}, and \textbf{ osmo\+\_\+timer\+\_\+list\+::data}.



Referenced by \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+alloc()}, and \textbf{ osmo\+\_\+soft\+\_\+uart\+\_\+configure()}.

\mbox{\label{group__timer_gada843afa93f84337776c8efc1b539fe3}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timers\_check@{osmo\_timers\_check}}
\index{osmo\_timers\_check@{osmo\_timers\_check}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timers\_check()}
{\footnotesize\ttfamily int osmo\+\_\+timers\+\_\+check (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Check how many timers we have in the system. 

\begin{DoxyReturn}{Returns}
number of \doxyref{osmo\+\_\+timer\+\_\+list}{p.}{structosmo__timer__list} registered 
\end{DoxyReturn}


References \textbf{ node}, \textbf{ rb\+\_\+first()}, \textbf{ rb\+\_\+next()}, and \textbf{ timer\+\_\+root}.

\mbox{\label{group__timer_ga5766d10a219da5e6ab283fede26d2e40}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timers\_nearest@{osmo\_timers\_nearest}}
\index{osmo\_timers\_nearest@{osmo\_timers\_nearest}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timers\_nearest()}
{\footnotesize\ttfamily struct timeval $\ast$ osmo\+\_\+timers\+\_\+nearest (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Determine time between now and the nearest timer. 

\begin{DoxyReturn}{Returns}
pointer to timeval of nearest timer, NULL if there is none
\end{DoxyReturn}
if we have a nearest time return the delta between the current time and the time of the nearest timer. If the nearest timer timed out return NULL and then we will dispatch everything after the select 

References \textbf{ nearest\+\_\+p}.

\mbox{\label{group__timer_gaf7cf25cb666a6c07994b979dc83838fe}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timers\_nearest\_ms@{osmo\_timers\_nearest\_ms}}
\index{osmo\_timers\_nearest\_ms@{osmo\_timers\_nearest\_ms}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timers\_nearest\_ms()}
{\footnotesize\ttfamily int osmo\+\_\+timers\+\_\+nearest\+\_\+ms (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Determine time between now and the nearest timer in milliseconds. 

\begin{DoxyReturn}{Returns}
number of milliseconds until nearest timer expires; -\/1 if no timers pending 
\end{DoxyReturn}


References \textbf{ nearest\+\_\+p}.

\mbox{\label{group__timer_ga420626edb507e81884f9842572a83467}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timers\_prepare@{osmo\_timers\_prepare}}
\index{osmo\_timers\_prepare@{osmo\_timers\_prepare}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timers\_prepare()}
{\footnotesize\ttfamily void osmo\+\_\+timers\+\_\+prepare (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Find the nearest time and update nearest\+\_\+p. 



References \textbf{ container\+\_\+of}, \textbf{ nearest\+\_\+p}, \textbf{ node}, \textbf{ osmo\+\_\+gettimeofday()}, \textbf{ rb\+\_\+first()}, \textbf{ osmo\+\_\+timer\+\_\+list\+::timeout}, \textbf{ timer\+\_\+root}, and \textbf{ update\+\_\+nearest()}.

\mbox{\label{group__timer_gaf8d555ef1c2e59ed54f0e12e2ee1f41c}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_timers\_update@{osmo\_timers\_update}}
\index{osmo\_timers\_update@{osmo\_timers\_update}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_timers\_update()}
{\footnotesize\ttfamily int osmo\+\_\+timers\+\_\+update (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



fire all timers... and remove them 



References \textbf{ osmo\+\_\+timer\+\_\+list\+::cb}, \textbf{ container\+\_\+of}, \textbf{ data}, \textbf{ INIT\+\_\+\+LLIST\+\_\+\+HEAD}, \textbf{ list}, \textbf{ llist\+\_\+add()}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ node}, \textbf{ osmo\+\_\+gettimeofday()}, \textbf{ osmo\+\_\+timer\+\_\+del()}, \textbf{ rb\+\_\+first()}, \textbf{ rb\+\_\+next()}, \textbf{ osmo\+\_\+timer\+\_\+list\+::timeout}, \textbf{ timer\+\_\+root}, and \textbf{ timercmp}.

\mbox{\label{group__timer_ga0c625e3072119d895980fefcd207c14d}} 
\index{Osmocom timers@{Osmocom timers}!update\_nearest@{update\_nearest}}
\index{update\_nearest@{update\_nearest}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{update\_nearest()}
{\footnotesize\ttfamily static void update\+\_\+nearest (\begin{DoxyParamCaption}\item[{struct timeval $\ast$}]{cand,  }\item[{struct timeval $\ast$}]{current }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ nearest}, \textbf{ nearest\+\_\+p}, \textbf{ timerclear}, \textbf{ timercmp}, and \textbf{ timersub}.



Referenced by \textbf{ osmo\+\_\+timers\+\_\+prepare()}.



\doxysubsection{Variable Documentation}
\mbox{\label{group__timer_ga6a22a3c698847d0f033bd656e617fc34}} 
\index{Osmocom timers@{Osmocom timers}!nearest@{nearest}}
\index{nearest@{nearest}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{nearest}
{\footnotesize\ttfamily \+\_\+\+\_\+thread struct timeval nearest\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ update\+\_\+nearest()}.

\mbox{\label{group__timer_ga3a61b742c5d1830cf0719b5d8b32ddcf}} 
\index{Osmocom timers@{Osmocom timers}!nearest\_p@{nearest\_p}}
\index{nearest\_p@{nearest\_p}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{nearest\_p}
{\footnotesize\ttfamily \+\_\+\+\_\+thread struct timeval$\ast$ nearest\+\_\+p\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ osmo\+\_\+timers\+\_\+nearest()}, \textbf{ osmo\+\_\+timers\+\_\+nearest\+\_\+ms()}, \textbf{ osmo\+\_\+timers\+\_\+prepare()}, and \textbf{ update\+\_\+nearest()}.

\mbox{\label{group__timer_gac10c80c84b5f61c509d36f59de66e42f}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_gettimeofday\_override@{osmo\_gettimeofday\_override}}
\index{osmo\_gettimeofday\_override@{osmo\_gettimeofday\_override}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_gettimeofday\_override\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily bool osmo\+\_\+gettimeofday\+\_\+override\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ osmo\+\_\+gettimeofday()}.

\mbox{\label{group__timer_gac10c80c84b5f61c509d36f59de66e42f}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_gettimeofday\_override@{osmo\_gettimeofday\_override}}
\index{osmo\_gettimeofday\_override@{osmo\_gettimeofday\_override}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_gettimeofday\_override\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily bool osmo\+\_\+gettimeofday\+\_\+override = false}



Referenced by \textbf{ osmo\+\_\+gettimeofday()}.

\mbox{\label{group__timer_gac0b4877db25000054ec9226dc39a7a79}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_gettimeofday\_override\_time@{osmo\_gettimeofday\_override\_time}}
\index{osmo\_gettimeofday\_override\_time@{osmo\_gettimeofday\_override\_time}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_gettimeofday\_override\_time\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily struct timeval osmo\+\_\+gettimeofday\+\_\+override\+\_\+time\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ osmo\+\_\+gettimeofday()}, and \textbf{ osmo\+\_\+gettimeofday\+\_\+override\+\_\+add()}.

\mbox{\label{group__timer_gac0b4877db25000054ec9226dc39a7a79}} 
\index{Osmocom timers@{Osmocom timers}!osmo\_gettimeofday\_override\_time@{osmo\_gettimeofday\_override\_time}}
\index{osmo\_gettimeofday\_override\_time@{osmo\_gettimeofday\_override\_time}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{osmo\_gettimeofday\_override\_time\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily struct timeval osmo\+\_\+gettimeofday\+\_\+override\+\_\+time = \{ 23, 424242 \}}



Referenced by \textbf{ osmo\+\_\+gettimeofday()}, and \textbf{ osmo\+\_\+gettimeofday\+\_\+override\+\_\+add()}.

\mbox{\label{group__timer_ga8733ce9a99e5a3780ff71baae89a9ccd}} 
\index{Osmocom timers@{Osmocom timers}!timer\_root@{timer\_root}}
\index{timer\_root@{timer\_root}!Osmocom timers@{Osmocom timers}}
\doxysubsubsection{timer\_root}
{\footnotesize\ttfamily \+\_\+\+\_\+thread struct \textbf{ rb\+\_\+root} timer\+\_\+root = \textbf{ RB\+\_\+\+ROOT}\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ \+\_\+\+\_\+add\+\_\+timer()}, \textbf{ osmo\+\_\+timer\+\_\+del()}, \textbf{ osmo\+\_\+timers\+\_\+check()}, \textbf{ osmo\+\_\+timers\+\_\+prepare()}, and \textbf{ osmo\+\_\+timers\+\_\+update()}.

