\doxysection{include/osmocom/vty/misc.h File Reference}
\label{misc_8h}\index{include/osmocom/vty/misc.h@{include/osmocom/vty/misc.h}}
{\ttfamily \#include $<$osmocom/vty/vty.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/rate\+\_\+ctr.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/stat\+\_\+item.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ VTY\+\_\+\+DO\+\_\+\+LOWER}~1
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
char $\ast$ \textbf{ vty\+\_\+cmd\+\_\+string\+\_\+from\+\_\+valstr} (void $\ast$ctx, const struct \textbf{ value\+\_\+string} $\ast$vals, const char $\ast$prefix, const char $\ast$sep, const char $\ast$end, int do\+\_\+lower)
\begin{DoxyCompactList}\small\item\em Generate a VTY command string from \textbf{ value\+\_\+string}. \end{DoxyCompactList}\item 
void \textbf{ vty\+\_\+out\+\_\+rate\+\_\+ctr\+\_\+group} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg)
\item 
void \textbf{ vty\+\_\+out\+\_\+rate\+\_\+ctr\+\_\+group2} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg, bool skip\+\_\+zero)
\begin{DoxyCompactList}\small\item\em print a rate counter group to given VTY \end{DoxyCompactList}\item 
void \textbf{ vty\+\_\+out\+\_\+rate\+\_\+ctr\+\_\+group\+\_\+fmt} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$fmt, struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg)
\item 
void \textbf{ vty\+\_\+out\+\_\+rate\+\_\+ctr\+\_\+group\+\_\+fmt2} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$fmt, struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg, bool skip\+\_\+zero)
\begin{DoxyCompactList}\small\item\em print a rate counter group to given VTY, formatting the line for each counter according to a format string. \end{DoxyCompactList}\item 
void \textbf{ vty\+\_\+out\+\_\+stat\+\_\+item\+\_\+group} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg)
\item 
void \textbf{ vty\+\_\+out\+\_\+stat\+\_\+item\+\_\+group2} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg, bool skip\+\_\+zero)
\begin{DoxyCompactList}\small\item\em print a stat item group to given VTY \end{DoxyCompactList}\item 
void \textbf{ vty\+\_\+out\+\_\+statistics\+\_\+full} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix)
\item 
void \textbf{ vty\+\_\+out\+\_\+statistics\+\_\+full2} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, bool skip\+\_\+zero)
\item 
void \textbf{ vty\+\_\+out\+\_\+statistics\+\_\+partial} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, int max\+\_\+level)
\item 
void \textbf{ vty\+\_\+out\+\_\+statistics\+\_\+partial2} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, int max\+\_\+level, bool skip\+\_\+zero)
\item 
void \textbf{ vty\+\_\+out\+\_\+fsm} (struct \textbf{ vty} $\ast$\textbf{ vty}, struct \textbf{ osmo\+\_\+fsm} $\ast$fsm)
\begin{DoxyCompactList}\small\item\em Print information about a FSM [class] to the given VTY. \end{DoxyCompactList}\item 
void \textbf{ vty\+\_\+out\+\_\+fsm2} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, struct \textbf{ osmo\+\_\+fsm} $\ast$fsm)
\begin{DoxyCompactList}\small\item\em Print information about a FSM [class] to the given VTY. \end{DoxyCompactList}\item 
void \textbf{ vty\+\_\+out\+\_\+fsm\+\_\+inst} (struct \textbf{ vty} $\ast$\textbf{ vty}, struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$fsmi)
\begin{DoxyCompactList}\small\item\em Print a FSM instance to the given VTY. \end{DoxyCompactList}\item 
void \textbf{ vty\+\_\+out\+\_\+fsm\+\_\+inst2} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$fsmi)
\begin{DoxyCompactList}\small\item\em Print a FSM instance to the given VTY. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+fsm\+\_\+vty\+\_\+add\+\_\+cmds} (void)
\begin{DoxyCompactList}\small\item\em Install VTY commands for FSM introspection This installs a couple of VTY commands for introspection of FSM classes as well as FSM instances. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+talloc\+\_\+vty\+\_\+add\+\_\+cmds} (void)
\begin{DoxyCompactList}\small\item\em Install VTY commands for talloc context introspection. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+vty\+\_\+write\+\_\+config\+\_\+file} (const char $\ast$filename)
\begin{DoxyCompactList}\small\item\em Write the current running config to a given file. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+vty\+\_\+save\+\_\+config\+\_\+file} (void)
\begin{DoxyCompactList}\small\item\em Save the current state to the config file. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Macro Definition Documentation}
\mbox{\label{misc_8h_ad11aa2532b0ac9f5ea24c1e398f746da}} 
\index{misc.h@{misc.h}!VTY\_DO\_LOWER@{VTY\_DO\_LOWER}}
\index{VTY\_DO\_LOWER@{VTY\_DO\_LOWER}!misc.h@{misc.h}}
\doxysubsubsection{VTY\_DO\_LOWER}
{\footnotesize\ttfamily \#define VTY\+\_\+\+DO\+\_\+\+LOWER~1}



\doxysubsection{Function Documentation}
\mbox{\label{misc_8h_a2a0ceb760bb02a48f84913f9f693fd9c}} 
\index{misc.h@{misc.h}!osmo\_fsm\_vty\_add\_cmds@{osmo\_fsm\_vty\_add\_cmds}}
\index{osmo\_fsm\_vty\_add\_cmds@{osmo\_fsm\_vty\_add\_cmds}!misc.h@{misc.h}}
\doxysubsubsection{osmo\_fsm\_vty\_add\_cmds()}
{\footnotesize\ttfamily void osmo\+\_\+fsm\+\_\+vty\+\_\+add\+\_\+cmds (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Install VTY commands for FSM introspection This installs a couple of VTY commands for introspection of FSM classes as well as FSM instances. 

Call this once from your application if you want to support those commands. 

References \textbf{ install\+\_\+lib\+\_\+element\+\_\+ve()}.

\mbox{\label{misc_8h_af79841d88224443e132ee87d9d948122}} 
\index{misc.h@{misc.h}!osmo\_talloc\_vty\_add\_cmds@{osmo\_talloc\_vty\_add\_cmds}}
\index{osmo\_talloc\_vty\_add\_cmds@{osmo\_talloc\_vty\_add\_cmds}!misc.h@{misc.h}}
\doxysubsubsection{osmo\_talloc\_vty\_add\_cmds()}
{\footnotesize\ttfamily void osmo\+\_\+talloc\+\_\+vty\+\_\+add\+\_\+cmds (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Install VTY commands for talloc context introspection. 

This installs a set of VTY commands for introspection of a talloc context. Call this once from your application if you want to support those commands. 

References \textbf{ install\+\_\+lib\+\_\+element\+\_\+ve()}.

\mbox{\label{misc_8h_a87dfbb27e5d0a1def0aacc8d82b80598}} 
\index{misc.h@{misc.h}!vty\_out\_fsm@{vty\_out\_fsm}}
\index{vty\_out\_fsm@{vty\_out\_fsm}!misc.h@{misc.h}}
\doxysubsubsection{vty\_out\_fsm()}
{\footnotesize\ttfamily void vty\+\_\+out\+\_\+fsm (\begin{DoxyParamCaption}\item[{struct \textbf{ vty} $\ast$}]{vty,  }\item[{struct \textbf{ osmo\+\_\+fsm} $\ast$}]{fsm }\end{DoxyParamCaption})}



Print information about a FSM [class] to the given VTY. 


\begin{DoxyParams}[1]{Parameters}
 & {\em vty} & The VTY to which to print \\
\hline
\mbox{\texttt{ in}}  & {\em fsm} & The FSM class to print \\
\hline
\end{DoxyParams}


References \textbf{ vty\+\_\+out\+\_\+fsm2()}.



Referenced by \textbf{ DEFUN()}.

\mbox{\label{misc_8h_a111cba8800b4de239d4f7236adb1bcb0}} 
\index{misc.h@{misc.h}!vty\_out\_fsm2@{vty\_out\_fsm2}}
\index{vty\_out\_fsm2@{vty\_out\_fsm2}!misc.h@{misc.h}}
\doxysubsubsection{vty\_out\_fsm2()}
{\footnotesize\ttfamily void vty\+\_\+out\+\_\+fsm2 (\begin{DoxyParamCaption}\item[{struct \textbf{ vty} $\ast$}]{vty,  }\item[{const char $\ast$}]{prefix,  }\item[{struct \textbf{ osmo\+\_\+fsm} $\ast$}]{fsm }\end{DoxyParamCaption})}



Print information about a FSM [class] to the given VTY. 


\begin{DoxyParams}[1]{Parameters}
 & {\em vty} & The VTY to which to print \\
\hline
\mbox{\texttt{ in}}  & {\em prefix} & prefix to print at start of each line (typically indenting) \\
\hline
\mbox{\texttt{ in}}  & {\em fsm} & The FSM class to print \\
\hline
\end{DoxyParams}


References \textbf{ osmo\+\_\+fsm\+::event\+\_\+names}, \textbf{ osmo\+\_\+fsm\+\_\+state\+::in\+\_\+event\+\_\+mask}, \textbf{ log\+\_\+category\+\_\+name()}, \textbf{ osmo\+\_\+fsm\+::log\+\_\+subsys}, \textbf{ osmo\+\_\+fsm\+::name}, \textbf{ osmo\+\_\+fsm\+\_\+state\+::name}, \textbf{ osmo\+\_\+fsm\+::num\+\_\+states}, \textbf{ osmo\+\_\+fsm\+\_\+state\+::out\+\_\+state\+\_\+mask}, \textbf{ osmo\+\_\+fsm\+::states}, \textbf{ value\+\_\+string\+::str}, \textbf{ value\+\_\+string\+::value}, \textbf{ VTY\+\_\+\+NEWLINE}, and \textbf{ vty\+\_\+out()}.



Referenced by \textbf{ vty\+\_\+out\+\_\+fsm()}.

\mbox{\label{misc_8h_a8a7cb1a5f5e4a8f3f65af28c21233a02}} 
\index{misc.h@{misc.h}!vty\_out\_fsm\_inst@{vty\_out\_fsm\_inst}}
\index{vty\_out\_fsm\_inst@{vty\_out\_fsm\_inst}!misc.h@{misc.h}}
\doxysubsubsection{vty\_out\_fsm\_inst()}
{\footnotesize\ttfamily void vty\+\_\+out\+\_\+fsm\+\_\+inst (\begin{DoxyParamCaption}\item[{struct \textbf{ vty} $\ast$}]{vty,  }\item[{struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$}]{fsmi }\end{DoxyParamCaption})}



Print a FSM instance to the given VTY. 


\begin{DoxyParams}[1]{Parameters}
 & {\em vty} & The VTY to which to print \\
\hline
\mbox{\texttt{ in}}  & {\em fsmi} & The FSM instance to print \\
\hline
\end{DoxyParams}


References \textbf{ vty\+\_\+out\+\_\+fsm\+\_\+inst2()}.



Referenced by \textbf{ DEFUN()}.

\mbox{\label{misc_8h_a71184bbde194141f314aa443a4e35494}} 
\index{misc.h@{misc.h}!vty\_out\_fsm\_inst2@{vty\_out\_fsm\_inst2}}
\index{vty\_out\_fsm\_inst2@{vty\_out\_fsm\_inst2}!misc.h@{misc.h}}
\doxysubsubsection{vty\_out\_fsm\_inst2()}
{\footnotesize\ttfamily void vty\+\_\+out\+\_\+fsm\+\_\+inst2 (\begin{DoxyParamCaption}\item[{struct \textbf{ vty} $\ast$}]{vty,  }\item[{const char $\ast$}]{prefix,  }\item[{struct \textbf{ osmo\+\_\+fsm\+\_\+inst} $\ast$}]{fsmi }\end{DoxyParamCaption})}



Print a FSM instance to the given VTY. 


\begin{DoxyParams}[1]{Parameters}
 & {\em vty} & The VTY to which to print \\
\hline
\mbox{\texttt{ in}}  & {\em prefix} & prefix to print at start of each line (typically indenting) \\
\hline
\mbox{\texttt{ in}}  & {\em fsmi} & The FSM instance to print \\
\hline
\end{DoxyParams}


References \textbf{ osmo\+\_\+fsm\+\_\+inst\+::child}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::children}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::fsm}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::id}, \textbf{ llist\+\_\+for\+\_\+each\+\_\+entry}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::log\+\_\+level}, \textbf{ log\+\_\+level\+\_\+str()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::name}, \textbf{ osmo\+\_\+fsm\+\_\+event\+\_\+name()}, \textbf{ osmo\+\_\+fsm\+\_\+state\+\_\+name()}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::parent}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::parent\+\_\+term\+\_\+event}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::proc}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::state}, \textbf{ osmo\+\_\+fsm\+\_\+inst\+::T}, \textbf{ VTY\+\_\+\+NEWLINE}, and \textbf{ vty\+\_\+out()}.



Referenced by \textbf{ vty\+\_\+out\+\_\+fsm\+\_\+inst()}.

