\doxysection{osmo\+\_\+fsm Struct Reference}
\label{structosmo__fsm}\index{osmo\_fsm@{osmo\_fsm}}


a description of an osmocom finite state machine  




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

\doxysubsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ llist\+\_\+head} \textbf{ list}
\begin{DoxyCompactList}\small\item\em global list \end{DoxyCompactList}\item 
struct \textbf{ llist\+\_\+head} \textbf{ instances}
\begin{DoxyCompactList}\small\item\em list of instances of this FSM \end{DoxyCompactList}\item 
const char $\ast$ \textbf{ name}
\begin{DoxyCompactList}\small\item\em human readable name \end{DoxyCompactList}\item 
const struct \textbf{ osmo\+\_\+fsm\+\_\+state} $\ast$ \textbf{ states}
\begin{DoxyCompactList}\small\item\em table of state transition rules \end{DoxyCompactList}\item 
unsigned int \textbf{ num\+\_\+states}
\begin{DoxyCompactList}\small\item\em number of entries in \doxyref{states}{p.}{structosmo__fsm_ada097b667d070e4f4607789eae6939ca} \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ allstate\+\_\+event\+\_\+mask}
\begin{DoxyCompactList}\small\item\em bit-\/mask of events permitted in all states \end{DoxyCompactList}\item 
void($\ast$ \textbf{ allstate\+\_\+action} )(struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$fi, uint32\+\_\+t \textbf{ event}, void $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em function pointer to be called for allstate events \end{DoxyCompactList}\item 
void($\ast$ \textbf{ cleanup} )(struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$fi, enum \textbf{ osmo\+\_\+fsm\+\_\+term\+\_\+cause} \textbf{ cause})
\begin{DoxyCompactList}\small\item\em clean-\/up function, called during termination \end{DoxyCompactList}\item 
int($\ast$ \textbf{ timer\+\_\+cb} )(struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$fi)
\begin{DoxyCompactList}\small\item\em timer call-\/back for states with time-\/out. \end{DoxyCompactList}\item 
int \textbf{ log\+\_\+subsys}
\begin{DoxyCompactList}\small\item\em logging sub-\/system for this FSM \end{DoxyCompactList}\item 
const struct \textbf{ value\+\_\+string} $\ast$ \textbf{ event\+\_\+names}
\begin{DoxyCompactList}\small\item\em human-\/readable names of events \end{DoxyCompactList}\item 
void($\ast$ \textbf{ pre\+\_\+term} )(struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$fi, enum \textbf{ osmo\+\_\+fsm\+\_\+term\+\_\+cause} \textbf{ cause})
\begin{DoxyCompactList}\small\item\em graceful exit function, called at the beginning of termination \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
a description of an osmocom finite state machine 

\doxysubsection{Field Documentation}
\mbox{\label{structosmo__fsm_a53c65415a0504d5555ea9805d4645c74}} 
\index{osmo\_fsm@{osmo\_fsm}!allstate\_action@{allstate\_action}}
\index{allstate\_action@{allstate\_action}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{allstate\_action}
{\footnotesize\ttfamily void($\ast$ osmo\+\_\+fsm\+::allstate\+\_\+action) (struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$fi, uint32\+\_\+t \textbf{ event}, void $\ast$\textbf{ data})}



function pointer to be called for allstate events 



Referenced by \textbf{ \+\_\+osmo\+\_\+fsm\+\_\+inst\+\_\+dispatch()}.

\mbox{\label{structosmo__fsm_a05e7c1a452e38f5a1b649e5ed5d251a9}} 
\index{osmo\_fsm@{osmo\_fsm}!allstate\_event\_mask@{allstate\_event\_mask}}
\index{allstate\_event\_mask@{allstate\_event\_mask}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{allstate\_event\_mask}
{\footnotesize\ttfamily uint32\+\_\+t osmo\+\_\+fsm\+::allstate\+\_\+event\+\_\+mask}



bit-\/mask of events permitted in all states 



Referenced by \textbf{ \+\_\+osmo\+\_\+fsm\+\_\+inst\+\_\+dispatch()}.

\mbox{\label{structosmo__fsm_a9c0e8332d336f91f59bf82d52f82792c}} 
\index{osmo\_fsm@{osmo\_fsm}!cleanup@{cleanup}}
\index{cleanup@{cleanup}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{cleanup}
{\footnotesize\ttfamily void($\ast$ osmo\+\_\+fsm\+::cleanup) (struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$fi, enum \textbf{ osmo\+\_\+fsm\+\_\+term\+\_\+cause} \textbf{ cause})}



clean-\/up function, called during termination 



Referenced by \textbf{ \+\_\+osmo\+\_\+fsm\+\_\+inst\+\_\+term()}.

\mbox{\label{structosmo__fsm_ab1a1382fd1fcfb58c18e982389e97008}} 
\index{osmo\_fsm@{osmo\_fsm}!event\_names@{event\_names}}
\index{event\_names@{event\_names}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{event\_names}
{\footnotesize\ttfamily const struct \textbf{ value\+\_\+string}$\ast$ osmo\+\_\+fsm\+::event\+\_\+names}



human-\/readable names of events 



Referenced by \textbf{ osmo\+\_\+fsm\+\_\+event\+\_\+name()}, and \textbf{ osmo\+\_\+fsm\+\_\+register()}.

\mbox{\label{structosmo__fsm_ad04c105e90567c046a66d765b89eb161}} 
\index{osmo\_fsm@{osmo\_fsm}!instances@{instances}}
\index{instances@{instances}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{instances}
{\footnotesize\ttfamily struct \textbf{ llist\+\_\+head} osmo\+\_\+fsm\+::instances}



list of instances of this FSM 



Referenced by \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+alloc()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+find\+\_\+by\+\_\+id()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+find\+\_\+by\+\_\+name()}, and \textbf{ osmo\+\_\+fsm\+\_\+register()}.

\mbox{\label{structosmo__fsm_ab63b138bf1a2e312550bcb51d506d88d}} 
\index{osmo\_fsm@{osmo\_fsm}!list@{list}}
\index{list@{list}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{list}
{\footnotesize\ttfamily struct \textbf{ llist\+\_\+head} osmo\+\_\+fsm\+::list}



global list 



Referenced by \textbf{ osmo\+\_\+fsm\+\_\+register()}, and \textbf{ osmo\+\_\+fsm\+\_\+unregister()}.

\mbox{\label{structosmo__fsm_a6efbe1edfc3be37aba184f9272005221}} 
\index{osmo\_fsm@{osmo\_fsm}!log\_subsys@{log\_subsys}}
\index{log\_subsys@{log\_subsys}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{log\_subsys}
{\footnotesize\ttfamily int osmo\+\_\+fsm\+::log\+\_\+subsys}



logging sub-\/system for this FSM 

\mbox{\label{structosmo__fsm_aa3215ebcca24a6c602ef97a511fcd43c}} 
\index{osmo\_fsm@{osmo\_fsm}!name@{name}}
\index{name@{name}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{name}
{\footnotesize\ttfamily const char$\ast$ osmo\+\_\+fsm\+::name}



human readable name 



Referenced by \textbf{ osmo\+\_\+fsm\+\_\+find\+\_\+by\+\_\+name()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+name()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+\_\+update\+\_\+id\+\_\+f()}, \textbf{ osmo\+\_\+fsm\+\_\+register()}, and \textbf{ update\+\_\+name()}.

\mbox{\label{structosmo__fsm_a5ab2bda4fb7101994dd39091611efe8e}} 
\index{osmo\_fsm@{osmo\_fsm}!num\_states@{num\_states}}
\index{num\_states@{num\_states}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{num\_states}
{\footnotesize\ttfamily unsigned int osmo\+\_\+fsm\+::num\+\_\+states}



number of entries in \doxyref{states}{p.}{structosmo__fsm_ada097b667d070e4f4607789eae6939ca} 



Referenced by \textbf{ \+\_\+osmo\+\_\+fsm\+\_\+inst\+\_\+dispatch()}, and \textbf{ osmo\+\_\+fsm\+\_\+state\+\_\+name()}.

\mbox{\label{structosmo__fsm_aca95aca80b364dc3eede7a155529c0ec}} 
\index{osmo\_fsm@{osmo\_fsm}!pre\_term@{pre\_term}}
\index{pre\_term@{pre\_term}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{pre\_term}
{\footnotesize\ttfamily void($\ast$ osmo\+\_\+fsm\+::pre\+\_\+term) (struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$fi, enum \textbf{ osmo\+\_\+fsm\+\_\+term\+\_\+cause} \textbf{ cause})}



graceful exit function, called at the beginning of termination 



Referenced by \textbf{ \+\_\+osmo\+\_\+fsm\+\_\+inst\+\_\+term()}.

\mbox{\label{structosmo__fsm_ada097b667d070e4f4607789eae6939ca}} 
\index{osmo\_fsm@{osmo\_fsm}!states@{states}}
\index{states@{states}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{states}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+fsm\+\_\+state}$\ast$ osmo\+\_\+fsm\+::states}



table of state transition rules 



Referenced by \textbf{ \+\_\+osmo\+\_\+fsm\+\_\+inst\+\_\+dispatch()}, \textbf{ osmo\+\_\+fsm\+\_\+state\+\_\+name()}, and \textbf{ state\+\_\+chg()}.

\mbox{\label{structosmo__fsm_a53fd6ecbddbbed54abbcb57c62584389}} 
\index{osmo\_fsm@{osmo\_fsm}!timer\_cb@{timer\_cb}}
\index{timer\_cb@{timer\_cb}!osmo\_fsm@{osmo\_fsm}}
\doxysubsubsection{timer\_cb}
{\footnotesize\ttfamily int($\ast$ osmo\+\_\+fsm\+::timer\+\_\+cb) (struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$fi)}



timer call-\/back for states with time-\/out. 

\begin{DoxyReturn}{Returns}
1 to request termination, 0 to keep running. 
\end{DoxyReturn}


Referenced by \textbf{ fsm\+\_\+tmr\+\_\+cb()}.



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