diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-24 21:13:56 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-24 21:20:34 +0100 |
commit | 3c2b84c6074a9a07d53950a3f3ac24d867f042ac (patch) | |
tree | 3f00c9f2bdb85e54a08c23f5a071a19325aa24d3 | |
parent | 326a1f7310dbb7b8f0ad941e71414659e68fc610 (diff) |
vty: Show the SLC mapping of a linkset
-rw-r--r-- | src/vty_interface.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/vty_interface.c b/src/vty_interface.c index 91b9d5c..531fd27 100644 --- a/src/vty_interface.c +++ b/src/vty_interface.c @@ -362,6 +362,36 @@ DEFUN(show_msc, show_msc_cmd, return CMD_SUCCESS; } +DEFUN(show_slc, show_slc_cmd, + "show link-set (mtp|m2ua) slc", + SHOW_STR "LinkSet\n" "MTP Linkset\n" "M2UA LinkSet\n" "SLS to SLC\n") +{ + struct mtp_link_set *set = NULL; + int i; + + if (bsc.link_set && strcmp(argv[0], "mtp") == 0) + set = bsc.link_set; + else if (bsc.m2ua_set && strcmp(argv[0], "m2ua") == 0) + set = bsc.m2ua_set; + + if (!set) { + vty_out(vty, "Failed to find linkset.%s", VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "LinkSet for %s.%s", argv[0], VTY_NEWLINE); + for (i = 0; i < ARRAY_SIZE(set->slc); ++i) { + if (set->slc[i]) + vty_out(vty, " SLC[%.2d] is on link %d.%s", + i, set->slc[i]->link_no, VTY_NEWLINE); + else + vty_out(vty, " SLC[%d] is down.%s", + i, VTY_NEWLINE); + } + + return CMD_SUCCESS; +} + DEFUN(pcap_set, pcap_set_cmd, "trace-pcap set (m2ua|mtp) FILE", "Trace to a PCAP file\n" "Trace a linkset\n" @@ -513,6 +543,7 @@ void cell_vty_init(void) /* show commands */ install_element_ve(&show_stats_cmd); install_element_ve(&show_linksets_cmd); + install_element_ve(&show_slc_cmd); if (bsc.app != APP_STP) { install_element_ve(&show_msc_cmd); |