\doxysection{control\+\_\+if.\+h}
\label{control__if_8h_source}\index{include/osmocom/ctrl/control\_if.h@{include/osmocom/ctrl/control\_if.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{4 }
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <osmocom/core/write\_queue.h>}}
\DoxyCodeLine{6 \textcolor{preprocessor}{\#include <osmocom/ctrl/control\_cmd.h>}}
\DoxyCodeLine{7 }
\DoxyCodeLine{8 \textcolor{keywordtype}{int} ctrl\_parse\_get\_num(vector vline, \textcolor{keywordtype}{int} i, \textcolor{keywordtype}{long} *num);}
\DoxyCodeLine{9 }
\DoxyCodeLine{10 \textcolor{keyword}{typedef} int (*ctrl\_cmd\_lookup)(\textcolor{keywordtype}{void} *data, vector vline, \textcolor{keywordtype}{int} *node\_type,}
\DoxyCodeLine{11                                 \textcolor{keywordtype}{void} **node\_data, \textcolor{keywordtype}{int} *i);}
\DoxyCodeLine{12 \textcolor{keyword}{typedef} void (*ctrl\_cmd\_reply\_cb)(\textcolor{keyword}{struct }ctrl\_handle *ctrl, \textcolor{keyword}{struct }ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{13 }
\DoxyCodeLine{14 \textcolor{keyword}{struct }ctrl\_handle \{}
\DoxyCodeLine{15         \textcolor{keyword}{struct }osmo\_fd listen\_fd;}
\DoxyCodeLine{16         \textcolor{keywordtype}{void} *data;}
\DoxyCodeLine{17 }
\DoxyCodeLine{18         ctrl\_cmd\_lookup lookup;}
\DoxyCodeLine{19 }
\DoxyCodeLine{20         \textcolor{comment}{/* List of control connections */}}
\DoxyCodeLine{21         \textcolor{keyword}{struct }llist\_head ccon\_list;}
\DoxyCodeLine{22 }
\DoxyCodeLine{23         \textcolor{comment}{/* User defined GET/SET REPLY handler. User can set cmd-\/>defer to 1 in}}
\DoxyCodeLine{24 \textcolor{comment}{           order to own and keep the cmd pointer and free it after the function}}
\DoxyCodeLine{25 \textcolor{comment}{           returns. "{}data"{} param is the user data pointer supplied during}}
\DoxyCodeLine{26 \textcolor{comment}{           ctrl\_handle allocation  */}}
\DoxyCodeLine{27         ctrl\_cmd\_reply\_cb reply\_cb;}
\DoxyCodeLine{28 \};}
\DoxyCodeLine{29 }
\DoxyCodeLine{30 }
\DoxyCodeLine{31 \textcolor{keywordtype}{int} ctrl\_cmd\_send(\textcolor{keyword}{struct} osmo\_wqueue *queue, \textcolor{keyword}{struct} ctrl\_cmd *cmd) OSMO\_DEPRECATED(\textcolor{stringliteral}{"{}Use ctrl\_cmd\_send2() instead."{}});}
\DoxyCodeLine{32 \textcolor{keywordtype}{int} ctrl\_cmd\_send2(\textcolor{keyword}{struct} ctrl\_connection *ccon, \textcolor{keyword}{struct} ctrl\_cmd *cmd);}
\DoxyCodeLine{33 \textcolor{keywordtype}{int} ctrl\_cmd\_send\_trap(\textcolor{keyword}{struct} ctrl\_handle *ctrl, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name, \textcolor{keywordtype}{char} *value);}
\DoxyCodeLine{34 \textcolor{keyword}{struct }ctrl\_handle *ctrl\_handle\_alloc(\textcolor{keywordtype}{void} *ctx, \textcolor{keywordtype}{void} *data, ctrl\_cmd\_lookup lookup);}
\DoxyCodeLine{35 \textcolor{keyword}{struct }ctrl\_handle *ctrl\_handle\_alloc2(\textcolor{keywordtype}{void} *ctx, \textcolor{keywordtype}{void} *data,}
\DoxyCodeLine{36                                        ctrl\_cmd\_lookup lookup,}
\DoxyCodeLine{37                                        \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} node\_count);}
\DoxyCodeLine{38 \textcolor{keyword}{struct }ctrl\_handle *ctrl\_interface\_setup(\textcolor{keywordtype}{void} *data, uint16\_t port,}
\DoxyCodeLine{39                                          ctrl\_cmd\_lookup lookup);}
\DoxyCodeLine{40 \textcolor{keyword}{struct }ctrl\_handle *ctrl\_interface\_setup2(\textcolor{keywordtype}{void} *data, uint16\_t default\_port, ctrl\_cmd\_lookup lookup,}
\DoxyCodeLine{41                                           \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} node\_count);}
\DoxyCodeLine{42 \textcolor{keyword}{struct }ctrl\_handle *ctrl\_interface\_setup\_dynip(\textcolor{keywordtype}{void} *data,}
\DoxyCodeLine{43                                                \textcolor{keyword}{const} \textcolor{keywordtype}{char} *bind\_addr,}
\DoxyCodeLine{44                                                uint16\_t port,}
\DoxyCodeLine{45                                                ctrl\_cmd\_lookup lookup) OSMO\_DEPRECATED\_OUTSIDE\_LIBOSMOCORE;}
\DoxyCodeLine{46 \textcolor{keyword}{struct }ctrl\_handle *ctrl\_interface\_setup\_dynip2(\textcolor{keywordtype}{void} *data,}
\DoxyCodeLine{47                                                 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *bind\_addr,}
\DoxyCodeLine{48                                                 uint16\_t port,}
\DoxyCodeLine{49                                                 ctrl\_cmd\_lookup lookup,}
\DoxyCodeLine{50                                                 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} node\_count) OSMO\_DEPRECATED\_OUTSIDE\_LIBOSMOCORE;}
\DoxyCodeLine{51 \textcolor{keyword}{struct }ctrl\_connection *osmo\_ctrl\_conn\_alloc(\textcolor{keywordtype}{void} *ctx, \textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{52 \textcolor{keywordtype}{int} ctrl\_cmd\_handle(\textcolor{keyword}{struct} ctrl\_handle *ctrl, \textcolor{keyword}{struct} ctrl\_cmd *cmd, \textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{53 \textcolor{keyword}{struct }ctrl\_cmd *ctrl\_cmd\_exec\_from\_string(\textcolor{keyword}{struct} ctrl\_handle *ch, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *cmdstr);}
\DoxyCodeLine{54 }
\DoxyCodeLine{55 \textcolor{keywordtype}{int} ctrl\_lookup\_register(ctrl\_cmd\_lookup lookup);}
\DoxyCodeLine{56 \textcolor{keywordtype}{int} ctrl\_handle\_msg(\textcolor{keyword}{struct} ctrl\_handle *ctrl, \textcolor{keyword}{struct} ctrl\_connection *ccon, \textcolor{keyword}{struct} msgb *msg);}

\end{DoxyCode}
