diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2013-10-29 09:30:30 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-10-30 15:19:00 +0100 |
commit | 36722e13daa0be478cba2cf020e5fe80a6218ac2 (patch) | |
tree | 30c46db022f212f5d35183526114571a30a82af7 /openbsc/src/libcommon/common_vty.c | |
parent | fc7a75f5df7c0fe3aee755fb08b7b424fb6a2495 (diff) |
vty: Use vty_install_default() instead of bsc_install_default()
Remove ournode_exit_cmd, ournode_end_cmd, and bsc_install_default()
since this functionality is provided by the current libosmocore.
Replace calls to bsc_install_default() by call to
vty_install_default() with the following semantic patch:
@rule1@
expression N;
@@
- bsc_install_default(N);
+ vty_install_default(N);
Ticket: OW#952
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/libcommon/common_vty.c')
-rw-r--r-- | openbsc/src/libcommon/common_vty.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c index 0bf43b00f..3f8f16f7d 100644 --- a/openbsc/src/libcommon/common_vty.c +++ b/openbsc/src/libcommon/common_vty.c @@ -118,40 +118,6 @@ enum node_type bsc_vty_go_parent(struct vty *vty) return vty->node; } -/* Down vty node level. */ -gDEFUN(ournode_exit, - ournode_exit_cmd, "exit", "Exit current mode and down to previous mode\n") -{ - bsc_vty_go_parent (vty); - return CMD_SUCCESS; -} - -/* End of configuration. */ -gDEFUN(ournode_end, - ournode_end_cmd, "end", "End current mode and change to enable mode.") -{ - enum node_type last_node = CONFIG_NODE; - - if (vty->node > ENABLE_NODE) { - /* Repeatedly call go_parent until a top node is reached. */ - while (vty->node > CONFIG_NODE) { - if (vty->node == last_node) { - /* Ensure termination, this shouldn't happen. */ - break; - } - last_node = vty->node; - bsc_vty_go_parent(vty); - } - - vty_config_unlock(vty); - if (vty->node > ENABLE_NODE) - vty->node = ENABLE_NODE; - vty->index = NULL; - vty->index_sub = NULL; - } - return CMD_SUCCESS; -} - int bsc_vty_is_config_node(struct vty *vty, int node) { switch (node) { @@ -174,13 +140,3 @@ void bsc_replace_string(void *ctx, char **dst, const char *newstr) talloc_free(*dst); *dst = talloc_strdup(ctx, newstr); } - -void bsc_install_default(enum node_type node) -{ - install_default (node); - - if (node > CONFIG_NODE) { - install_element(node, &ournode_exit_cmd); - install_element(node, &ournode_end_cmd); - } -} |