\doxysection{include/osmocom/ctrl/control\+\_\+cmd.h File Reference}
\label{control__cmd_8h}\index{include/osmocom/ctrl/control\_cmd.h@{include/osmocom/ctrl/control\_cmd.h}}
{\ttfamily \#include $<$osmocom/core/msgb.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/talloc.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/write\+\_\+queue.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/vty/vector.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ ctrl\+\_\+connection}
\begin{DoxyCompactList}\small\item\em Represents a single ctrl connection. \end{DoxyCompactList}\item 
struct \textbf{ ctrl\+\_\+cmd}
\begin{DoxyCompactList}\small\item\em Represents a single ctrl command after parsing. \end{DoxyCompactList}\item 
struct \textbf{ ctrl\+\_\+cmd\+\_\+struct}
\item 
struct \textbf{ ctrl\+\_\+cmd\+\_\+element}
\begin{DoxyCompactList}\small\item\em Implementation of a given CTRL command. \end{DoxyCompactList}\item 
struct \textbf{ ctrl\+\_\+cmd\+\_\+map}
\item 
struct \textbf{ ctrl\+\_\+cmd\+\_\+def}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+ERROR}~-\/1
\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+HANDLED}~0
\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+REPLY}~1
\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+TRAP\+\_\+\+ID}~\char`\"{}0\char`\"{}
\item 
\#define \textbf{ ctrl\+\_\+cmd\+\_\+reply\+\_\+printf}(cmd,  fmt,  args ...)~ \textbf{ osmo\+\_\+talloc\+\_\+asprintf}(cmd, cmd-\/$>$reply, fmt, \#\# args)
\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+STRUCT}(cmdname,  cmdstr,  verify\+\_\+name)
\begin{DoxyCompactList}\small\item\em Helper to generate static struct \doxyref{ctrl\+\_\+cmd\+\_\+element}{p.}{structctrl__cmd__element}. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+HELPER\+\_\+\+GET\+\_\+\+INT}(cmdname,  dtype,  element)
\begin{DoxyCompactList}\small\item\em Helper to generate static GET function for integer. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+HELPER\+\_\+\+SET\+\_\+\+INT}(cmdname,  dtype,  element)
\begin{DoxyCompactList}\small\item\em Helper to generate static SET function for integer. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+HELPER\+\_\+\+VERIFY\+\_\+\+RANGE}(cmdname,  min,  max)
\begin{DoxyCompactList}\small\item\em Helper to generate static VERIFY unction validating a numeric range. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+RANGE}(cmdname,  cmdstr,  dtype,  element,  min,  max)
\begin{DoxyCompactList}\small\item\em Helper to generate GET, SET, VERIFY + \doxyref{ctrl\+\_\+cmd\+\_\+element}{p.}{structctrl__cmd__element} for integer. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+HELPER\+\_\+\+GET\+\_\+\+STRING}(cmdname,  dtype,  element)
\begin{DoxyCompactList}\small\item\em Helper to generate static GET function for string. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+HELPER\+\_\+\+SET\+\_\+\+STRING}(cmdname,  dtype,  element)
\begin{DoxyCompactList}\small\item\em Helper to generate static SET function for string. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+STRING}(cmdname,  cmdstr,  dtype,  element)
\begin{DoxyCompactList}\small\item\em Helper to generate GET, SET, VERIFY + \doxyref{ctrl\+\_\+cmd\+\_\+element}{p.}{structctrl__cmd__element} for string. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+DEFINE}(cmdname,  cmdstr)
\begin{DoxyCompactList}\small\item\em Declare a read-\/write attribute. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+RO}(cmdname,  cmdstr)
\begin{DoxyCompactList}\small\item\em Define a read-\/only attribute. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+WO}(cmdname,  cmdstr)
\begin{DoxyCompactList}\small\item\em Define a write-\/only attribute. \end{DoxyCompactList}\item 
\#define \textbf{ CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+WO\+\_\+\+NOVRF}(cmdname,  cmdstr)
\begin{DoxyCompactList}\small\item\em Define a write-\/only attribute without verify. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ ctrl\+\_\+node\+\_\+type} \{ \newline
\textbf{ CTRL\+\_\+\+NODE\+\_\+\+ROOT}
, \newline
\textbf{ CTRL\+\_\+\+NODE\+\_\+\+BTS}
, \newline
\textbf{ CTRL\+\_\+\+NODE\+\_\+\+TRX}
, \newline
\textbf{ CTRL\+\_\+\+NODE\+\_\+\+TS}
, \newline
\textbf{ CTRL\+\_\+\+NODE\+\_\+\+FSM}
, \newline
\textbf{ CTRL\+\_\+\+NODE\+\_\+\+FSM\+\_\+\+INST}
, \newline
\textbf{ CTRL\+\_\+\+NODE\+\_\+\+LCHAN}
, \newline
\textbf{ \+\_\+\+LAST\+\_\+\+CTRL\+\_\+\+NODE}
 \}
\begin{DoxyCompactList}\small\item\em The class of node at which a ctrl command is registered to. \end{DoxyCompactList}\item 
enum \textbf{ ctrl\+\_\+type} \{ \newline
\textbf{ CTRL\+\_\+\+TYPE\+\_\+\+UNKNOWN}
, \newline
\textbf{ CTRL\+\_\+\+TYPE\+\_\+\+GET}
, \newline
\textbf{ CTRL\+\_\+\+TYPE\+\_\+\+SET}
, \newline
\textbf{ CTRL\+\_\+\+TYPE\+\_\+\+GET\+\_\+\+REPLY}
, \newline
\textbf{ CTRL\+\_\+\+TYPE\+\_\+\+SET\+\_\+\+REPLY}
, \newline
\textbf{ CTRL\+\_\+\+TYPE\+\_\+\+TRAP}
, \newline
\textbf{ CTRL\+\_\+\+TYPE\+\_\+\+ERROR}
 \}
\begin{DoxyCompactList}\small\item\em Ctrl command types (GET, SET, ...) \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ ctrl\+\_\+cmd\+\_\+def} $\ast$ \textbf{ ctrl\+\_\+cmd\+\_\+def\+\_\+make} (const void $\ast$ctx, struct \textbf{ ctrl\+\_\+cmd} $\ast$cmd, void $\ast$\textbf{ data}, unsigned int secs)
\begin{DoxyCompactList}\small\item\em Build a deferred control command state and keep it the per-\/connection list of deferred commands. \end{DoxyCompactList}\item 
int \textbf{ ctrl\+\_\+cmd\+\_\+def\+\_\+is\+\_\+zombie} (struct \textbf{ ctrl\+\_\+cmd\+\_\+def} $\ast$cd)
\begin{DoxyCompactList}\small\item\em Determine if the given deferred control command is still alive or a zombie. \end{DoxyCompactList}\item 
int \textbf{ ctrl\+\_\+cmd\+\_\+def\+\_\+send} (struct \textbf{ ctrl\+\_\+cmd\+\_\+def} $\ast$cd)
\begin{DoxyCompactList}\small\item\em Send the response to a deferred ctrl command. \end{DoxyCompactList}\item 
int \textbf{ ctrl\+\_\+cmd\+\_\+exec} (\textbf{ vector} vline, struct \textbf{ ctrl\+\_\+cmd} $\ast$command, \textbf{ vector} \textbf{ node}, void $\ast$\textbf{ data})
\begin{DoxyCompactList}\small\item\em Execute a given received command. \end{DoxyCompactList}\item 
int \textbf{ ctrl\+\_\+cmd\+\_\+install} (enum \textbf{ ctrl\+\_\+node\+\_\+type} \textbf{ node}, struct \textbf{ ctrl\+\_\+cmd\+\_\+element} $\ast$cmd)
\begin{DoxyCompactList}\small\item\em Install a given command definition at a given CTRL node. \end{DoxyCompactList}\item 
int \textbf{ ctrl\+\_\+cmd\+\_\+send} (struct \textbf{ osmo\+\_\+wqueue} $\ast$queue, struct \textbf{ ctrl\+\_\+cmd} $\ast$cmd)
\begin{DoxyCompactList}\small\item\em Encode a CTRL command and append it to the given \doxyref{ctrl\+\_\+connection}{p.}{structctrl__connection}. \end{DoxyCompactList}\item 
int \textbf{ ctrl\+\_\+cmd\+\_\+send\+\_\+to\+\_\+all} (struct \textbf{ ctrl\+\_\+handle} $\ast$ctrl, struct \textbf{ ctrl\+\_\+cmd} $\ast$cmd)
\begin{DoxyCompactList}\small\item\em Send a CTRL command to all connections. \end{DoxyCompactList}\item 
struct \textbf{ ctrl\+\_\+cmd} $\ast$ \textbf{ ctrl\+\_\+cmd\+\_\+parse3} (void $\ast$ctx, struct \textbf{ msgb} $\ast$\textbf{ msg}, bool $\ast$parse\+\_\+failed)
\begin{DoxyCompactList}\small\item\em Parse/\+Decode CTRL from \textbf{ Message buffers} into command struct. \end{DoxyCompactList}\item 
struct \textbf{ ctrl\+\_\+cmd} $\ast$ \textbf{ ctrl\+\_\+cmd\+\_\+parse2} (void $\ast$ctx, struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em Parse/\+Decode CTRL from \textbf{ Message buffers} into command struct. \end{DoxyCompactList}\item 
struct \textbf{ ctrl\+\_\+cmd} $\ast$ \textbf{ ctrl\+\_\+cmd\+\_\+parse} (void $\ast$ctx, struct \textbf{ msgb} $\ast$\textbf{ msg})
\begin{DoxyCompactList}\small\item\em Parse/\+Decode CTRL from \textbf{ Message buffers} into command struct. \end{DoxyCompactList}\item 
struct \textbf{ msgb} $\ast$ \textbf{ ctrl\+\_\+cmd\+\_\+make} (struct \textbf{ ctrl\+\_\+cmd} $\ast$cmd)
\begin{DoxyCompactList}\small\item\em Encode a given CTRL command from its parsed form into a message buffer. \end{DoxyCompactList}\item 
struct \textbf{ ctrl\+\_\+cmd} $\ast$ \textbf{ ctrl\+\_\+cmd\+\_\+cpy} (void $\ast$ctx, struct \textbf{ ctrl\+\_\+cmd} $\ast$cmd)
\begin{DoxyCompactList}\small\item\em Perform a deepl copy of the given {\itshape cmd}, allocating memory from {\itshape ctx}. \end{DoxyCompactList}\item 
struct \textbf{ ctrl\+\_\+cmd} $\ast$ \textbf{ ctrl\+\_\+cmd\+\_\+create} (void $\ast$ctx, enum \textbf{ ctrl\+\_\+type})
\begin{DoxyCompactList}\small\item\em Allocate a control command of given {\itshape type}. \end{DoxyCompactList}\item 
struct \textbf{ ctrl\+\_\+cmd} $\ast$ \textbf{ ctrl\+\_\+cmd\+\_\+trap} (struct \textbf{ ctrl\+\_\+cmd} $\ast$cmd)
\begin{DoxyCompactList}\small\item\em Copy given {\itshape cmd} and convert copy to CTRL\+\_\+\+TYPE\+\_\+\+TRAP. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const struct \textbf{ value\+\_\+string} \textbf{ ctrl\+\_\+type\+\_\+vals} [$\,$]
\begin{DoxyCompactList}\small\item\em human-\/readable string names for \doxyref{ctrl\+\_\+type}{p.}{control__cmd_8h_a009b994cda9bda0f88e892ba1234794c} \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Macro Definition Documentation}
\mbox{\label{control__cmd_8h_ac49196b5a8a8eddd47e1891137b4444b}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_DEFINE@{CTRL\_CMD\_DEFINE}}
\index{CTRL\_CMD\_DEFINE@{CTRL\_CMD\_DEFINE}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_DEFINE}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+DEFINE(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{cmdstr }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int} get\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *data); \(\backslash\)}
\DoxyCodeLine{static \textcolor{keywordtype}{int} set\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *data); \(\backslash\)}
\DoxyCodeLine{static \textcolor{keywordtype}{int} verify\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *value, \textcolor{keywordtype}{void} *data); \(\backslash\)}
\DoxyCodeLine{CTRL\_CMD\_DEFINE\_STRUCT(cmdname, cmdstr, verify\_\#\#cmdname)}

\end{DoxyCode}


Declare a read-\/write attribute. 

Declares get, set, verify. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related functions/structures \\
\hline
\mbox{\texttt{ in}}  & {\em cmdstr} & string name exposed on CTRL \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_ab1069475b00a8a804799226caafe7129}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_DEFINE\_RANGE@{CTRL\_CMD\_DEFINE\_RANGE}}
\index{CTRL\_CMD\_DEFINE\_RANGE@{CTRL\_CMD\_DEFINE\_RANGE}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_DEFINE\_RANGE}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+RANGE(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{cmdstr,  }\item[{}]{dtype,  }\item[{}]{element,  }\item[{}]{min,  }\item[{}]{max }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        CTRL\_HELPER\_GET\_INT(cmdname, dtype, element) \(\backslash\)}
\DoxyCodeLine{        CTRL\_HELPER\_SET\_INT(cmdname, dtype, element) \(\backslash\)}
\DoxyCodeLine{        CTRL\_HELPER\_VERIFY\_RANGE(cmdname, min, max) \(\backslash\)}
\DoxyCodeLine{CTRL\_CMD\_DEFINE\_STRUCT(cmdname, cmdstr, verify\_\#\#cmdname)}

\end{DoxyCode}


Helper to generate GET, SET, VERIFY + \doxyref{ctrl\+\_\+cmd\+\_\+element}{p.}{structctrl__cmd__element} for integer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related function \\
\hline
\mbox{\texttt{ in}}  & {\em cmdstr} & string name exposed on CTRL \\
\hline
\mbox{\texttt{ in}}  & {\em dtype} & name of outer struct of user data \\
\hline
\mbox{\texttt{ in}}  & {\em element} & name of field within {\itshape dtype} \\
\hline
\mbox{\texttt{ in}}  & {\em min} & minimum permitted integer value \\
\hline
\mbox{\texttt{ in}}  & {\em max} & maximum permitted integer value \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_a72feedb52ea8520ce2f1c4ea348e3fc3}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_DEFINE\_RO@{CTRL\_CMD\_DEFINE\_RO}}
\index{CTRL\_CMD\_DEFINE\_RO@{CTRL\_CMD\_DEFINE\_RO}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_DEFINE\_RO}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+RO(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{cmdstr }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int} get\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *data);         \(\backslash\)}
\DoxyCodeLine{static \textcolor{keywordtype}{int} set\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *data)  \(\backslash\)}
\DoxyCodeLine{\{                                                                       \(\backslash\)}
\DoxyCodeLine{        cmd-\/>reply = \textcolor{stringliteral}{"{}Read Only attribute"{}};                             \(\backslash\)}
\DoxyCodeLine{        return CTRL\_CMD\_ERROR;                                            \(\backslash\)}
\DoxyCodeLine{\}                                                                       \(\backslash\)}
\DoxyCodeLine{static \textcolor{keywordtype}{int} verify\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *value, \textcolor{keywordtype}{void} *data) \(\backslash\)}
\DoxyCodeLine{\{                                                                       \(\backslash\)}
\DoxyCodeLine{        cmd-\/>reply = \textcolor{stringliteral}{"{}Read Only attribute"{}};                             \(\backslash\)}
\DoxyCodeLine{        return 1;                                                       \(\backslash\)}
\DoxyCodeLine{\}                                                                       \(\backslash\)}
\DoxyCodeLine{CTRL\_CMD\_DEFINE\_STRUCT(cmdname, cmdstr, verify\_\#\#cmdname)}

\end{DoxyCode}


Define a read-\/only attribute. 

Declares get, implements set+verify 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related functions/structures \\
\hline
\mbox{\texttt{ in}}  & {\em cmdstr} & string name exposed on CTRL \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_a3fea588be7ae10aa857754fe45c9b131}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_DEFINE\_STRING@{CTRL\_CMD\_DEFINE\_STRING}}
\index{CTRL\_CMD\_DEFINE\_STRING@{CTRL\_CMD\_DEFINE\_STRING}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_DEFINE\_STRING}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+STRING(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{cmdstr,  }\item[{}]{dtype,  }\item[{}]{element }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        CTRL\_HELPER\_GET\_STRING(cmdname, dtype, element) \(\backslash\)}
\DoxyCodeLine{        CTRL\_HELPER\_SET\_STRING(cmdname, dtype, element) \(\backslash\)}
\DoxyCodeLine{CTRL\_CMD\_DEFINE\_STRUCT(cmdname, cmdstr, NULL)}

\end{DoxyCode}


Helper to generate GET, SET, VERIFY + \doxyref{ctrl\+\_\+cmd\+\_\+element}{p.}{structctrl__cmd__element} for string. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related function \\
\hline
\mbox{\texttt{ in}}  & {\em cmdstr} & string name exposed on CTRL \\
\hline
\mbox{\texttt{ in}}  & {\em dtype} & name of outer struct of user data \\
\hline
\mbox{\texttt{ in}}  & {\em element} & name of field within {\itshape dtype} \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_a5b97c5b76fd5e72a2d427808fa0c7d82}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_DEFINE\_STRUCT@{CTRL\_CMD\_DEFINE\_STRUCT}}
\index{CTRL\_CMD\_DEFINE\_STRUCT@{CTRL\_CMD\_DEFINE\_STRUCT}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_DEFINE\_STRUCT}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+STRUCT(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{cmdstr,  }\item[{}]{verify\+\_\+name }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{struct }ctrl\_cmd\_element cmd\_\#\#cmdname = \{ \(\backslash\)}
\DoxyCodeLine{        .name = cmdstr, \(\backslash\)}
\DoxyCodeLine{        .get = \&get\_\#\#cmdname, \(\backslash\)}
\DoxyCodeLine{        .set = \&set\_\#\#cmdname, \(\backslash\)}
\DoxyCodeLine{        .verify = verify\_name, \(\backslash\)}
\DoxyCodeLine{\}}

\end{DoxyCode}


Helper to generate static struct \doxyref{ctrl\+\_\+cmd\+\_\+element}{p.}{structctrl__cmd__element}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related functions/structures \\
\hline
\mbox{\texttt{ in}}  & {\em cmdstr} & string name exposed on CTRL \\
\hline
\mbox{\texttt{ in}}  & {\em verify\+\_\+name} & full symbol name of verification function \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_a76b891dc1df26e42e620432a9eece027}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_DEFINE\_WO@{CTRL\_CMD\_DEFINE\_WO}}
\index{CTRL\_CMD\_DEFINE\_WO@{CTRL\_CMD\_DEFINE\_WO}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_DEFINE\_WO}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+WO(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{cmdstr }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int} set\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *data);                 \(\backslash\)}
\DoxyCodeLine{static \textcolor{keywordtype}{int} get\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *data)                  \(\backslash\)}
\DoxyCodeLine{\{                                                                               \(\backslash\)}
\DoxyCodeLine{        cmd-\/>reply = \textcolor{stringliteral}{"{}Write Only attribute"{}};                                    \(\backslash\)}
\DoxyCodeLine{        return CTRL\_CMD\_ERROR;                                                    \(\backslash\)}
\DoxyCodeLine{\}                                                                               \(\backslash\)}
\DoxyCodeLine{static \textcolor{keywordtype}{int} verify\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *val, \textcolor{keywordtype}{void} *data);     \(\backslash\)}
\DoxyCodeLine{CTRL\_CMD\_DEFINE\_STRUCT(cmdname, cmdstr, verify\_\#\#cmdname)}

\end{DoxyCode}


Define a write-\/only attribute. 

Declares set+verify, implements read call-\/back 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related functions/structures \\
\hline
\mbox{\texttt{ in}}  & {\em cmdstr} & string name exposed on CTRL \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_a079b6ff00061b40c4d044a830f566dd4}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_DEFINE\_WO\_NOVRF@{CTRL\_CMD\_DEFINE\_WO\_NOVRF}}
\index{CTRL\_CMD\_DEFINE\_WO\_NOVRF@{CTRL\_CMD\_DEFINE\_WO\_NOVRF}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_DEFINE\_WO\_NOVRF}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+DEFINE\+\_\+\+WO\+\_\+\+NOVRF(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{cmdstr }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int} set\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *data);                 \(\backslash\)}
\DoxyCodeLine{static \textcolor{keywordtype}{int} get\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *data)                  \(\backslash\)}
\DoxyCodeLine{\{                                                                               \(\backslash\)}
\DoxyCodeLine{        cmd-\/>reply = \textcolor{stringliteral}{"{}Write Only attribute"{}};                                    \(\backslash\)}
\DoxyCodeLine{        return CTRL\_CMD\_ERROR;                                                    \(\backslash\)}
\DoxyCodeLine{\}                                                                               \(\backslash\)}
\DoxyCodeLine{static \textcolor{keywordtype}{int} verify\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *val, \textcolor{keywordtype}{void} *data)      \(\backslash\)}
\DoxyCodeLine{\{                                                                               \(\backslash\)}
\DoxyCodeLine{        return 0;                                                               \(\backslash\)}
\DoxyCodeLine{\}                                                                               \(\backslash\)}
\DoxyCodeLine{CTRL\_CMD\_DEFINE\_STRUCT(cmdname, cmdstr, verify\_\#\#cmdname)}

\end{DoxyCode}


Define a write-\/only attribute without verify. 

Declares set, implements read+verify 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related functions/structures \\
\hline
\mbox{\texttt{ in}}  & {\em cmdstr} & string name exposed on CTRL \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_ae724fc36815bc4516e2b3bb917d518ed}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_ERROR@{CTRL\_CMD\_ERROR}}
\index{CTRL\_CMD\_ERROR@{CTRL\_CMD\_ERROR}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_ERROR}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+ERROR~-\/1}

\mbox{\label{control__cmd_8h_a0579e2c5ffc95697db56ee8e710d87b7}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_HANDLED@{CTRL\_CMD\_HANDLED}}
\index{CTRL\_CMD\_HANDLED@{CTRL\_CMD\_HANDLED}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_HANDLED}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+HANDLED~0}

\mbox{\label{control__cmd_8h_a9e5d0ebc447dbeab80c38b1dd8acd39a}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_REPLY@{CTRL\_CMD\_REPLY}}
\index{CTRL\_CMD\_REPLY@{CTRL\_CMD\_REPLY}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_REPLY}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+REPLY~1}

\mbox{\label{control__cmd_8h_ab0f8cca36ad580e7b838845dc96d873d}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_reply\_printf@{ctrl\_cmd\_reply\_printf}}
\index{ctrl\_cmd\_reply\_printf@{ctrl\_cmd\_reply\_printf}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_reply\_printf}
{\footnotesize\ttfamily \#define ctrl\+\_\+cmd\+\_\+reply\+\_\+printf(\begin{DoxyParamCaption}\item[{}]{cmd,  }\item[{}]{fmt,  }\item[{}]{args ... }\end{DoxyParamCaption})~ \textbf{ osmo\+\_\+talloc\+\_\+asprintf}(cmd, cmd-\/$>$reply, fmt, \#\# args)}

\mbox{\label{control__cmd_8h_a024b9059db6c4f94792e198d414671ff}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_CMD\_TRAP\_ID@{CTRL\_CMD\_TRAP\_ID}}
\index{CTRL\_CMD\_TRAP\_ID@{CTRL\_CMD\_TRAP\_ID}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_CMD\_TRAP\_ID}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+CMD\+\_\+\+TRAP\+\_\+\+ID~\char`\"{}0\char`\"{}}

\mbox{\label{control__cmd_8h_a1634e0c8b2c846f23b73c090857effee}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_HELPER\_GET\_INT@{CTRL\_HELPER\_GET\_INT}}
\index{CTRL\_HELPER\_GET\_INT@{CTRL\_HELPER\_GET\_INT}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_HELPER\_GET\_INT}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+HELPER\+\_\+\+GET\+\_\+\+INT(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{dtype,  }\item[{}]{element }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int} get\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *\_data) \(\backslash\)}
\DoxyCodeLine{\{ \(\backslash\)}
\DoxyCodeLine{        dtype *node = cmd-\/>node; \(\backslash\)}
\DoxyCodeLine{        cmd-\/>reply = talloc\_asprintf(cmd, \textcolor{stringliteral}{"{}\%i"{}}, node-\/>element); \(\backslash\)}
\DoxyCodeLine{        if (!cmd-\/>reply) \{ \(\backslash\)}
\DoxyCodeLine{                cmd-\/>reply = \textcolor{stringliteral}{"{}OOM"{}}; \(\backslash\)}
\DoxyCodeLine{                return CTRL\_CMD\_ERROR; \(\backslash\)}
\DoxyCodeLine{        \} \(\backslash\)}
\DoxyCodeLine{        return CTRL\_CMD\_REPLY; \(\backslash\)}
\DoxyCodeLine{\}}

\end{DoxyCode}


Helper to generate static GET function for integer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related function \\
\hline
\mbox{\texttt{ in}}  & {\em dtype} & name of outer struct of user data \\
\hline
\mbox{\texttt{ in}}  & {\em element} & name of field within {\itshape dtype} \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_a020f7007788be5e8a93169c048979e1b}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_HELPER\_GET\_STRING@{CTRL\_HELPER\_GET\_STRING}}
\index{CTRL\_HELPER\_GET\_STRING@{CTRL\_HELPER\_GET\_STRING}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_HELPER\_GET\_STRING}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+HELPER\+\_\+\+GET\+\_\+\+STRING(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{dtype,  }\item[{}]{element }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int} get\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *\_data) \(\backslash\)}
\DoxyCodeLine{\{ \(\backslash\)}
\DoxyCodeLine{        dtype *data = cmd-\/>node; \(\backslash\)}
\DoxyCodeLine{        cmd-\/>reply = talloc\_asprintf(cmd, \textcolor{stringliteral}{"{}\%s"{}}, data-\/>element); \(\backslash\)}
\DoxyCodeLine{        if (!cmd-\/>reply) \{ \(\backslash\)}
\DoxyCodeLine{                cmd-\/>reply = \textcolor{stringliteral}{"{}OOM"{}}; \(\backslash\)}
\DoxyCodeLine{                return CTRL\_CMD\_ERROR; \(\backslash\)}
\DoxyCodeLine{        \} \(\backslash\)}
\DoxyCodeLine{        return CTRL\_CMD\_REPLY; \(\backslash\)}
\DoxyCodeLine{\}}

\end{DoxyCode}


Helper to generate static GET function for string. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related function \\
\hline
\mbox{\texttt{ in}}  & {\em dtype} & name of outer struct of user data \\
\hline
\mbox{\texttt{ in}}  & {\em element} & name of field within {\itshape dtype} \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_a121bbaa4ae75e7356292a424ad6a80a8}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_HELPER\_SET\_INT@{CTRL\_HELPER\_SET\_INT}}
\index{CTRL\_HELPER\_SET\_INT@{CTRL\_HELPER\_SET\_INT}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_HELPER\_SET\_INT}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+HELPER\+\_\+\+SET\+\_\+\+INT(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{dtype,  }\item[{}]{element }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int} set\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *\_data) \(\backslash\)}
\DoxyCodeLine{\{ \(\backslash\)}
\DoxyCodeLine{        dtype *node = cmd-\/>node; \(\backslash\)}
\DoxyCodeLine{        int tmp = atoi(cmd-\/>value); \(\backslash\)}
\DoxyCodeLine{        node-\/>element = tmp; \(\backslash\)}
\DoxyCodeLine{        return get\_\#\#cmdname(cmd, \_data); \(\backslash\)}
\DoxyCodeLine{\}}

\end{DoxyCode}


Helper to generate static SET function for integer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related function \\
\hline
\mbox{\texttt{ in}}  & {\em dtype} & name of outer struct of user data \\
\hline
\mbox{\texttt{ in}}  & {\em element} & name of field within {\itshape dtype} \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_a3d7e10e02b48525bd586f433a648cf10}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_HELPER\_SET\_STRING@{CTRL\_HELPER\_SET\_STRING}}
\index{CTRL\_HELPER\_SET\_STRING@{CTRL\_HELPER\_SET\_STRING}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_HELPER\_SET\_STRING}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+HELPER\+\_\+\+SET\+\_\+\+STRING(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{dtype,  }\item[{}]{element }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int} set\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *\_data) \(\backslash\)}
\DoxyCodeLine{\{ \(\backslash\)}
\DoxyCodeLine{        dtype *data = cmd-\/>node; \(\backslash\)}
\DoxyCodeLine{        osmo\_talloc\_replace\_string(cmd-\/>node, \&data-\/>element, cmd-\/>value); \(\backslash\)}
\DoxyCodeLine{        return get\_\#\#cmdname(cmd, \_data); \(\backslash\)}
\DoxyCodeLine{\}}

\end{DoxyCode}


Helper to generate static SET function for string. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related function \\
\hline
\mbox{\texttt{ in}}  & {\em dtype} & name of outer struct of user data \\
\hline
\mbox{\texttt{ in}}  & {\em element} & name of field within {\itshape dtype} \\
\hline
\end{DoxyParams}
\mbox{\label{control__cmd_8h_a6569923825a23455d966369cfb7f6c20}} 
\index{control\_cmd.h@{control\_cmd.h}!CTRL\_HELPER\_VERIFY\_RANGE@{CTRL\_HELPER\_VERIFY\_RANGE}}
\index{CTRL\_HELPER\_VERIFY\_RANGE@{CTRL\_HELPER\_VERIFY\_RANGE}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{CTRL\_HELPER\_VERIFY\_RANGE}
{\footnotesize\ttfamily \#define CTRL\+\_\+\+HELPER\+\_\+\+VERIFY\+\_\+\+RANGE(\begin{DoxyParamCaption}\item[{}]{cmdname,  }\item[{}]{min,  }\item[{}]{max }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int} verify\_\#\#cmdname(\textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *value, \textcolor{keywordtype}{void} *\_data) \(\backslash\)}
\DoxyCodeLine{\{ \(\backslash\)}
\DoxyCodeLine{        int tmp = atoi(value); \(\backslash\)}
\DoxyCodeLine{        if ((tmp >= min)\&\&(tmp <= max)) \{ \(\backslash\)}
\DoxyCodeLine{                return 0; \(\backslash\)}
\DoxyCodeLine{        \} \(\backslash\)}
\DoxyCodeLine{        cmd-\/>reply = \textcolor{stringliteral}{"{}Input not within the range"{}}; \(\backslash\)}
\DoxyCodeLine{        return -\/1; \(\backslash\)}
\DoxyCodeLine{\}}

\end{DoxyCode}


Helper to generate static VERIFY unction validating a numeric range. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmdname} & symbol name of the command related function \\
\hline
\mbox{\texttt{ in}}  & {\em min} & minimum permitted integer value \\
\hline
\mbox{\texttt{ in}}  & {\em max} & maximum permitted integer value \\
\hline
\end{DoxyParams}


\doxysubsection{Enumeration Type Documentation}
\mbox{\label{control__cmd_8h_aacfd6242d4c8eb9d70354cb2d57d5262}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_node\_type@{ctrl\_node\_type}}
\index{ctrl\_node\_type@{ctrl\_node\_type}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_node\_type}
{\footnotesize\ttfamily enum \textbf{ ctrl\+\_\+node\+\_\+type}}



The class of node at which a ctrl command is registered to. 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_NODE\_ROOT@{CTRL\_NODE\_ROOT}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_NODE\_ROOT@{CTRL\_NODE\_ROOT}}}\mbox{\label{control__cmd_8h_aacfd6242d4c8eb9d70354cb2d57d5262a1106cc92b48ad0d4c92cc58d4287be47}} 
CTRL\+\_\+\+NODE\+\_\+\+ROOT&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_NODE\_BTS@{CTRL\_NODE\_BTS}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_NODE\_BTS@{CTRL\_NODE\_BTS}}}\mbox{\label{control__cmd_8h_aacfd6242d4c8eb9d70354cb2d57d5262abda9ca7f05c4c8572e6e669f72136702}} 
CTRL\+\_\+\+NODE\+\_\+\+BTS&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_NODE\_TRX@{CTRL\_NODE\_TRX}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_NODE\_TRX@{CTRL\_NODE\_TRX}}}\mbox{\label{control__cmd_8h_aacfd6242d4c8eb9d70354cb2d57d5262aad8d2933935f5f415c31d9947ba23dd2}} 
CTRL\+\_\+\+NODE\+\_\+\+TRX&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_NODE\_TS@{CTRL\_NODE\_TS}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_NODE\_TS@{CTRL\_NODE\_TS}}}\mbox{\label{control__cmd_8h_aacfd6242d4c8eb9d70354cb2d57d5262a944de79edb8a69eda08184c67e86eef3}} 
CTRL\+\_\+\+NODE\+\_\+\+TS&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_NODE\_FSM@{CTRL\_NODE\_FSM}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_NODE\_FSM@{CTRL\_NODE\_FSM}}}\mbox{\label{control__cmd_8h_aacfd6242d4c8eb9d70354cb2d57d5262a8756180d0bec610c55b842558b03b8cd}} 
CTRL\+\_\+\+NODE\+\_\+\+FSM&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_NODE\_FSM\_INST@{CTRL\_NODE\_FSM\_INST}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_NODE\_FSM\_INST@{CTRL\_NODE\_FSM\_INST}}}\mbox{\label{control__cmd_8h_aacfd6242d4c8eb9d70354cb2d57d5262ada57f99890f5a474f9042bcc4a9a1e98}} 
CTRL\+\_\+\+NODE\+\_\+\+FSM\+\_\+\+INST&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_NODE\_LCHAN@{CTRL\_NODE\_LCHAN}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_NODE\_LCHAN@{CTRL\_NODE\_LCHAN}}}\mbox{\label{control__cmd_8h_aacfd6242d4c8eb9d70354cb2d57d5262a652d3c2e3de365c8b092920fe81f024f}} 
CTRL\+\_\+\+NODE\+\_\+\+LCHAN&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{\_LAST\_CTRL\_NODE@{\_LAST\_CTRL\_NODE}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!\_LAST\_CTRL\_NODE@{\_LAST\_CTRL\_NODE}}}\mbox{\label{control__cmd_8h_aacfd6242d4c8eb9d70354cb2d57d5262a670aff75655b1cd14077e3538a89cf3b}} 
\+\_\+\+LAST\+\_\+\+CTRL\+\_\+\+NODE&\\
\hline

\end{DoxyEnumFields}
\mbox{\label{control__cmd_8h_a009b994cda9bda0f88e892ba1234794c}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_type@{ctrl\_type}}
\index{ctrl\_type@{ctrl\_type}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_type}
{\footnotesize\ttfamily enum \textbf{ ctrl\+\_\+type}}



Ctrl command types (GET, SET, ...) 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_TYPE\_UNKNOWN@{CTRL\_TYPE\_UNKNOWN}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_TYPE\_UNKNOWN@{CTRL\_TYPE\_UNKNOWN}}}\mbox{\label{control__cmd_8h_a009b994cda9bda0f88e892ba1234794cadfe85fecfe07de1ba2de6afc90cfa96d}} 
CTRL\+\_\+\+TYPE\+\_\+\+UNKNOWN&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_TYPE\_GET@{CTRL\_TYPE\_GET}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_TYPE\_GET@{CTRL\_TYPE\_GET}}}\mbox{\label{control__cmd_8h_a009b994cda9bda0f88e892ba1234794ca728b60565ea5287cccf4e4be62943e46}} 
CTRL\+\_\+\+TYPE\+\_\+\+GET&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_TYPE\_SET@{CTRL\_TYPE\_SET}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_TYPE\_SET@{CTRL\_TYPE\_SET}}}\mbox{\label{control__cmd_8h_a009b994cda9bda0f88e892ba1234794ca4bf33d7a646cab7d32fab9f4ea47cc9f}} 
CTRL\+\_\+\+TYPE\+\_\+\+SET&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_TYPE\_GET\_REPLY@{CTRL\_TYPE\_GET\_REPLY}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_TYPE\_GET\_REPLY@{CTRL\_TYPE\_GET\_REPLY}}}\mbox{\label{control__cmd_8h_a009b994cda9bda0f88e892ba1234794ca326f5b828d845b72fe1c3f8707cb441e}} 
CTRL\+\_\+\+TYPE\+\_\+\+GET\+\_\+\+REPLY&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_TYPE\_SET\_REPLY@{CTRL\_TYPE\_SET\_REPLY}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_TYPE\_SET\_REPLY@{CTRL\_TYPE\_SET\_REPLY}}}\mbox{\label{control__cmd_8h_a009b994cda9bda0f88e892ba1234794ca40ef5c72f75f897ab5adc4c594e61935}} 
CTRL\+\_\+\+TYPE\+\_\+\+SET\+\_\+\+REPLY&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_TYPE\_TRAP@{CTRL\_TYPE\_TRAP}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_TYPE\_TRAP@{CTRL\_TYPE\_TRAP}}}\mbox{\label{control__cmd_8h_a009b994cda9bda0f88e892ba1234794caf86abcdb494dda5b99bbc5d1b59486c3}} 
CTRL\+\_\+\+TYPE\+\_\+\+TRAP&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{CTRL\_TYPE\_ERROR@{CTRL\_TYPE\_ERROR}!control\_cmd.h@{control\_cmd.h}}\index{control\_cmd.h@{control\_cmd.h}!CTRL\_TYPE\_ERROR@{CTRL\_TYPE\_ERROR}}}\mbox{\label{control__cmd_8h_a009b994cda9bda0f88e892ba1234794ca3d58b4b22596e5092158f6717d7ac77f}} 
CTRL\+\_\+\+TYPE\+\_\+\+ERROR&\\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\mbox{\label{control__cmd_8h_aa976d38595380ba6259ca535b019fa65}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_cpy@{ctrl\_cmd\_cpy}}
\index{ctrl\_cmd\_cpy@{ctrl\_cmd\_cpy}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_cpy()}
{\footnotesize\ttfamily struct \textbf{ ctrl\+\_\+cmd} $\ast$ ctrl\+\_\+cmd\+\_\+cpy (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{struct \textbf{ ctrl\+\_\+cmd} $\ast$}]{cmd }\end{DoxyParamCaption})}



Perform a deepl copy of the given {\itshape cmd}, allocating memory from {\itshape ctx}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & talloc context from which to allocate \\
\hline
 & {\em \mbox{[}in} & cmd CTRL command to be copied \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
deep copy of {\itshape cmd} on success; NULL on error 
\end{DoxyReturn}


References \textbf{ ctrl\+\_\+cmd\+::id}, \textbf{ ctrl\+\_\+cmd\+::reply}, \textbf{ ctrl\+\_\+cmd\+::type}, \textbf{ ctrl\+\_\+cmd\+::value}, and \textbf{ ctrl\+\_\+cmd\+::variable}.



Referenced by \textbf{ ctrl\+\_\+cmd\+\_\+trap()}.

\mbox{\label{control__cmd_8h_a25bcde3e5e3c486fd81b810a6e825dbb}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_create@{ctrl\_cmd\_create}}
\index{ctrl\_cmd\_create@{ctrl\_cmd\_create}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_create()}
{\footnotesize\ttfamily struct \textbf{ ctrl\+\_\+cmd} $\ast$ ctrl\+\_\+cmd\+\_\+create (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{enum \textbf{ ctrl\+\_\+type}}]{type }\end{DoxyParamCaption})}



Allocate a control command of given {\itshape type}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & talloc context from which to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em type} & command type to set after allocation \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
callee-\/allocated \doxyref{ctrl\+\_\+cmd}{p.}{structctrl__cmd}. Caller must talloc\+\_\+free() it. 
\end{DoxyReturn}


References \textbf{ type}, and \textbf{ ctrl\+\_\+cmd\+::type}.



Referenced by \textbf{ ctrl\+\_\+cmd\+\_\+send\+\_\+trap()}.

\mbox{\label{control__cmd_8h_a96d3c6021102409885ac6c4a294709ce}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_def\_is\_zombie@{ctrl\_cmd\_def\_is\_zombie}}
\index{ctrl\_cmd\_def\_is\_zombie@{ctrl\_cmd\_def\_is\_zombie}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_def\_is\_zombie()}
{\footnotesize\ttfamily int ctrl\+\_\+cmd\+\_\+def\+\_\+is\+\_\+zombie (\begin{DoxyParamCaption}\item[{struct \textbf{ ctrl\+\_\+cmd\+\_\+def} $\ast$}]{cd }\end{DoxyParamCaption})}



Determine if the given deferred control command is still alive or a zombie. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cd} & deferred ctrl command state \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 is {\itshape cd} is still alive; 1 if it\textquotesingle{}s a zombie 
\end{DoxyReturn}


References \textbf{ ctrl\+\_\+cmd\+\_\+def\+::cmd}, \textbf{ ctrl\+\_\+cmd\+\_\+def\+::list}, and \textbf{ llist\+\_\+del()}.

\mbox{\label{control__cmd_8h_a9e91e86808a88f4b16cc31a1a04e3420}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_def\_make@{ctrl\_cmd\_def\_make}}
\index{ctrl\_cmd\_def\_make@{ctrl\_cmd\_def\_make}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_def\_make()}
{\footnotesize\ttfamily struct \textbf{ ctrl\+\_\+cmd\+\_\+def} $\ast$ ctrl\+\_\+cmd\+\_\+def\+\_\+make (\begin{DoxyParamCaption}\item[{const void $\ast$}]{ctx,  }\item[{struct \textbf{ ctrl\+\_\+cmd} $\ast$}]{cmd,  }\item[{void $\ast$}]{data,  }\item[{unsigned int}]{secs }\end{DoxyParamCaption})}



Build a deferred control command state and keep it the per-\/connection list of deferred commands. 

This function is typically called by a ctrl command handler that wishes to defer returning a response. The reutnred state can later be used to check if the deferred command is still alive, and to respond to the specific command. This only works to defer the response to GET and SET. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & talloc context from whihc to allocate the \doxyref{ctrl\+\_\+cmd\+\_\+def}{p.}{structctrl__cmd__def} \\
\hline
\mbox{\texttt{ in}}  & {\em cmd} & the control command whose response is deferred \\
\hline
\mbox{\texttt{ in}}  & {\em data} & opaque, user-\/defined pointer \\
\hline
\mbox{\texttt{ in}}  & {\em secs} & number of seconds until the command times out \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
callee-\/allocated \doxyref{ctrl\+\_\+cmd\+\_\+def}{p.}{structctrl__cmd__def} 
\end{DoxyReturn}


References \textbf{ ctrl\+\_\+cmd\+::ccon}, \textbf{ ctrl\+\_\+cmd\+\_\+def\+::cmd}, \textbf{ data}, \textbf{ ctrl\+\_\+cmd\+\_\+def\+::data}, \textbf{ ctrl\+\_\+connection\+::def\+\_\+cmds}, \textbf{ ctrl\+\_\+cmd\+::defer}, \textbf{ ctrl\+\_\+cmd\+\_\+def\+::list}, and \textbf{ llist\+\_\+add()}.

\mbox{\label{control__cmd_8h_aa6ec2019f953a82284534fdc8d04dc46}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_def\_send@{ctrl\_cmd\_def\_send}}
\index{ctrl\_cmd\_def\_send@{ctrl\_cmd\_def\_send}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_def\_send()}
{\footnotesize\ttfamily int ctrl\+\_\+cmd\+\_\+def\+\_\+send (\begin{DoxyParamCaption}\item[{struct \textbf{ ctrl\+\_\+cmd\+\_\+def} $\ast$}]{cd }\end{DoxyParamCaption})}



Send the response to a deferred ctrl command. 

The command can only be a resply to a SET or a GET operation. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cd} & deferred ctrl command state \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if command sent successfully; negative on error 
\end{DoxyReturn}


References \textbf{ ctrl\+\_\+cmd\+::ccon}, \textbf{ ctrl\+\_\+cmd\+\_\+def\+::cmd}, \textbf{ ctrl\+\_\+cmd\+\_\+send2()}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+ERROR}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+GET}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+GET\+\_\+\+REPLY}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+SET}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+SET\+\_\+\+REPLY}, \textbf{ ctrl\+\_\+cmd\+\_\+def\+::list}, \textbf{ llist\+\_\+del()}, and \textbf{ ctrl\+\_\+cmd\+::type}.

\mbox{\label{control__cmd_8h_aea6cb8951a026d0689c3499de37dbdec}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_exec@{ctrl\_cmd\_exec}}
\index{ctrl\_cmd\_exec@{ctrl\_cmd\_exec}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_exec()}
{\footnotesize\ttfamily int ctrl\+\_\+cmd\+\_\+exec (\begin{DoxyParamCaption}\item[{\textbf{ vector}}]{vline,  }\item[{struct \textbf{ ctrl\+\_\+cmd} $\ast$}]{command,  }\item[{\textbf{ vector}}]{node,  }\item[{void $\ast$}]{data }\end{DoxyParamCaption})}



Execute a given received command. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em vline} & vector representing the available/registered commands \\
\hline
\mbox{\texttt{ in,out}}  & {\em command} & parsed received command to be executed \\
\hline
\mbox{\texttt{ in}}  & {\em node} & CTRL interface node \\
\hline
\mbox{\texttt{ in}}  & {\em data} & opaque data passed to verify(), get() and set() call-\/backs \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
CTRL\+\_\+\+CMD\+\_\+\+HANDLED or CTRL\+\_\+\+CMD\+\_\+\+REPLY; CTRL\+\_\+\+CMD\+\_\+\+ERROR on error 
\end{DoxyReturn}


References \textbf{ CTRL\+\_\+\+CMD\+\_\+\+ERROR}, \textbf{ ctrl\+\_\+cmd\+\_\+get\+\_\+element\+\_\+match()}, \textbf{ CTRL\+\_\+\+CMD\+\_\+\+REPLY}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+ERROR}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+GET}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+GET\+\_\+\+REPLY}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+SET}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+SET\+\_\+\+REPLY}, \textbf{ data}, \textbf{ ctrl\+\_\+cmd\+\_\+element\+::get}, \textbf{ node}, \textbf{ ctrl\+\_\+cmd\+::reply}, \textbf{ ctrl\+\_\+cmd\+\_\+element\+::set}, \textbf{ ctrl\+\_\+cmd\+::type}, \textbf{ ctrl\+\_\+cmd\+::value}, and \textbf{ ctrl\+\_\+cmd\+\_\+element\+::verify}.



Referenced by \textbf{ ctrl\+\_\+cmd\+\_\+handle()}.

\mbox{\label{control__cmd_8h_ad7e673e111a7a19c6a2467674fd825b1}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_install@{ctrl\_cmd\_install}}
\index{ctrl\_cmd\_install@{ctrl\_cmd\_install}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_install()}
{\footnotesize\ttfamily int ctrl\+\_\+cmd\+\_\+install (\begin{DoxyParamCaption}\item[{enum \textbf{ ctrl\+\_\+node\+\_\+type}}]{node,  }\item[{struct \textbf{ ctrl\+\_\+cmd\+\_\+element} $\ast$}]{cmd }\end{DoxyParamCaption})}



Install a given command definition at a given CTRL node. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em node} & CTRL node at which {\itshape cmd} is to be installed \\
\hline
\mbox{\texttt{ in}}  & {\em cmd} & command definition to be installed \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success; negative on error 
\end{DoxyReturn}


References \textbf{ create\+\_\+cmd\+\_\+struct()}, \textbf{ ctrl\+\_\+node\+\_\+vec}, \textbf{ DLCTRL}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGP}, \textbf{ ctrl\+\_\+cmd\+\_\+element\+::name}, \textbf{ node}, \textbf{ ctrl\+\_\+cmd\+\_\+element\+::strcmd}, \textbf{ vector\+\_\+init()}, \textbf{ vector\+\_\+lookup\+\_\+ensure()}, \textbf{ vector\+\_\+set()}, and \textbf{ vector\+\_\+set\+\_\+index()}.



Referenced by \textbf{ ctrl\+\_\+init()}, and \textbf{ osmo\+\_\+fsm\+\_\+ctrl\+\_\+cmds\+\_\+install()}.

\mbox{\label{control__cmd_8h_a3b1dd88cc91fb544488b6f4916130fab}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_make@{ctrl\_cmd\_make}}
\index{ctrl\_cmd\_make@{ctrl\_cmd\_make}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_make()}
{\footnotesize\ttfamily struct \textbf{ msgb} $\ast$ ctrl\+\_\+cmd\+\_\+make (\begin{DoxyParamCaption}\item[{struct \textbf{ ctrl\+\_\+cmd} $\ast$}]{cmd }\end{DoxyParamCaption})}



Encode a given CTRL command from its parsed form into a message buffer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmd} & decoded/parsed form of to-\/be-\/encoded command \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
callee-\/allocated message buffer containing the encoded {\itshape cmd}; NULL on error 
\end{DoxyReturn}


References \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+ERROR}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+GET}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+GET\+\_\+\+REPLY}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+SET}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+SET\+\_\+\+REPLY}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+TRAP}, \textbf{ ctrl\+\_\+type\+\_\+vals}, \textbf{ DLCTRL}, \textbf{ get\+\_\+value\+\_\+string()}, \textbf{ ctrl\+\_\+cmd\+::id}, \textbf{ len()}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGL\+\_\+\+NOTICE}, \textbf{ LOGP}, \textbf{ msg}, \textbf{ msgb\+\_\+alloc\+\_\+headroom()}, \textbf{ msgb\+\_\+put()}, \textbf{ ctrl\+\_\+cmd\+::reply}, \textbf{ type}, \textbf{ ctrl\+\_\+cmd\+::type}, \textbf{ ctrl\+\_\+cmd\+::value}, and \textbf{ ctrl\+\_\+cmd\+::variable}.



Referenced by \textbf{ ctrl\+\_\+cmd\+\_\+send2()}.

\mbox{\label{control__cmd_8h_a1fb1544dc2399710a88db9654e6978eb}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_parse@{ctrl\_cmd\_parse}}
\index{ctrl\_cmd\_parse@{ctrl\_cmd\_parse}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_parse()}
{\footnotesize\ttfamily struct \textbf{ ctrl\+\_\+cmd} $\ast$ ctrl\+\_\+cmd\+\_\+parse (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{struct \textbf{ msgb} $\ast$}]{msg }\end{DoxyParamCaption})}



Parse/\+Decode CTRL from \textbf{ Message buffers} into command struct. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & talloc context from which to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em msg} & message buffer containing command to be decoded \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
callee-\/allocated decoded CTRL command; NULL on allocation or other failure The caller is responsible to talloc\+\_\+free() the returned struct pointer. 
\end{DoxyReturn}


References \textbf{ ctrl\+\_\+cmd\+\_\+parse2()}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+ERROR}, \textbf{ msg}, and \textbf{ res}.

\mbox{\label{control__cmd_8h_aab5c1fbea4b0a20f82af32194d390e76}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_parse2@{ctrl\_cmd\_parse2}}
\index{ctrl\_cmd\_parse2@{ctrl\_cmd\_parse2}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_parse2()}
{\footnotesize\ttfamily struct \textbf{ ctrl\+\_\+cmd} $\ast$ ctrl\+\_\+cmd\+\_\+parse2 (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{struct \textbf{ msgb} $\ast$}]{msg }\end{DoxyParamCaption})}



Parse/\+Decode CTRL from \textbf{ Message buffers} into command struct. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & talloc context from which to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em msg} & message buffer containing command to be decoded \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
callee-\/allocated decoded CTRL command; NULL on allocation failure, ctrl-\/$>$type == CTRL\+\_\+\+TYPE\+\_\+\+ERROR and an error message in ctrl-\/$>$reply on any error. The caller is responsible to talloc\+\_\+free() the returned struct pointer. If information of the origin of the ERROR cmd returned is required (received or local parsing failure), use \doxyref{ctrl\+\_\+cmd\+\_\+parse3}{p.}{control__cmd_8c_a52caa313b2ff6ffdce5392259dcf1125} instead. 
\end{DoxyReturn}


References \textbf{ ctrl\+\_\+cmd\+\_\+parse3()}, and \textbf{ msg}.



Referenced by \textbf{ ctrl\+\_\+cmd\+\_\+exec\+\_\+from\+\_\+string()}, and \textbf{ ctrl\+\_\+cmd\+\_\+parse()}.

\mbox{\label{control__cmd_8h_a52caa313b2ff6ffdce5392259dcf1125}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_parse3@{ctrl\_cmd\_parse3}}
\index{ctrl\_cmd\_parse3@{ctrl\_cmd\_parse3}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_parse3()}
{\footnotesize\ttfamily struct \textbf{ ctrl\+\_\+cmd} $\ast$ ctrl\+\_\+cmd\+\_\+parse3 (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{bool $\ast$}]{parse\+\_\+failed }\end{DoxyParamCaption})}



Parse/\+Decode CTRL from \textbf{ Message buffers} into command struct. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & talloc context from which to allocate \\
\hline
\mbox{\texttt{ in}}  & {\em msg} & message buffer containing command to be decoded \\
\hline
\mbox{\texttt{ out}}  & {\em parse\+\_\+failed} & Whether returned ERROR cmd was generatd locally (due to parse failure) or was received. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
callee-\/allocated decoded CTRL command; NULL on allocation failure, ctrl-\/$>$type == CTRL\+\_\+\+TYPE\+\_\+\+ERROR and an error message in ctrl-\/$>$reply on any error. The caller is responsible to talloc\+\_\+free() the returned struct pointer. 
\end{DoxyReturn}


References \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+ERROR}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+GET}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+GET\+\_\+\+REPLY}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+SET}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+SET\+\_\+\+REPLY}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+TRAP}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+UNKNOWN}, \textbf{ ctrl\+\_\+type\+\_\+vals}, \textbf{ DLCTRL}, \textbf{ get\+\_\+string\+\_\+value()}, \textbf{ get\+\_\+value\+\_\+string()}, \textbf{ ctrl\+\_\+cmd\+::id}, \textbf{ id\+\_\+str\+\_\+valid()}, \textbf{ LOGL\+\_\+\+DEBUG}, \textbf{ LOGL\+\_\+\+ERROR}, \textbf{ LOGL\+\_\+\+NOTICE}, \textbf{ LOGP}, \textbf{ msg}, \textbf{ msgb\+\_\+put\+\_\+u8()}, \textbf{ OSMO\+\_\+\+ASSERT}, \textbf{ osmo\+\_\+escape\+\_\+str()}, \textbf{ osmo\+\_\+separated\+\_\+identifiers\+\_\+valid()}, \textbf{ ctrl\+\_\+cmd\+::reply}, \textbf{ REPLY\+\_\+\+CASE}, \textbf{ ctrl\+\_\+cmd\+::type}, \textbf{ ctrl\+\_\+cmd\+::value}, and \textbf{ ctrl\+\_\+cmd\+::variable}.



Referenced by \textbf{ ctrl\+\_\+cmd\+\_\+parse2()}, and \textbf{ ctrl\+\_\+handle\+\_\+msg()}.

\mbox{\label{control__cmd_8h_ac556c96fd7df0ee6a5ea3c3826bd037e}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_send@{ctrl\_cmd\_send}}
\index{ctrl\_cmd\_send@{ctrl\_cmd\_send}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_send()}
{\footnotesize\ttfamily int ctrl\+\_\+cmd\+\_\+send (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+wqueue} $\ast$}]{queue,  }\item[{struct \textbf{ ctrl\+\_\+cmd} $\ast$}]{cmd }\end{DoxyParamCaption})}



Encode a CTRL command and append it to the given \doxyref{ctrl\+\_\+connection}{p.}{structctrl__connection}. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em queue} & write queue to which encoded {\itshape cmd} shall be appended \\
\hline
\mbox{\texttt{ in}}  & {\em cmd} & decoded command representation \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 in case of success; negative on error 
\end{DoxyReturn}


References \textbf{ container\+\_\+of}, \textbf{ ctrl\+\_\+cmd\+\_\+send2()}, and \textbf{ ctrl\+\_\+connection\+::write\+\_\+queue}.

\mbox{\label{control__cmd_8h_a68a762ce294f8c17c41fca2410df76b5}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_send\_to\_all@{ctrl\_cmd\_send\_to\_all}}
\index{ctrl\_cmd\_send\_to\_all@{ctrl\_cmd\_send\_to\_all}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_send\_to\_all()}
{\footnotesize\ttfamily int ctrl\+\_\+cmd\+\_\+send\+\_\+to\+\_\+all (\begin{DoxyParamCaption}\item[{struct \textbf{ ctrl\+\_\+handle} $\ast$}]{ctrl,  }\item[{struct \textbf{ ctrl\+\_\+cmd} $\ast$}]{cmd }\end{DoxyParamCaption})}



Send a CTRL command to all connections. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctrl} & global control handle \\
\hline
\mbox{\texttt{ in}}  & {\em cmd} & command to send to all connections in ctrl \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of times the command has been sent 
\end{DoxyReturn}


References \textbf{ ctrl\+\_\+cmd\+::ccon}, \textbf{ ctrl\+\_\+handle\+::ccon\+\_\+list}, \textbf{ ctrl\+\_\+cmd\+\_\+send2()}, \textbf{ ctrl\+\_\+connection\+::list\+\_\+entry}, and \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}.



Referenced by \textbf{ ctrl\+\_\+cmd\+\_\+send\+\_\+trap()}.

\mbox{\label{control__cmd_8h_a28ccd4b19057b05c2af8ff6372c53d7a}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_cmd\_trap@{ctrl\_cmd\_trap}}
\index{ctrl\_cmd\_trap@{ctrl\_cmd\_trap}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_cmd\_trap()}
{\footnotesize\ttfamily struct \textbf{ ctrl\+\_\+cmd} $\ast$ ctrl\+\_\+cmd\+\_\+trap (\begin{DoxyParamCaption}\item[{struct \textbf{ ctrl\+\_\+cmd} $\ast$}]{cmd }\end{DoxyParamCaption})}



Copy given {\itshape cmd} and convert copy to CTRL\+\_\+\+TYPE\+\_\+\+TRAP. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cmd} & command to be copied \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to newly-\/allocated copy of type TRAP. Allocated as sibling of {\itshape cmd} 
\end{DoxyReturn}


References \textbf{ ctrl\+\_\+cmd\+::ccon}, \textbf{ ctrl\+\_\+cmd\+\_\+cpy()}, \textbf{ CTRL\+\_\+\+TYPE\+\_\+\+TRAP}, and \textbf{ ctrl\+\_\+cmd\+::type}.



\doxysubsection{Variable Documentation}
\mbox{\label{control__cmd_8h_a6795a9d1de9572b4a6de18b7ca3cdcc8}} 
\index{control\_cmd.h@{control\_cmd.h}!ctrl\_type\_vals@{ctrl\_type\_vals}}
\index{ctrl\_type\_vals@{ctrl\_type\_vals}!control\_cmd.h@{control\_cmd.h}}
\doxysubsubsection{ctrl\_type\_vals}
{\footnotesize\ttfamily const struct \textbf{ value\+\_\+string} ctrl\+\_\+type\+\_\+vals[$\,$]\hspace{0.3cm}{\ttfamily [extern]}}



human-\/readable string names for \doxyref{ctrl\+\_\+type}{p.}{control__cmd_8h_a009b994cda9bda0f88e892ba1234794c} 



Referenced by \textbf{ ctrl\+\_\+cmd\+\_\+handle()}, \textbf{ ctrl\+\_\+cmd\+\_\+make()}, \textbf{ ctrl\+\_\+cmd\+\_\+parse3()}, and \textbf{ ctrl\+\_\+handle\+\_\+msg()}.

