From 31d6597c3f088cc94c4e845c368e3417aa585069 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 25 Nov 2011 16:23:43 +0100 Subject: vty: Introduce show mscs to show all mscs --- src/vty_interface_cmds.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/vty_interface_cmds.c b/src/vty_interface_cmds.c index 8c4d71d..8697961 100644 --- a/src/vty_interface_cmds.c +++ b/src/vty_interface_cmds.c @@ -106,20 +106,36 @@ DEFUN(show_msc, show_msc_cmd, "show msc", SHOW_STR "Display the status of the MSC\n") { - struct msc_connection *msc = msc_connection_num(bsc, 0); + struct msc_connection *msc; - if (!msc) { - vty_out(vty, "%%No MSC Connection defined in this app.%s", VTY_NEWLINE); - return CMD_WARNING; + llist_for_each_entry(msc, &bsc->mscs, entry) { + vty_out(vty, "MSC link is %s and had %s.%s", + msc->msc_link_down == 0 ? "up" : "down", + msc->first_contact == 1 ? "no contact" : "contact", + VTY_NEWLINE); } - vty_out(vty, "MSC link is %s and had %s.%s", - msc->msc_link_down == 0 ? "up" : "down", - msc->first_contact == 1 ? "no contact" : "contact", - VTY_NEWLINE); return CMD_SUCCESS; } +DEFUN(show_mscs, show_mscs_cmd, + "show mscs", + SHOW_STR "Display the status of all MSCs\n") +{ + struct msc_connection *msc; + + llist_for_each_entry(msc, &bsc->mscs, entry) { + vty_out(vty, "MSC link nr %d name '%s' is %s and had %s.%s", + msc->nr, msc->name, + msc->msc_link_down == 0 ? "up" : "down", + msc->first_contact == 1 ? "no contact" : "contact", + VTY_NEWLINE); + } + + return CMD_SUCCESS; +} + + DEFUN(show_slc, show_slc_cmd, "show link-set <0-100> slc", SHOW_STR "LinkSet\n" "Linkset nr\n" "SLS to SLC\n") @@ -295,6 +311,7 @@ void cell_vty_init_cmds(void) install_element_ve(&show_slc_cmd); install_element_ve(&show_msc_cmd); + install_element_ve(&show_mscs_cmd); install_element_ve(&show_sctp_count_cmd); install_element_ve(&show_sctp_details_cmd); } -- cgit v1.2.3