summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-09-20 15:39:37 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-09-27 14:04:09 +0000
commitf4f23bd6829f78741cfd586f0ca9a290f221242e (patch)
treec50ce8201efe6d42e873dd650e20fd7e641b1b99 /include
parent607275c30be14266c4f1724b29a7cddea2062802 (diff)
vty: install 'exit', 'end',... commands on *all* nodes
In many callers of the VTY API, we are lacking the vty_install_default() step at certain node levels. This creates nodes that lack the 'exit' command, and hence the only way to exit such a node is to restart the telnet session. Historically, the VTY looked for missing commands on the immediate parent node, and hence possibly found the parent's 'exit' command when the local node was missing it. That is why we so far did not notice the missing default commands. Furthermore, some callers call install_default() instead of vty_install_default(). Only vty_install_default() also includes the 'exit' and 'end' commands. There is no reason why there are two sets of default commands. To end this confusion, to catch all missing 'exit' commands and to prevent this from re-appearing in the future, simply *always* install all default commands implicitly when calling install_node(). In cmd_init(), there are some top-level nodes that apparently do not want the default commands installed. Keep those the way they are, by changing the invocation to new install_node_bare() ({VIEW,AUTH,AUTH_ENABLE}_NODE). Make both install_default() and vty_install_default() no-ops so that users of the API may still call them without harm. Do not yet deprecate yet, which follows in Icf5d83f641e838cebcccc635a043e94ba352abff. Drop all invocations to these two functions found in libosmocore. Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/vty/command.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h
index 58f248fe..8fbdb7b7 100644
--- a/include/osmocom/vty/command.h
+++ b/include/osmocom/vty/command.h
@@ -27,6 +27,8 @@
#include <sys/types.h>
#include "vector.h"
+#include <osmocom/core/defs.h>
+
/*! \defgroup command VTY Command
* @{
* \file command.h */
@@ -363,9 +365,6 @@ void install_element(int node_type, struct cmd_element *);
void install_element_ve(struct cmd_element *cmd);
void sort_node(void);
-/* This is similar to install_default() but it also creates
- * 'exit' and 'end' commands.
- */
void vty_install_default(int node_type);
/* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated