diff options
author | Andreas.Eversberg <jolly@eversberg.eu> | 2010-11-20 08:34:31 +0000 |
---|---|---|
committer | Andreas.Eversberg <jolly@eversberg.eu> | 2010-11-20 08:34:31 +0000 |
commit | 8dbf60f5819c584198d2d2ea15186bd4a9dc000f (patch) | |
tree | 9c8e0393fc2db8d815ca02e0e9bc331b66c611bb /src/host | |
parent | f72baf40d5e647ca2d2bb56c4b846d7eb68c471b (diff) |
[layer23] VTY supports "show this" to show current MS node only
Diffstat (limited to 'src/host')
-rw-r--r-- | src/host/layer23/src/mobile/vty_interface.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 59ff76cf..1aad7ce2 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -1015,7 +1015,7 @@ DEFUN(cfg_no_ms, cfg_no_ms_cmd, "no ms MS_NAME", vty_out(vty, " %s%s%s", (set->item) ? "" : "no ", cmd, \ VTY_NEWLINE); -static void config_write_ms_single(struct vty *vty, struct osmocom_ms *ms) +static void config_write_ms(struct vty *vty, struct osmocom_ms *ms) { struct gsm_settings *set = &ms->settings; struct gsm_support *sup = &ms->support; @@ -1168,7 +1168,7 @@ static void config_write_ms_single(struct vty *vty, struct osmocom_ms *ms) vty_out(vty, "!%s", VTY_NEWLINE); } -static int config_write_ms(struct vty *vty) +static int config_write(struct vty *vty) { struct osmocom_ms *ms; @@ -1181,7 +1181,17 @@ static int config_write_ms(struct vty *vty) vty_out(vty, "!%s", VTY_NEWLINE); llist_for_each_entry(ms, &ms_list, entity) - config_write_ms_single(vty, ms); + config_write_ms(vty, ms); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ms_show_this, cfg_ms_show_this_cmd, "show this", + SHOW_STR "Show config of this MS") +{ + struct osmocom_ms *ms = vty->index; + + config_write_ms(vty, ms); return CMD_SUCCESS; } @@ -2268,10 +2278,11 @@ int ms_vty_init(void) install_element(CONFIG_NODE, &cfg_ms_rename_cmd); install_element(CONFIG_NODE, &cfg_no_ms_cmd); install_element(CONFIG_NODE, &ournode_end_cmd); - install_node(&ms_node, config_write_ms); + install_node(&ms_node, config_write); install_default(MS_NODE); install_element(MS_NODE, &ournode_exit_cmd); install_element(MS_NODE, &ournode_end_cmd); + install_element(MS_NODE, &cfg_ms_show_this_cmd); install_element(MS_NODE, &cfg_ms_layer2_cmd); install_element(MS_NODE, &cfg_ms_sap_cmd); install_element(MS_NODE, &cfg_ms_sim_cmd); |