aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-11-25 16:23:43 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-11-25 16:52:41 +0100
commit559ecb75df253879c34f4bbd6eeb47646e4429b5 (patch)
tree5cfdb6fe049a67d1abc4f40908ab8af586aeff2a
parentbfedfa5fb8d21043fbc5fec988df706c14292b1b (diff)
vty: Introduce show mscs to show all mscs
-rw-r--r--src/vty_interface_cmds.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/vty_interface_cmds.c b/src/vty_interface_cmds.c
index 18b1505..7f285d0 100644
--- a/src/vty_interface_cmds.c
+++ b/src/vty_interface_cmds.c
@@ -105,20 +105,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")
@@ -294,6 +310,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);
}