aboutsummaryrefslogtreecommitdiffstats
path: root/src/vty
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-02 02:14:07 +0000
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-05 04:22:56 +0000
commita9e5252128d1d871739f067fe9b0ca9b9a75a6f7 (patch)
tree7f92975a8ef4883b3ca5891bb2a03582270484ca /src/vty
parentc136da587fc2fafff1f649828eae5c996c345017 (diff)
vty: Change API to have node installation be done by int
We are mixing enums and hope that no short-enums are used. This is leading to a lot compiler warnings generated by clang. Change the API to work with integers. Porting: The go_parent_cb implementations in the applications need to be fixed. The API change leads to a compile time warning. Fixes: abis_om2000_vty.c:46:2: warning: implicit conversion from enumeration type 'enum bsc_vty_node' to different enumeration type 'enum node_type' [-Wenum-conversion] OM2K_NODE, ^~~~~~~~~
Diffstat (limited to 'src/vty')
-rw-r--r--src/vty/command.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vty/command.c b/src/vty/command.c
index 3ff5f775..290b12d8 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -548,7 +548,7 @@ static int vty_dump_nodes(struct vty *vty)
* \param[in] ntype Node Type
* \param[cmd] element to be installed
*/
-void install_element(enum node_type ntype, struct cmd_element *cmd)
+void install_element(int ntype, struct cmd_element *cmd)
{
struct cmd_node *cnode;
@@ -1897,7 +1897,7 @@ char **cmd_complete_command(vector vline, struct vty *vty, int *status)
* Note also that this function relies on the is_config_child callback to
* recognize non-config nodes if go_parent_cb is not set.
*/
-enum node_type vty_go_parent(struct vty *vty)
+int vty_go_parent(struct vty *vty)
{
switch (vty->node) {
case AUTH_NODE:
@@ -3319,7 +3319,7 @@ void host_config_set(const char *filename)
host.config = talloc_strdup(tall_vty_cmd_ctx, filename);
}
-void install_default(enum node_type node)
+void install_default(int node)
{
install_element(node, &config_help_cmd);
install_element(node, &config_list_cmd);
@@ -3331,7 +3331,7 @@ void install_default(enum node_type node)
install_element(node, &show_running_config_cmd);
}
-void vty_install_default(enum node_type node)
+void vty_install_default(int node)
{
install_default(node);