\doxysection{Intra-\/application signals}
\label{group__signal}\index{Intra-\/application signals@{Intra-\/application signals}}


Generic signalling/notification infrastructure.  


\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ signal.\+h}
\item 
file \textbf{ signal.\+c}
\begin{DoxyCompactList}\small\item\em Generic signalling/notification infrastructure. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ signal\+\_\+handler}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ OSMO\+\_\+\+SIGNAL\+\_\+\+SS\+\_\+\+APPS}~0
\begin{DoxyCompactList}\small\item\em subsystem signaling numbers\+: we split the numberspace for applications and libraries\+: from 0 to UINT\+\_\+\+MAX/2 for applications, from UINT\+\_\+\+MAX/2 to UINT\+\_\+\+MAX for libraries. \end{DoxyCompactList}\item 
\#define \textbf{ OSMO\+\_\+\+SIGNAL\+\_\+\+SS\+\_\+\+RESERVED}~2147483648\textbf{ u}
\item 
\#define \textbf{ OSMO\+\_\+\+SIGNAL\+\_\+\+T\+\_\+\+APPS}~0
\item 
\#define \textbf{ OSMO\+\_\+\+SIGNAL\+\_\+\+T\+\_\+\+RESERVED}~2147483648\textbf{ u}
\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef int \textbf{ osmo\+\_\+signal\+\_\+cbfn}(unsigned int \textbf{ subsys}, unsigned int signal, void $\ast$handler\+\_\+data, void $\ast$signal\+\_\+data)
\begin{DoxyCompactList}\small\item\em signal callback function type \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \{ \newline
\textbf{ SS\+\_\+\+L\+\_\+\+GLOBAL} = OSMO\+\_\+\+SIGNAL\+\_\+\+SS\+\_\+\+RESERVED
, \newline
\textbf{ SS\+\_\+\+L\+\_\+\+INPUT}
, \newline
\textbf{ SS\+\_\+\+L\+\_\+\+NS}
, \newline
\textbf{ SS\+\_\+\+L\+\_\+\+VTY}
 \}
\begin{DoxyCompactList}\small\item\em signal subsystems \end{DoxyCompactList}\item 
enum \{ \textbf{ S\+\_\+\+L\+\_\+\+GLOBAL\+\_\+\+SHUTDOWN} = OSMO\+\_\+\+SIGNAL\+\_\+\+T\+\_\+\+RESERVED
 \}
\begin{DoxyCompactList}\small\item\em signal types. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void $\ast$ \textbf{ osmo\+\_\+signal\+\_\+talloc\+\_\+ctx\+\_\+init} (void $\ast$root\+\_\+ctx)
\begin{DoxyCompactList}\small\item\em Initialize a \doxyref{signal\+\_\+handler}{p.}{structsignal__handler} talloc context for \doxyref{osmo\+\_\+signal\+\_\+register\+\_\+handler}{p.}{group__signal_ga34e5e27e85ffdaa63744cf9e97468807}. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+signal\+\_\+register\+\_\+handler} (unsigned int \textbf{ subsys}, \textbf{ osmo\+\_\+signal\+\_\+cbfn} $\ast$cbfn, void $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Register a new signal handler. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+signal\+\_\+unregister\+\_\+handler} (unsigned int \textbf{ subsys}, \textbf{ osmo\+\_\+signal\+\_\+cbfn} $\ast$cbfn, void $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Unregister signal handler. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+signal\+\_\+dispatch} (unsigned int \textbf{ subsys}, unsigned int signal, void $\ast$signal\+\_\+data)
\begin{DoxyCompactList}\small\item\em dispatch (deliver) a new signal to all registered handlers \end{DoxyCompactList}\item 
static \textbf{ LLIST\+\_\+\+HEAD} (signal\+\_\+handler\+\_\+list)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
void $\ast$ \textbf{ tall\+\_\+sigh\+\_\+ctx}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Generic signalling/notification infrastructure. 



\doxysubsection{Macro Definition Documentation}
\mbox{\label{group__signal_gabf1fd02256768cfed6356d8434e3163a}} 
\index{Intra-\/application signals@{Intra-\/application signals}!OSMO\_SIGNAL\_SS\_APPS@{OSMO\_SIGNAL\_SS\_APPS}}
\index{OSMO\_SIGNAL\_SS\_APPS@{OSMO\_SIGNAL\_SS\_APPS}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{OSMO\_SIGNAL\_SS\_APPS}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SIGNAL\+\_\+\+SS\+\_\+\+APPS~0}



subsystem signaling numbers\+: we split the numberspace for applications and libraries\+: from 0 to UINT\+\_\+\+MAX/2 for applications, from UINT\+\_\+\+MAX/2 to UINT\+\_\+\+MAX for libraries. 

\mbox{\label{group__signal_gaea2126eb1859066374a148c5929fc901}} 
\index{Intra-\/application signals@{Intra-\/application signals}!OSMO\_SIGNAL\_SS\_RESERVED@{OSMO\_SIGNAL\_SS\_RESERVED}}
\index{OSMO\_SIGNAL\_SS\_RESERVED@{OSMO\_SIGNAL\_SS\_RESERVED}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{OSMO\_SIGNAL\_SS\_RESERVED}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SIGNAL\+\_\+\+SS\+\_\+\+RESERVED~2147483648\textbf{ u}}

\mbox{\label{group__signal_ga24a50e4e7f446e4b595ce13b66418eeb}} 
\index{Intra-\/application signals@{Intra-\/application signals}!OSMO\_SIGNAL\_T\_APPS@{OSMO\_SIGNAL\_T\_APPS}}
\index{OSMO\_SIGNAL\_T\_APPS@{OSMO\_SIGNAL\_T\_APPS}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{OSMO\_SIGNAL\_T\_APPS}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SIGNAL\+\_\+\+T\+\_\+\+APPS~0}

\mbox{\label{group__signal_ga2e48d094a85446edcb2a9a8b2d7adb34}} 
\index{Intra-\/application signals@{Intra-\/application signals}!OSMO\_SIGNAL\_T\_RESERVED@{OSMO\_SIGNAL\_T\_RESERVED}}
\index{OSMO\_SIGNAL\_T\_RESERVED@{OSMO\_SIGNAL\_T\_RESERVED}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{OSMO\_SIGNAL\_T\_RESERVED}
{\footnotesize\ttfamily \#define OSMO\+\_\+\+SIGNAL\+\_\+\+T\+\_\+\+RESERVED~2147483648\textbf{ u}}



\doxysubsection{Typedef Documentation}
\mbox{\label{group__signal_gae1e33b4b31b9aa6d224de68053dcb1ce}} 
\index{Intra-\/application signals@{Intra-\/application signals}!osmo\_signal\_cbfn@{osmo\_signal\_cbfn}}
\index{osmo\_signal\_cbfn@{osmo\_signal\_cbfn}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{osmo\_signal\_cbfn}
{\footnotesize\ttfamily typedef int osmo\+\_\+signal\+\_\+cbfn(unsigned int \textbf{ subsys}, unsigned int signal, void $\ast$handler\+\_\+data, void $\ast$signal\+\_\+data)}



signal callback function type 



\doxysubsection{Enumeration Type Documentation}
\mbox{\label{group__signal_ga7ff5f2dff38e7639981794c43dc9167b}} 
\doxysubsubsection{anonymous enum}
{\footnotesize\ttfamily anonymous enum}



signal subsystems 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{SS\_L\_GLOBAL@{SS\_L\_GLOBAL}!Intra-\/application signals@{Intra-\/application signals}}\index{Intra-\/application signals@{Intra-\/application signals}!SS\_L\_GLOBAL@{SS\_L\_GLOBAL}}}\mbox{\label{group__signal_gga7ff5f2dff38e7639981794c43dc9167ba1c16e247915ba903f0b15dd21f33f924}} 
SS\+\_\+\+L\+\_\+\+GLOBAL&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{SS\_L\_INPUT@{SS\_L\_INPUT}!Intra-\/application signals@{Intra-\/application signals}}\index{Intra-\/application signals@{Intra-\/application signals}!SS\_L\_INPUT@{SS\_L\_INPUT}}}\mbox{\label{group__signal_gga7ff5f2dff38e7639981794c43dc9167ba0f74e71436faadd50e466563f7f5fabd}} 
SS\+\_\+\+L\+\_\+\+INPUT&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{SS\_L\_NS@{SS\_L\_NS}!Intra-\/application signals@{Intra-\/application signals}}\index{Intra-\/application signals@{Intra-\/application signals}!SS\_L\_NS@{SS\_L\_NS}}}\mbox{\label{group__signal_gga7ff5f2dff38e7639981794c43dc9167baea1b3aaafcf5689c71b9db0e2db8ab7d}} 
SS\+\_\+\+L\+\_\+\+NS&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{SS\_L\_VTY@{SS\_L\_VTY}!Intra-\/application signals@{Intra-\/application signals}}\index{Intra-\/application signals@{Intra-\/application signals}!SS\_L\_VTY@{SS\_L\_VTY}}}\mbox{\label{group__signal_gga7ff5f2dff38e7639981794c43dc9167ba3b46c605181dbc6523c86e9e66b76004}} 
SS\+\_\+\+L\+\_\+\+VTY&\\
\hline

\end{DoxyEnumFields}
\mbox{\label{group__signal_gaabfcbcb5ac86a1edac4035264bc7d2b8}} 
\doxysubsubsection{anonymous enum}
{\footnotesize\ttfamily anonymous enum}



signal types. 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{S\_L\_GLOBAL\_SHUTDOWN@{S\_L\_GLOBAL\_SHUTDOWN}!Intra-\/application signals@{Intra-\/application signals}}\index{Intra-\/application signals@{Intra-\/application signals}!S\_L\_GLOBAL\_SHUTDOWN@{S\_L\_GLOBAL\_SHUTDOWN}}}\mbox{\label{group__signal_ggaabfcbcb5ac86a1edac4035264bc7d2b8a4332cdc80e697a91f1f95b89b59216be}} 
S\+\_\+\+L\+\_\+\+GLOBAL\+\_\+\+SHUTDOWN&\\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\mbox{\label{group__signal_gaa46f0e38b6dcdd49627b6d171d51e9c5}} 
\index{Intra-\/application signals@{Intra-\/application signals}!LLIST\_HEAD@{LLIST\_HEAD}}
\index{LLIST\_HEAD@{LLIST\_HEAD}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{LLIST\_HEAD()}
{\footnotesize\ttfamily static LLIST\+\_\+\+HEAD (\begin{DoxyParamCaption}\item[{signal\+\_\+handler\+\_\+list}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}

\mbox{\label{group__signal_ga8eb0fdf74d9ae54383b10cb88792a008}} 
\index{Intra-\/application signals@{Intra-\/application signals}!osmo\_signal\_dispatch@{osmo\_signal\_dispatch}}
\index{osmo\_signal\_dispatch@{osmo\_signal\_dispatch}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{osmo\_signal\_dispatch()}
{\footnotesize\ttfamily void osmo\+\_\+signal\+\_\+dispatch (\begin{DoxyParamCaption}\item[{unsigned int}]{subsys,  }\item[{unsigned int}]{signal,  }\item[{void $\ast$}]{signal\+\_\+data }\end{DoxyParamCaption})}



dispatch (deliver) a new signal to all registered handlers 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em subsys} & Subsystem number \\
\hline
\mbox{\texttt{ in}}  & {\em signal} & Signal number, \\
\hline
\mbox{\texttt{ in}}  & {\em signal\+\_\+data} & Data to be passed along to handlers \\
\hline
\end{DoxyParams}


References \textbf{ signal\+\_\+handler\+::cbfn}, \textbf{ signal\+\_\+handler\+::data}, \textbf{ signal\+\_\+handler\+::entry}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ subsys}, and \textbf{ signal\+\_\+handler\+::subsys}.

\mbox{\label{group__signal_ga34e5e27e85ffdaa63744cf9e97468807}} 
\index{Intra-\/application signals@{Intra-\/application signals}!osmo\_signal\_register\_handler@{osmo\_signal\_register\_handler}}
\index{osmo\_signal\_register\_handler@{osmo\_signal\_register\_handler}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{osmo\_signal\_register\_handler()}
{\footnotesize\ttfamily int osmo\+\_\+signal\+\_\+register\+\_\+handler (\begin{DoxyParamCaption}\item[{unsigned int}]{subsys,  }\item[{\textbf{ osmo\+\_\+signal\+\_\+cbfn} $\ast$}]{cbfn,  }\item[{void $\ast$}]{data }\end{DoxyParamCaption})}



Register a new signal handler. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em subsys} & Subsystem number \\
\hline
\mbox{\texttt{ in}}  & {\em cbfn} & Callback function \\
\hline
\mbox{\texttt{ in}}  & {\em data} & Data passed through to callback \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success; negative in case of error 
\end{DoxyReturn}


References \textbf{ signal\+\_\+handler\+::cbfn}, \textbf{ data}, \textbf{ signal\+\_\+handler\+::data}, \textbf{ signal\+\_\+handler\+::entry}, \textbf{ llist\+\_\+add\+\_\+tail()}, \textbf{ subsys}, \textbf{ signal\+\_\+handler\+::subsys}, and \textbf{ tall\+\_\+sigh\+\_\+ctx}.

\mbox{\label{group__signal_gacbbc59427aa2fd838becc61d3443ca44}} 
\index{Intra-\/application signals@{Intra-\/application signals}!osmo\_signal\_talloc\_ctx\_init@{osmo\_signal\_talloc\_ctx\_init}}
\index{osmo\_signal\_talloc\_ctx\_init@{osmo\_signal\_talloc\_ctx\_init}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{osmo\_signal\_talloc\_ctx\_init()}
{\footnotesize\ttfamily void $\ast$ osmo\+\_\+signal\+\_\+talloc\+\_\+ctx\+\_\+init (\begin{DoxyParamCaption}\item[{void $\ast$}]{root\+\_\+ctx }\end{DoxyParamCaption})}



Initialize a \doxyref{signal\+\_\+handler}{p.}{structsignal__handler} talloc context for \doxyref{osmo\+\_\+signal\+\_\+register\+\_\+handler}{p.}{group__signal_ga34e5e27e85ffdaa63744cf9e97468807}. 

Create a talloc context called \char`\"{}osmo\+\_\+signal\char`\"{}. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em root\+\_\+ctx} & talloc context used as parent for the new \char`\"{}osmo\+\_\+signal\char`\"{} ctx. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the new osmo\+\_\+signal talloc context, e.\+g. for reporting 
\end{DoxyReturn}


References \textbf{ tall\+\_\+sigh\+\_\+ctx}.

\mbox{\label{group__signal_ga62da9d737e40883ac0d15b7b3bc049fb}} 
\index{Intra-\/application signals@{Intra-\/application signals}!osmo\_signal\_unregister\_handler@{osmo\_signal\_unregister\_handler}}
\index{osmo\_signal\_unregister\_handler@{osmo\_signal\_unregister\_handler}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{osmo\_signal\_unregister\_handler()}
{\footnotesize\ttfamily void osmo\+\_\+signal\+\_\+unregister\+\_\+handler (\begin{DoxyParamCaption}\item[{unsigned int}]{subsys,  }\item[{\textbf{ osmo\+\_\+signal\+\_\+cbfn} $\ast$}]{cbfn,  }\item[{void $\ast$}]{data }\end{DoxyParamCaption})}



Unregister signal handler. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em subsys} & Subsystem number \\
\hline
\mbox{\texttt{ in}}  & {\em cbfn} & Callback function \\
\hline
\mbox{\texttt{ in}}  & {\em data} & Data passed through to callback \\
\hline
\end{DoxyParams}


References \textbf{ signal\+\_\+handler\+::cbfn}, \textbf{ data}, \textbf{ signal\+\_\+handler\+::data}, \textbf{ signal\+\_\+handler\+::entry}, \textbf{ llist\+\_\+del()}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ subsys}, and \textbf{ signal\+\_\+handler\+::subsys}.



\doxysubsection{Variable Documentation}
\mbox{\label{group__signal_ga2dd2b6ac5a7a35b5c834ccf82361e39b}} 
\index{Intra-\/application signals@{Intra-\/application signals}!tall\_sigh\_ctx@{tall\_sigh\_ctx}}
\index{tall\_sigh\_ctx@{tall\_sigh\_ctx}!Intra-\/application signals@{Intra-\/application signals}}
\doxysubsubsection{tall\_sigh\_ctx}
{\footnotesize\ttfamily void$\ast$ tall\+\_\+sigh\+\_\+ctx}



Referenced by \textbf{ osmo\+\_\+signal\+\_\+register\+\_\+handler()}, and \textbf{ osmo\+\_\+signal\+\_\+talloc\+\_\+ctx\+\_\+init()}.

