\doxysection{src/vty/utils.c File Reference}
\label{utils_8c}\index{src/vty/utils.c@{src/vty/utils.c}}


Utility routines for printing common objects in the Osmocom world.  


{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$stdbool.\+h$>$}\newline
{\ttfamily \#include $<$inttypes.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$ctype.\+h$>$}\newline
{\ttfamily \#include $<$limits.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/linuxlist.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/talloc.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/timer.\+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
{\ttfamily \#include $<$osmocom/core/counter.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/vty/vty.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ vty\+\_\+out\+\_\+context}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static int \textbf{ rate\+\_\+ctr\+\_\+handler} (struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg, struct \textbf{ rate\+\_\+ctr} $\ast$ctr, const struct \textbf{ rate\+\_\+ctr\+\_\+desc} $\ast$\textbf{ desc}, void $\ast$vctx\+\_\+)
\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} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg)
\item 
static char $\ast$ \textbf{ pad\+\_\+append\+\_\+str} (char $\ast$s, const char $\ast$a, int minwidth)
\item 
static char $\ast$ \textbf{ pad\+\_\+append\+\_\+ctr} (char $\ast$s, uint64\+\_\+t ctr, int minwidth)
\item 
static int \textbf{ rate\+\_\+ctr\+\_\+handler\+\_\+fmt} (struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg, struct \textbf{ rate\+\_\+ctr} $\ast$ctr, const struct \textbf{ rate\+\_\+ctr\+\_\+desc} $\ast$\textbf{ desc}, void $\ast$vctx\+\_\+)
\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\+\_\+rate\+\_\+ctr\+\_\+group\+\_\+fmt} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$fmt, struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg)
\item 
static int \textbf{ rate\+\_\+ctr\+\_\+group\+\_\+handler} (struct \textbf{ rate\+\_\+ctr\+\_\+group} $\ast$ctrg, void $\ast$vctx\+\_\+)
\item 
static int \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+handler} (struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg, struct \textbf{ osmo\+\_\+stat\+\_\+item} $\ast$item, void $\ast$vctx\+\_\+)
\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\+\_\+stat\+\_\+item\+\_\+group} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg)
\item 
static int \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+handler} (struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$statg, void $\ast$vctx\+\_\+)
\item 
static int \textbf{ handle\+\_\+counter} (struct \textbf{ osmo\+\_\+counter} $\ast$counter, void $\ast$vctx\+\_\+)
\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\+\_\+statistics\+\_\+partial} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix, int max\+\_\+level)
\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\+\_\+full} (struct \textbf{ vty} $\ast$\textbf{ vty}, const char $\ast$prefix)
\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}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Utility routines for printing common objects in the Osmocom world. 



\doxysubsection{Function Documentation}
\mbox{\label{utils_8c_ga1f68226f8cab58ed861ed06aa70eeacc}} 
\index{utils.c@{utils.c}!osmo\_stat\_item\_group\_handler@{osmo\_stat\_item\_group\_handler}}
\index{osmo\_stat\_item\_group\_handler@{osmo\_stat\_item\_group\_handler}!utils.c@{utils.c}}
\doxysubsubsection{osmo\_stat\_item\_group\_handler()}
{\footnotesize\ttfamily static int osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+handler (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$}]{statg,  }\item[{void $\ast$}]{vctx\+\_\+ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+desc\+::class\+\_\+id}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::desc}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+desc\+::group\+\_\+description}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::idx}, \textbf{ vty\+\_\+out\+\_\+context\+::max\+\_\+level}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+::name}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+for\+\_\+each\+\_\+item()}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+handler()}, \textbf{ vty\+\_\+out\+\_\+context\+::prefix}, \textbf{ vty\+\_\+out\+\_\+context\+::vty}, \textbf{ VTY\+\_\+\+NEWLINE}, and \textbf{ vty\+\_\+out()}.



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

\mbox{\label{utils_8c_gaf542dbe9d1e8d114dc9b81af94ed9f04}} 
\index{utils.c@{utils.c}!osmo\_stat\_item\_handler@{osmo\_stat\_item\_handler}}
\index{osmo\_stat\_item\_handler@{osmo\_stat\_item\_handler}!utils.c@{utils.c}}
\doxysubsubsection{osmo\_stat\_item\_handler()}
{\footnotesize\ttfamily static int osmo\+\_\+stat\+\_\+item\+\_\+handler (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group} $\ast$}]{statg,  }\item[{struct \textbf{ osmo\+\_\+stat\+\_\+item} $\ast$}]{item,  }\item[{void $\ast$}]{vctx\+\_\+ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ if()}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+get\+\_\+desc()}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+get\+\_\+last()}, \textbf{ OSMO\+\_\+\+STAT\+\_\+\+ITEM\+\_\+\+NO\+\_\+\+UNIT}, \textbf{ vty\+\_\+out\+\_\+context\+::prefix}, \textbf{ vty\+\_\+out\+\_\+context\+::skip\+\_\+zero}, \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+desc\+::unit}, \textbf{ vty\+\_\+out\+\_\+context\+::vty}, \textbf{ VTY\+\_\+\+NEWLINE}, and \textbf{ vty\+\_\+out()}.



Referenced by \textbf{ osmo\+\_\+stat\+\_\+item\+\_\+group\+\_\+handler()}, and \textbf{ vty\+\_\+out\+\_\+stat\+\_\+item\+\_\+group2()}.

