\doxysection{src/vty/command.c File Reference}
\label{command_8c}\index{src/vty/command.c@{src/vty/command.c}}
{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$stdlib.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$stdbool.\+h$>$}\newline
{\ttfamily \#include $<$syslog.\+h$>$}\newline
{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$unistd.\+h$>$}\newline
{\ttfamily \#include $<$ctype.\+h$>$}\newline
{\ttfamily \#include $<$time.\+h$>$}\newline
{\ttfamily \#include $<$limits.\+h$>$}\newline
{\ttfamily \#include $<$signal.\+h$>$}\newline
{\ttfamily \#include $<$sys/time.\+h$>$}\newline
{\ttfamily \#include $<$sys/stat.\+h$>$}\newline
{\ttfamily \#include $<$sys/types.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/vty/vector.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/vty/vty.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/vty/command.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/logging.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/talloc.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/timer.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ vty\+\_\+parent\+\_\+node}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ \+\_\+\+XOPEN\+\_\+\+SOURCE}
\item 
\#define \textbf{ MAXPATHLEN}~4096
\item 
\#define \textbf{ CONFIGFILE\+\_\+\+MASK}~022
\item 
\#define \textbf{ ADD}(out,  str)
\item 
\#define \textbf{ CMD\+\_\+\+ATTR\+\_\+\+PUBLIC\+\_\+\+MASK}~ (\textbf{ CMD\+\_\+\+ATTR\+\_\+\+HIDDEN} $\vert$ \textbf{ CMD\+\_\+\+ATTR\+\_\+\+IMMEDIATE} $\vert$ \textbf{ CMD\+\_\+\+ATTR\+\_\+\+NODE\+\_\+\+EXIT})
\item 
\#define \textbf{ IPV6\+\_\+\+ADDR\+\_\+\+STR}~\char`\"{}0123456789abcdef\+ABCDEF\+:.\%\char`\"{}
\item 
\#define \textbf{ IPV6\+\_\+\+PREFIX\+\_\+\+STR}~\char`\"{}0123456789abcdef\+ABCDEF\+:.\%/\char`\"{}
\item 
\#define \textbf{ STATE\+\_\+\+START}~1
\item 
\#define \textbf{ STATE\+\_\+\+COLON}~2
\item 
\#define \textbf{ STATE\+\_\+\+DOUBLE}~3
\item 
\#define \textbf{ STATE\+\_\+\+ADDR}~4
\item 
\#define \textbf{ STATE\+\_\+\+DOT}~5
\item 
\#define \textbf{ STATE\+\_\+\+SLASH}~6
\item 
\#define \textbf{ STATE\+\_\+\+MASK}~7
\item 
\#define \textbf{ INIT\+\_\+\+MATCHVEC\+\_\+\+SIZE}~10
\item 
\#define \textbf{ INIT\+\_\+\+MATCHVEC\+\_\+\+SIZE}~10
\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef int($\ast$ \textbf{ print\+\_\+func\+\_\+t}) (void $\ast$\textbf{ data}, const char $\ast$fmt,...)
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ match\+\_\+type} \{ \newline
\textbf{ NO\+\_\+\+MATCH} = 0
, \newline
\textbf{ ANY\+\_\+\+MATCH}
, \newline
\textbf{ EXTEND\+\_\+\+MATCH}
, \newline
\textbf{ IPV4\+\_\+\+PREFIX\+\_\+\+MATCH}
, \newline
\textbf{ IPV4\+\_\+\+MATCH}
, \newline
\textbf{ IPV6\+\_\+\+PREFIX\+\_\+\+MATCH}
, \newline
\textbf{ IPV6\+\_\+\+MATCH}
, \newline
\textbf{ RANGE\+\_\+\+MATCH}
, \newline
\textbf{ VARARG\+\_\+\+MATCH}
, \newline
\textbf{ PARTLY\+\_\+\+MATCH}
, \newline
\textbf{ EXACT\+\_\+\+MATCH}
 \}
\item 
enum \{ \newline
\textbf{ ATTR\+\_\+\+TYPE\+\_\+\+GLOBAL} = (1 $<$$<$ 0)
, \newline
\textbf{ ATTR\+\_\+\+TYPE\+\_\+\+LIB} = (1 $<$$<$ 1)
, \newline
\textbf{ ATTR\+\_\+\+TYPE\+\_\+\+APP} = (1 $<$$<$ 2)
 \}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ print\+\_\+version} (int print\+\_\+copyright)
\begin{DoxyCompactList}\small\item\em print the version (and optionally copyright) information \end{DoxyCompactList}\item 
char $\ast$ \textbf{ argv\+\_\+concat} (const char $\ast$$\ast$\textbf{ argv}, int \textbf{ argc}, int shift)
\item 
static const char $\ast$ \textbf{ node\+\_\+name\+\_\+from\+\_\+prompt} (const char $\ast$prompt, char $\ast$name\+\_\+buf, size\+\_\+t name\+\_\+buf\+\_\+size)
\item 
static void \textbf{ install\+\_\+basic\+\_\+node\+\_\+commands} (int \textbf{ node})
\begin{DoxyCompactList}\small\item\em Install common commands like \textquotesingle{}exit\textquotesingle{} and \textquotesingle{}list\textquotesingle{}. \end{DoxyCompactList}\item 
static void \textbf{ install\+\_\+node\+\_\+bare} (struct \textbf{ cmd\+\_\+node} $\ast$\textbf{ node}, int($\ast$func)(struct \textbf{ vty} $\ast$))
\begin{DoxyCompactList}\small\item\em Install top node of command vector, without adding basic node commands. \end{DoxyCompactList}\item 
void \textbf{ install\+\_\+node} (struct \textbf{ cmd\+\_\+node} $\ast$\textbf{ node}, int($\ast$func)(struct \textbf{ vty} $\ast$))
\begin{DoxyCompactList}\small\item\em Install top node of command vector. \end{DoxyCompactList}\item 
static int \textbf{ cmp\+\_\+node} (const void $\ast$p, const void $\ast$q)
\item 
static int \textbf{ cmp\+\_\+desc} (const void $\ast$p, const void $\ast$q)
\item 
void \textbf{ sort\+\_\+node} (void)
\begin{DoxyCompactList}\small\item\em Sort each node\textquotesingle{}s command element according to command string. \end{DoxyCompactList}\item 
int \textbf{ cmd\+\_\+make\+\_\+strvec2} (const char $\ast$string, char $\ast$$\ast$indent, \textbf{ vector} $\ast$strvec\+\_\+p)
\begin{DoxyCompactList}\small\item\em Break up string in command tokens. \end{DoxyCompactList}\item 
\textbf{ vector} \textbf{ cmd\+\_\+make\+\_\+strvec} (const char $\ast$string)
\begin{DoxyCompactList}\small\item\em Breaking up string into each command piece. \end{DoxyCompactList}\item 
void \textbf{ cmd\+\_\+free\+\_\+strvec} (\textbf{ vector} v)
\begin{DoxyCompactList}\small\item\em Free allocated string vector. \end{DoxyCompactList}\item 
static char $\ast$ \textbf{ cmd\+\_\+desc\+\_\+str} (const char $\ast$$\ast$string)
\begin{DoxyCompactList}\small\item\em Fetch next description. \end{DoxyCompactList}\item 
static \textbf{ vector} \textbf{ cmd\+\_\+make\+\_\+descvec} (const char $\ast$string, const char $\ast$descstr)
\begin{DoxyCompactList}\small\item\em New string vector. \end{DoxyCompactList}\item 
static int \textbf{ cmd\+\_\+cmdsize} (\textbf{ vector} strvec)
\item 
const char $\ast$ \textbf{ cmd\+\_\+prompt} (enum \textbf{ node\+\_\+type} \textbf{ node})
\begin{DoxyCompactList}\small\item\em Return prompt character of specified node. \end{DoxyCompactList}\item 
char $\ast$ \textbf{ osmo\+\_\+asciidoc\+\_\+escape} (const char $\ast$inp)
\begin{DoxyCompactList}\small\item\em escape all special asciidoc symbols \end{DoxyCompactList}\item 
static char $\ast$ \textbf{ xml\+\_\+escape} (const char $\ast$inp)
\item 
static char \textbf{ cmd\+\_\+attr\+\_\+get\+\_\+flag} (unsigned int attr)
\item 
static int \textbf{ vty\+\_\+dump\+\_\+element} (const struct \textbf{ cmd\+\_\+element} $\ast$cmd, \textbf{ print\+\_\+func\+\_\+t} print\+\_\+func, void $\ast$\textbf{ data}, const char $\ast$newline)
\item 
static bool \textbf{ vty\+\_\+command\+\_\+is\+\_\+common} (const struct \textbf{ cmd\+\_\+element} $\ast$cmd)
\begin{DoxyCompactList}\small\item\em Return true if a node is installed by \doxyref{install\+\_\+basic\+\_\+node\+\_\+commands()}{p.}{group__command_gae05ca117303c592ddf4b582a01cb3a73}, so that we can avoid repeating them for each and every node during \textquotesingle{}show running-\/config\textquotesingle{}. \end{DoxyCompactList}\item 
static int \textbf{ vty\+\_\+dump\+\_\+nodes} (\textbf{ print\+\_\+func\+\_\+t} print\+\_\+func, void $\ast$\textbf{ data}, const char $\ast$newline, unsigned char gflag\+\_\+mask, bool match)
\item 
static int \textbf{ print\+\_\+func\+\_\+vty} (void $\ast$\textbf{ data}, const char $\ast$format,...)
\item 
static int \textbf{ vty\+\_\+dump\+\_\+xml\+\_\+ref\+\_\+to\+\_\+vty} (struct \textbf{ vty} $\ast$\textbf{ vty})
\item 
static int \textbf{ print\+\_\+func\+\_\+stream} (void $\ast$\textbf{ data}, const char $\ast$format,...)
\item 
int \textbf{ vty\+\_\+dump\+\_\+xml\+\_\+ref\+\_\+mode} (FILE $\ast$stream, enum \textbf{ vty\+\_\+ref\+\_\+gen\+\_\+mode} \textbf{ mode})
\begin{DoxyCompactList}\small\item\em Print the XML reference of all VTY nodes to the given stream. \end{DoxyCompactList}\item 
int \textbf{ vty\+\_\+dump\+\_\+xml\+\_\+ref} (FILE $\ast$stream)
\begin{DoxyCompactList}\small\item\em Print the XML reference of all VTY nodes to the given stream. \end{DoxyCompactList}\item 
static int \textbf{ check\+\_\+element\+\_\+exists} (struct \textbf{ cmd\+\_\+node} $\ast$cnode, const char $\ast$cmdstring)
\item 
void \textbf{ install\+\_\+element} (int ntype, struct \textbf{ cmd\+\_\+element} $\ast$cmd)
\begin{DoxyCompactList}\small\item\em Install a command into a node. \end{DoxyCompactList}\item 
void \textbf{ install\+\_\+lib\+\_\+element} (int ntype, struct \textbf{ cmd\+\_\+element} $\ast$cmd)
\begin{DoxyCompactList}\small\item\em Install a library command into a node. \end{DoxyCompactList}\item 
void \textbf{ install\+\_\+element\+\_\+ve} (struct \textbf{ cmd\+\_\+element} $\ast$cmd)
\item 
void \textbf{ install\+\_\+lib\+\_\+element\+\_\+ve} (struct \textbf{ cmd\+\_\+element} $\ast$cmd)
\item 
static int \textbf{ config\+\_\+write\+\_\+host} (struct \textbf{ vty} $\ast$\textbf{ vty})
\item 
static \textbf{ vector} \textbf{ cmd\+\_\+node\+\_\+vector} (\textbf{ vector} v, enum \textbf{ node\+\_\+type} ntype)
\item 
static enum \textbf{ match\+\_\+type} \textbf{ cmd\+\_\+ipv4\+\_\+match} (const char $\ast$str)
\item 
static enum \textbf{ match\+\_\+type} \textbf{ cmd\+\_\+ipv4\+\_\+prefix\+\_\+match} (const char $\ast$str)
\item 
static int \textbf{ check\+\_\+base} (const char $\ast$str)
\item 
int \textbf{ vty\+\_\+cmd\+\_\+range\+\_\+match} (const char $\ast$range, const char $\ast$str)
\item 
static char $\ast$ \textbf{ cmd\+\_\+deopt} (void $\ast$ctx, const char $\ast$str)
\item 
static enum \textbf{ match\+\_\+type} \textbf{ cmd\+\_\+match} (const char $\ast$str, const char $\ast$command, enum \textbf{ match\+\_\+type} min, bool recur)
\item 
static enum \textbf{ match\+\_\+type} \textbf{ cmd\+\_\+filter} (char $\ast$command, \textbf{ vector} v, unsigned int index, enum \textbf{ match\+\_\+type} \textbf{ level})
\item 
static int \textbf{ is\+\_\+cmd\+\_\+ambiguous} (char $\ast$command, \textbf{ vector} v, int index, enum \textbf{ match\+\_\+type} \textbf{ type})
\item 
static const char $\ast$ \textbf{ cmd\+\_\+entry\+\_\+function} (const char $\ast$src, const char $\ast$dst)
\item 
static const char $\ast$ \textbf{ cmd\+\_\+entry\+\_\+function\+\_\+desc} (const char $\ast$src, const char $\ast$dst)
\item 
static int \textbf{ cmd\+\_\+unique\+\_\+string} (\textbf{ vector} v, const char $\ast$str)
\item 
static int \textbf{ desc\+\_\+unique\+\_\+string} (\textbf{ vector} v, const char $\ast$str)
\item 
static int \textbf{ cmd\+\_\+try\+\_\+do\+\_\+shortcut} (enum \textbf{ node\+\_\+type} \textbf{ node}, char $\ast$first\+\_\+word)
\item 
static \textbf{ vector} \textbf{ cmd\+\_\+describe\+\_\+command\+\_\+real} (\textbf{ vector} vline, struct \textbf{ vty} $\ast$\textbf{ vty}, int $\ast$status)
\item 
\textbf{ vector} \textbf{ cmd\+\_\+describe\+\_\+command} (\textbf{ vector} vline, struct \textbf{ vty} $\ast$\textbf{ vty}, int $\ast$status)
\item 
static int \textbf{ cmd\+\_\+lcd} (char $\ast$$\ast$matched)
\item 
static char $\ast$$\ast$ \textbf{ cmd\+\_\+complete\+\_\+command\+\_\+real} (\textbf{ vector} vline, struct \textbf{ vty} $\ast$\textbf{ vty}, int $\ast$status)
\item 
char $\ast$$\ast$ \textbf{ cmd\+\_\+complete\+\_\+command} (\textbf{ vector} vline, struct \textbf{ vty} $\ast$\textbf{ vty}, int $\ast$status)
\item 
static struct \textbf{ vty\+\_\+parent\+\_\+node} $\ast$ \textbf{ vty\+\_\+parent} (struct \textbf{ vty} $\ast$\textbf{ vty})
\item 
static bool \textbf{ vty\+\_\+pop\+\_\+parent} (struct \textbf{ vty} $\ast$\textbf{ vty})
\item 
static void \textbf{ vty\+\_\+clear\+\_\+parents} (struct \textbf{ vty} $\ast$\textbf{ vty})
\item 
int \textbf{ vty\+\_\+go\+\_\+parent} (struct \textbf{ vty} $\ast$\textbf{ vty})
\item 
static int \textbf{ cmd\+\_\+execute\+\_\+command\+\_\+real} (\textbf{ vector} vline, struct \textbf{ vty} $\ast$\textbf{ vty}, struct \textbf{ cmd\+\_\+element} $\ast$$\ast$cmd)
\item 
int \textbf{ cmd\+\_\+execute\+\_\+command} (\textbf{ vector}, struct \textbf{ vty} $\ast$, struct \textbf{ cmd\+\_\+element} $\ast$$\ast$, int)
\item 
int \textbf{ cmd\+\_\+execute\+\_\+command\+\_\+strict} (\textbf{ vector}, struct \textbf{ vty} $\ast$, struct \textbf{ cmd\+\_\+element} $\ast$$\ast$)
\item 
static size\+\_\+t \textbf{ len} (const char $\ast$str)
\item 
static int \textbf{ indent\+\_\+cmp} (const char $\ast$a, const char $\ast$b)
\begin{DoxyCompactList}\small\item\em Make sure the common length of strings a and b is identical, then compare their lengths. \end{DoxyCompactList}\item 
int \textbf{ config\+\_\+from\+\_\+file} (struct \textbf{ vty} $\ast$, FILE $\ast$)
\item 
\textbf{ DEFUN} (config\+\_\+terminal, config\+\_\+terminal\+\_\+cmd, \char`\"{}configure [\textbf{ terminal}]\char`\"{}, \char`\"{}Configuration from \textbf{ vty} \textbf{ interface\textbackslash{}n}\char`\"{} \char`\"{}Configuration \textbf{ terminal\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (enable, config\+\_\+enable\+\_\+cmd, \char`\"{}enable [expert-\/\textbf{ mode}]\char`\"{}, \char`\"{}Turn on privileged \textbf{ mode} \textbf{ command\textbackslash{}n}\char`\"{} \char`\"{}Enable the expert \textbf{ mode} (show hidden commands)\textbackslash{}\textbf{ n}\char`\"{})
\item 
\textbf{ DEFUN} (disable, config\+\_\+disable\+\_\+cmd, \char`\"{}disable\char`\"{}, \char`\"{}Turn off privileged \textbf{ mode} \textbf{ command\textbackslash{}n}\char`\"{})
\item 
\textbf{ g\+DEFUN} (config\+\_\+exit, \textbf{ config\+\_\+exit\+\_\+cmd}, \char`\"{}exit\char`\"{}, \char`\"{}Exit current \textbf{ mode} and down to previous \textbf{ mode\textbackslash{}n}\char`\"{})
\item 
\textbf{ g\+DEFUN} (config\+\_\+end, \textbf{ config\+\_\+end\+\_\+cmd}, \char`\"{}end\char`\"{}, \char`\"{}End current \textbf{ mode} and change to enable mode.\char`\"{})
\item 
\textbf{ DEFUN} (shutdown, shutdown\+\_\+cmd, \char`\"{}shutdown\char`\"{}, \char`\"{}Request a shutdown of the \textbf{ program\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (show\+\_\+version, show\+\_\+version\+\_\+cmd, \char`\"{}show \textbf{ version}\char`\"{}, SHOW\+\_\+\+STR \char`\"{}Displays program \textbf{ version\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (show\+\_\+online\+\_\+help, show\+\_\+online\+\_\+help\+\_\+cmd, \char`\"{}show online-\/help\char`\"{}, SHOW\+\_\+\+STR \char`\"{}Online \textbf{ help\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (show\+\_\+pid, show\+\_\+pid\+\_\+cmd, \char`\"{}show \textbf{ pid}\char`\"{}, SHOW\+\_\+\+STR \char`\"{}Displays the process \textbf{ ID\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (show\+\_\+uptime, show\+\_\+uptime\+\_\+cmd, \char`\"{}show uptime\char`\"{}, SHOW\+\_\+\+STR \char`\"{}Displays how long the program has been \textbf{ running\textbackslash{}n}\char`\"{})
\item 
\textbf{ g\+DEFUN} (config\+\_\+help, \textbf{ config\+\_\+help\+\_\+cmd}, \char`\"{}help\char`\"{}, \char`\"{}Description of the interactive help \textbf{ system\textbackslash{}n}\char`\"{})
\item 
static void \textbf{ print\+\_\+attr\+\_\+list} (struct \textbf{ vty} $\ast$\textbf{ vty}, unsigned int attr\+\_\+mask)
\item 
\textbf{ g\+DEFUN} (show\+\_\+vty\+\_\+attr\+\_\+all, show\+\_\+vty\+\_\+attr\+\_\+all\+\_\+cmd, \char`\"{}show \textbf{ vty}-\/attributes\char`\"{}, SHOW\+\_\+\+STR \char`\"{}List of VTY \textbf{ attributes\textbackslash{}n}\char`\"{})
\item 
\textbf{ g\+DEFUN} (show\+\_\+vty\+\_\+attr, show\+\_\+vty\+\_\+attr\+\_\+cmd, \char`\"{}show \textbf{ vty}-\/attributes (application$\vert$library$\vert$global)\char`\"{}, SHOW\+\_\+\+STR \char`\"{}List of VTY \textbf{ attributes\textbackslash{}n}\char`\"{} \char`\"{}Application specific attributes \textbf{ only\textbackslash{}n}\char`\"{} \char`\"{}Library specific attributes \textbf{ only\textbackslash{}n}\char`\"{} \char`\"{}Global attributes \textbf{ only\textbackslash{}n}\char`\"{})
\item 
static unsigned int \textbf{ node\+\_\+flag\+\_\+mask} (const struct \textbf{ cmd\+\_\+node} $\ast$cnode, bool expert\+\_\+mode)
\item 
static const char $\ast$ \textbf{ cmd\+\_\+gflag\+\_\+mask} (const struct \textbf{ cmd\+\_\+element} $\ast$cmd)
\item 
static const char $\ast$ \textbf{ cmd\+\_\+flag\+\_\+mask} (const struct \textbf{ cmd\+\_\+element} $\ast$cmd, unsigned int flag\+\_\+mask)
\item 
\textbf{ g\+DEFUN} (config\+\_\+list, \textbf{ config\+\_\+list\+\_\+cmd}, \char`\"{}list [with-\/\textbf{ flags}]\char`\"{}, \char`\"{}Print command \textbf{ list\textbackslash{}n}\char`\"{} \char`\"{}Also print the VTY attribute \textbf{ flags\textbackslash{}n}\char`\"{})
\item 
static int \textbf{ write\+\_\+config\+\_\+file} (const char $\ast$config\+\_\+file, char $\ast$$\ast$outpath)
\item 
\textbf{ DEFUN} (config\+\_\+write\+\_\+file, config\+\_\+write\+\_\+file\+\_\+cmd, \char`\"{}write \textbf{ file} [PATH]\char`\"{}, \char`\"{}Write running configuration to \textbf{ memory}, \textbf{ network}, or \textbf{ terminal\textbackslash{}n}\char`\"{} \char`\"{}Write to configuration \textbf{ file\textbackslash{}n}\char`\"{} \char`\"{}Set \textbf{ file} path to store the \textbf{ config}, or replace \textbf{ if} already \textbf{ exists\textbackslash{}n}\char`\"{})
\item 
\textbf{ ALIAS} (config\+\_\+write\+\_\+file, config\+\_\+write\+\_\+cmd, \char`\"{}write\char`\"{}, \char`\"{}Write running configuration to \textbf{ memory}, \textbf{ network}, or \textbf{ terminal\textbackslash{}n}\char`\"{}) ALIAS(config\+\_\+write\+\_\+file
\item 
write Write running configuration to or \textbf{ terminal} \textbf{ n} Write configuration to the \textbf{ file} (same as write file)\textbackslash{}\textbf{ n}\char`\"{}) ALIAS(config\+\_\+write\+\_\+file
\item 
write Write running configuration to or \textbf{ terminal} \textbf{ n} Write configuration to the copy running config startup Copy configuration \textbf{ n} Copy running config to \textbf{ n} Copy running config to startup \textbf{ config} (same as write \textbf{ file})\textbackslash{}\textbf{ n}\char`\"{})  DEFUN(config\+\_\+write\+\_\+terminal
\item 
\textbf{ if} (\textbf{ vty}-\/$>$\textbf{ type}==\textbf{ VTY\+\_\+\+SHELL\+\_\+\+SERV})
\item 
\textbf{ vty\+\_\+out} (\textbf{ vty}, \char`\"{}!\%s\char`\"{}, VTY\+\_\+\+NEWLINE)
\item 
\textbf{ for} (i=0;i$<$ \textbf{ vector\+\_\+active}(\textbf{ cmdvec});i++) \textbf{ if}((\textbf{ node}
\item 
\textbf{ ALIAS} (config\+\_\+write\+\_\+terminal, show\+\_\+running\+\_\+config\+\_\+cmd, \char`\"{}show running-\/\textbf{ config}\char`\"{}, SHOW\+\_\+\+STR \char`\"{}running \textbf{ configuration\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (config\+\_\+hostname, hostname\+\_\+cmd, \char`\"{}hostname WORD\char`\"{}, \char`\"{}Set system\textquotesingle{}s \textbf{ network} \textbf{ name\textbackslash{}n}\char`\"{} \char`\"{}This system\textquotesingle{}s \textbf{ network} \textbf{ name\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (config\+\_\+no\+\_\+hostname, no\+\_\+hostname\+\_\+cmd, \char`\"{}no hostname [HOSTNAME]\char`\"{}, NO\+\_\+\+STR \char`\"{}Reset system\textquotesingle{}s \textbf{ network} \textbf{ name\textbackslash{}n}\char`\"{} \char`\"{}Host \textbf{ name} of this \textbf{ router\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (config\+\_\+password, password\+\_\+cmd, \char`\"{}password (8$\vert$) WORD\char`\"{}, \char`\"{}Assign the \textbf{ terminal} connection \textbf{ password\textbackslash{}n}\char`\"{} \char`\"{}Specifies a HIDDEN password will \textbf{ follow\textbackslash{}n}\char`\"{} \char`\"{}dummy string \textbackslash{}\textbf{ n}\char`\"{} \char`\"{}The HIDDEN line password \textbf{ string\textbackslash{}n}\char`\"{})
\item 
\textbf{ ALIAS} (config\+\_\+password, password\+\_\+text\+\_\+cmd, \char`\"{}password LINE\char`\"{}, \char`\"{}Assign the \textbf{ terminal} connection \textbf{ password\textbackslash{}n}\char`\"{} \char`\"{}The UNENCRYPTED (cleartext) line \textbf{ password\textbackslash{}n}\char`\"{})
\item 
\textbf{ ALIAS} (config\+\_\+enable\+\_\+password, enable\+\_\+password\+\_\+text\+\_\+cmd, \char`\"{}enable password LINE\char`\"{}, \char`\"{}Modify enable password \textbf{ parameters\textbackslash{}n}\char`\"{} \char`\"{}Assign the privileged \textbf{ level} \textbf{ password\textbackslash{}n}\char`\"{} \char`\"{}The UNENCRYPTED (cleartext) \textquotesingle{}enable\textquotesingle{} \textbf{ password\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (config\+\_\+terminal\+\_\+length, config\+\_\+terminal\+\_\+length\+\_\+cmd, \char`\"{}terminal \textbf{ length} $<$0-\/512$>$\char`\"{}, \char`\"{}Set \textbf{ terminal} line \textbf{ parameters\textbackslash{}n}\char`\"{} \char`\"{}Set number of lines on a \textbf{ screen\textbackslash{}n}\char`\"{} \char`\"{}Number of lines on screen (0 \textbf{ for} no pausing)\textbackslash{}\textbf{ n}\char`\"{})
\item 
\textbf{ DEFUN} (config\+\_\+terminal\+\_\+no\+\_\+length, config\+\_\+terminal\+\_\+no\+\_\+length\+\_\+cmd, \char`\"{}terminal no \textbf{ length}\char`\"{}, \char`\"{}Set \textbf{ terminal} line \textbf{ parameters\textbackslash{}n}\char`\"{} NO\+\_\+\+STR \char`\"{}Set number of lines on a \textbf{ screen\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (service\+\_\+terminal\+\_\+length, service\+\_\+terminal\+\_\+length\+\_\+cmd, \char`\"{}service \textbf{ terminal}-\/\textbf{ length} $<$0-\/512$>$\char`\"{}, \char`\"{}Set up miscellaneous \textbf{ service\textbackslash{}n}\char`\"{} \char`\"{}System wide \textbf{ terminal} \textbf{ length} \textbf{ configuration\textbackslash{}n}\char`\"{} \char`\"{}Number of lines of VTY (0 means no line control)\textbackslash{}\textbf{ n}\char`\"{})
\item 
\textbf{ DEFUN} (no\+\_\+service\+\_\+terminal\+\_\+length, no\+\_\+service\+\_\+terminal\+\_\+length\+\_\+cmd, \char`\"{}no service \textbf{ terminal}-\/\textbf{ length} [$<$0-\/512$>$]\char`\"{}, NO\+\_\+\+STR \char`\"{}Set up miscellaneous \textbf{ service\textbackslash{}n}\char`\"{} \char`\"{}System wide \textbf{ terminal} \textbf{ length} \textbf{ configuration\textbackslash{}n}\char`\"{} \char`\"{}Number of lines of VTY (0 means no line control)\textbackslash{}\textbf{ n}\char`\"{})
\item 
\textbf{ DEFUN\+\_\+\+HIDDEN} (do\+\_\+echo, echo\+\_\+cmd, \char`\"{}echo .MESSAGE\char`\"{}, \char`\"{}Echo a message back to the \textbf{ vty\textbackslash{}n}\char`\"{} \char`\"{}The message to \textbf{ echo\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (banner\+\_\+motd\+\_\+file, banner\+\_\+motd\+\_\+file\+\_\+cmd, \char`\"{}banner motd \textbf{ file} [FILE]\char`\"{}, \char`\"{}Set \textbf{ banner\textbackslash{}n}\char`\"{} \char`\"{}Banner \textbf{ for} \textbf{ motd\textbackslash{}n}\char`\"{} \char`\"{}Banner from a \textbf{ file\textbackslash{}n}\char`\"{} \char`\"{}\textbf{ Filename\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (banner\+\_\+motd\+\_\+default, banner\+\_\+motd\+\_\+default\+\_\+cmd, \char`\"{}banner motd default\char`\"{}, \char`\"{}Set banner \textbf{ string\textbackslash{}n}\char`\"{} \char`\"{}Strings \textbf{ for} \textbf{ motd\textbackslash{}n}\char`\"{} \char`\"{}Default \textbf{ string\textbackslash{}n}\char`\"{})
\item 
\textbf{ DEFUN} (no\+\_\+banner\+\_\+motd, no\+\_\+banner\+\_\+motd\+\_\+cmd, \char`\"{}no banner motd\char`\"{}, NO\+\_\+\+STR \char`\"{}Set banner \textbf{ string\textbackslash{}n}\char`\"{} \char`\"{}Strings \textbf{ for} \textbf{ motd\textbackslash{}n}\char`\"{})
\item 
void \textbf{ host\+\_\+config\+\_\+set} (const char $\ast$)
\item 
const char $\ast$ \textbf{ host\+\_\+config\+\_\+file} (void)
\item 
void \textbf{ install\+\_\+default} (int \textbf{ node})
\begin{DoxyCompactList}\small\item\em Deprecated, now happens implicitly when calling \doxyref{install\+\_\+node()}{p.}{group__command_ga7ee8a7c258e1e5a6e3ff6173dd1658e3}. \end{DoxyCompactList}\item 
void \textbf{ vty\+\_\+install\+\_\+default} (int \textbf{ node})
\begin{DoxyCompactList}\small\item\em Deprecated, now happens implicitly when calling \doxyref{install\+\_\+node()}{p.}{group__command_ga7ee8a7c258e1e5a6e3ff6173dd1658e3}. \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}\item 
void \textbf{ cmd\+\_\+init} (int)
\item 
static \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+} ((constructor))
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
void $\ast$ \textbf{ tall\+\_\+vty\+\_\+cmd\+\_\+ctx}
\item 
static struct timespec \textbf{ starttime}
\item 
\textbf{ vector} \textbf{ cmdvec}
\item 
struct \textbf{ host} \textbf{ host}
\item 
struct \textbf{ cmd\+\_\+node} \textbf{ auth\+\_\+node}
\item 
struct \textbf{ cmd\+\_\+node} \textbf{ view\+\_\+node}
\item 
struct \textbf{ cmd\+\_\+node} \textbf{ auth\+\_\+enable\+\_\+node}
\item 
struct \textbf{ cmd\+\_\+node} \textbf{ enable\+\_\+node}
\item 
struct \textbf{ cmd\+\_\+node} \textbf{ config\+\_\+node}
\item 
const char $\ast$ \textbf{ default\+\_\+motd} = \char`\"{}\char`\"{}
\item 
static const struct \textbf{ value\+\_\+string} \textbf{ cmd\+\_\+attr\+\_\+desc} [$\,$]
\item 
static const char $\ast$const \textbf{ cmd\+\_\+lib\+\_\+attr\+\_\+desc} [32]
\item 
static const char \textbf{ cmd\+\_\+lib\+\_\+attr\+\_\+letters} [32]
\item 
const struct \textbf{ value\+\_\+string} \textbf{ vty\+\_\+ref\+\_\+gen\+\_\+mode\+\_\+names} [$\,$]
\item 
const struct \textbf{ value\+\_\+string} \textbf{ vty\+\_\+ref\+\_\+gen\+\_\+mode\+\_\+desc} [$\,$]
\item 
\textbf{ config\+\_\+write\+\_\+memory\+\_\+cmd}
\item 
write \textbf{ memory}
\item 
write Write running configuration to \textbf{ network}
\item 
write Write running configuration to or \textbf{ terminal} \textbf{ n} Write configuration to the \textbf{ copy\+\_\+runningconfig\+\_\+startupconfig\+\_\+cmd}
\item 
write Write running configuration to or \textbf{ terminal} \textbf{ n} Write configuration to the copy running config startup \textbf{ config}
\item 
write Write running configuration to or \textbf{ terminal} \textbf{ n} Write configuration to the copy running \textbf{ config} startup Copy configuration \textbf{ n} Copy running \textbf{ config} to \textbf{ n} Copy running \textbf{ config} to startup \textbf{ config\+\_\+write\+\_\+terminal\+\_\+cmd}
\item 
write Write running configuration to or terminal \textbf{ n} Write configuration to the copy running \textbf{ config} startup Copy configuration \textbf{ n} Copy running \textbf{ config} to \textbf{ n} Copy running \textbf{ config} to startup write \textbf{ terminal}
\item 
write Write running configuration to or \textbf{ terminal} n Write configuration to the copy running \textbf{ config} startup Copy configuration n Copy running \textbf{ config} to n Copy running \textbf{ config} to startup write Write running configuration to or \textbf{ terminal} n Write to \textbf{ terminal} \textbf{ n}
\item 
struct \textbf{ cmd\+\_\+node} $\ast$ \textbf{ node}
\item 
\textbf{ else}
\item 
return \textbf{ CMD\+\_\+\+SUCCESS}
\end{DoxyCompactItemize}


\doxysubsection{Macro Definition Documentation}
\mbox{\label{command_8c_a78c99ffd76a7bb3c8c74db76207e9ab4}} 
\index{command.c@{command.c}!\_XOPEN\_SOURCE@{\_XOPEN\_SOURCE}}
\index{\_XOPEN\_SOURCE@{\_XOPEN\_SOURCE}!command.c@{command.c}}
\doxysubsubsection{\_XOPEN\_SOURCE}
{\footnotesize\ttfamily \#define \+\_\+\+XOPEN\+\_\+\+SOURCE}

\mbox{\label{command_8c_a651bc6e352dbef3af130cd8e8ea3abd7}} 
\index{command.c@{command.c}!ADD@{ADD}}
\index{ADD@{ADD}!command.c@{command.c}}
\doxysubsubsection{ADD}
{\footnotesize\ttfamily \#define ADD(\begin{DoxyParamCaption}\item[{}]{out,  }\item[{}]{str }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (j = 0; j < strlen(str); ++j) \(\backslash\)}
\DoxyCodeLine{                *(out++) = str[j];}

\end{DoxyCode}
\mbox{\label{command_8c_a504ad7bffac6543fa988ae8bbd4f04a3}} 
\index{command.c@{command.c}!INIT\_MATCHVEC\_SIZE@{INIT\_MATCHVEC\_SIZE}}
\index{INIT\_MATCHVEC\_SIZE@{INIT\_MATCHVEC\_SIZE}!command.c@{command.c}}
\doxysubsubsection{INIT\_MATCHVEC\_SIZE\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \#define INIT\+\_\+\+MATCHVEC\+\_\+\+SIZE~10}

\mbox{\label{command_8c_a504ad7bffac6543fa988ae8bbd4f04a3}} 
\index{command.c@{command.c}!INIT\_MATCHVEC\_SIZE@{INIT\_MATCHVEC\_SIZE}}
\index{INIT\_MATCHVEC\_SIZE@{INIT\_MATCHVEC\_SIZE}!command.c@{command.c}}
\doxysubsubsection{INIT\_MATCHVEC\_SIZE\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \#define INIT\+\_\+\+MATCHVEC\+\_\+\+SIZE~10}

\mbox{\label{command_8c_addfa831c1473e710d2b71b72fd7fcfa5}} 
\index{command.c@{command.c}!MAXPATHLEN@{MAXPATHLEN}}
\index{MAXPATHLEN@{MAXPATHLEN}!command.c@{command.c}}
\doxysubsubsection{MAXPATHLEN}
{\footnotesize\ttfamily \#define MAXPATHLEN~4096}

