\doxysection{osmo\+\_\+tdef Struct Reference}
\label{structosmo__tdef}\index{osmo\_tdef@{osmo\_tdef}}


Define a GSM timer of the form Tnnn, with unit, default value and doc string.  




{\ttfamily \#include $<$tdef.\+h$>$}

\doxysubsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
const int \textbf{ T}
\begin{DoxyCompactList}\small\item\em T1234 or X1234 number, corresponding to struct \doxyref{osmo\+\_\+fsm\+\_\+inst\+::T}{p.}{structosmo__fsm__inst_a8c1856de9383574623e1107067c3f156}. \end{DoxyCompactList}\item 
const unsigned long \textbf{ default\+\_\+val}
\begin{DoxyCompactList}\small\item\em Timeout duration (according to unit), default value; type corresponds to \doxyref{osmo\+\_\+fsm\+\_\+inst\+\_\+state\+\_\+chg()}{p.}{group__fsm_gac2bc3009053763ca99356e824529a2e4}\textquotesingle{}s timeout\+\_\+secs argument. \end{DoxyCompactList}\item 
enum \textbf{ osmo\+\_\+tdef\+\_\+unit} \textbf{ unit}
\item 
const char $\ast$ \textbf{ desc}
\begin{DoxyCompactList}\small\item\em Human readable description. \end{DoxyCompactList}\item 
unsigned long \textbf{ val}
\begin{DoxyCompactList}\small\item\em Currently active timeout value, e.\+g. \end{DoxyCompactList}\item 
unsigned long \textbf{ min\+\_\+val}
\begin{DoxyCompactList}\small\item\em Minimum timer value (in this tdef unit), checked if set (not zero). \end{DoxyCompactList}\item 
unsigned long \textbf{ max\+\_\+val}
\begin{DoxyCompactList}\small\item\em Maximum timer value (in this tdef unit), checked if set (not zero). \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Define a GSM timer of the form Tnnn, with unit, default value and doc string. 

Typically used as an array with the last entry being left zero-\/initialized, e.\+g.\+: \begin{DoxyVerb}    struct osmo_tdef tdefs[] = {
            { .T=10, .default_val=6, .desc="RR Assignment" },
            { .T=101, .default_val=10, .desc="inter-BSC Handover MT, HO Request to HO Accept" },
            { .T=3101, .default_val=3, .desc="RR Immediate Assignment" },
            { .T=-23, .default_val=42, .desc="internal X23 timeout (contrived example)" },
            {}
    };
\end{DoxyVerb}
 Program initialization should call \doxyref{osmo\+\_\+tdefs\+\_\+reset()}{p.}{group__Tdef_ga0a2cda1d30e23023cc179b68b8c624e6} so that all timers return the default\+\_\+val, until e.\+g. the VTY configuration sets user-\/defined values (see osmo\+\_\+tdef\+\_\+vty\+\_\+init()). 

\doxysubsection{Field Documentation}
\mbox{\label{structosmo__tdef_aaa301306dcdf81c075ca03365ad43738}} 
\index{osmo\_tdef@{osmo\_tdef}!default\_val@{default\_val}}
\index{default\_val@{default\_val}!osmo\_tdef@{osmo\_tdef}}
\doxysubsubsection{default\_val}
{\footnotesize\ttfamily const unsigned long osmo\+\_\+tdef\+::default\+\_\+val}



Timeout duration (according to unit), default value; type corresponds to \doxyref{osmo\+\_\+fsm\+\_\+inst\+\_\+state\+\_\+chg()}{p.}{group__fsm_gac2bc3009053763ca99356e824529a2e4}\textquotesingle{}s timeout\+\_\+secs argument. 

Note that \doxyref{osmo\+\_\+fsm\+\_\+inst\+\_\+state\+\_\+chg()}{p.}{group__fsm_gac2bc3009053763ca99356e824529a2e4} clamps the range. 

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

\mbox{\label{structosmo__tdef_aa5a127f1c816e6f053a8a7b48920b6e9}} 
\index{osmo\_tdef@{osmo\_tdef}!desc@{desc}}
\index{desc@{desc}!osmo\_tdef@{osmo\_tdef}}
\doxysubsubsection{desc}
{\footnotesize\ttfamily const char$\ast$ osmo\+\_\+tdef\+::desc}



Human readable description. 

For unit == OSMO\+\_\+\+TDEF\+\_\+\+CUSTOM, this should include an explanation of the value\textquotesingle{}s unit. Best keep this a short one-\/liner (e.\+g. for VTY output). \mbox{\label{structosmo__tdef_a929442b826d692030796a49485436b9b}} 
\index{osmo\_tdef@{osmo\_tdef}!max\_val@{max\_val}}
\index{max\_val@{max\_val}!osmo\_tdef@{osmo\_tdef}}
\doxysubsubsection{max\_val}
{\footnotesize\ttfamily unsigned long osmo\+\_\+tdef\+::max\+\_\+val}



Maximum timer value (in this tdef unit), checked if set (not zero). 



Referenced by \textbf{ osmo\+\_\+tdef\+\_\+range\+\_\+str\+\_\+buf()}, and \textbf{ osmo\+\_\+tdef\+\_\+val\+\_\+in\+\_\+range()}.

\mbox{\label{structosmo__tdef_ae67d57826e38571645a9059ffa83327e}} 
\index{osmo\_tdef@{osmo\_tdef}!min\_val@{min\_val}}
\index{min\_val@{min\_val}!osmo\_tdef@{osmo\_tdef}}
\doxysubsubsection{min\_val}
{\footnotesize\ttfamily unsigned long osmo\+\_\+tdef\+::min\+\_\+val}



Minimum timer value (in this tdef unit), checked if set (not zero). 



Referenced by \textbf{ osmo\+\_\+tdef\+\_\+range\+\_\+str\+\_\+buf()}, and \textbf{ osmo\+\_\+tdef\+\_\+val\+\_\+in\+\_\+range()}.

\mbox{\label{structosmo__tdef_aa8fdd929b165511b9c68b5a8a73ea420}} 
\index{osmo\_tdef@{osmo\_tdef}!T@{T}}
\index{T@{T}!osmo\_tdef@{osmo\_tdef}}
\doxysubsubsection{T}
{\footnotesize\ttfamily const int osmo\+\_\+tdef\+::T}



T1234 or X1234 number, corresponding to struct \doxyref{osmo\+\_\+fsm\+\_\+inst\+::T}{p.}{structosmo__fsm__inst_a8c1856de9383574623e1107067c3f156}. 

Positive values for T are considered to be 3GPP spec compliant and appear in logging and VTY as \char`\"{}\+T1234\char`\"{}, while negative values are considered to be Osmocom specific timers, represented in logging and VTY as \char`\"{}\+X1234\char`\"{}. Be aware that \doxyref{osmo\+\_\+tdef\+\_\+fsm\+\_\+inst\+\_\+state\+\_\+chg()}{p.}{group__Tdef_ga62ef360585a2162bcac01c588025ce97} interprets T == 0 as \char`\"{}state without timeout\char`\"{}. 

Referenced by \textbf{ osmo\+\_\+tdef\+\_\+get()}, \textbf{ osmo\+\_\+tdef\+\_\+get\+\_\+entry()}, \textbf{ osmo\+\_\+tdef\+\_\+set()}, and \textbf{ osmo\+\_\+tdefs\+\_\+reset()}.

\mbox{\label{structosmo__tdef_a0e6ea0f73fe65cde08e50431d503c5f9}} 
\index{osmo\_tdef@{osmo\_tdef}!unit@{unit}}
\index{unit@{unit}!osmo\_tdef@{osmo\_tdef}}
\doxysubsubsection{unit}
{\footnotesize\ttfamily enum \textbf{ osmo\+\_\+tdef\+\_\+unit} osmo\+\_\+tdef\+::unit}



Referenced by \textbf{ \+\_\+osmo\+\_\+tdef\+\_\+fsm\+\_\+inst\+\_\+state\+\_\+chg()}, \textbf{ osmo\+\_\+tdef\+\_\+get()}, and \textbf{ osmo\+\_\+tdef\+\_\+set()}.

\mbox{\label{structosmo__tdef_ae81b5f0c2bda9bb71b5fdd6fd8ea167e}} 
\index{osmo\_tdef@{osmo\_tdef}!val@{val}}
\index{val@{val}!osmo\_tdef@{osmo\_tdef}}
\doxysubsubsection{val}
{\footnotesize\ttfamily unsigned long osmo\+\_\+tdef\+::val}



Currently active timeout value, e.\+g. 

set by user config. This is the only mutable member\+: a user may configure the timeout value, but neither unit nor any other field. 

Referenced by \textbf{ \+\_\+osmo\+\_\+tdef\+\_\+fsm\+\_\+inst\+\_\+state\+\_\+chg()}, \textbf{ osmo\+\_\+tdef\+\_\+get()}, \textbf{ osmo\+\_\+tdef\+\_\+set()}, and \textbf{ osmo\+\_\+tdefs\+\_\+reset()}.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
include/osmocom/core/\textbf{ tdef.\+h}\end{DoxyCompactItemize}
