aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-08-10 06:26:44 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-08-15 12:01:50 +0000
commit54250f9e1f3de5f3bf513383f23bb2d03f10321f (patch)
tree061c7e535aa0332a6fd5e86ee598e19b14f52e8a
parentbb4db869d27cd635492bb5a554351dca6ae30623 (diff)
sctp: Add VTY command to print details about active SCTP connections
This will print details about each SCTP connection including the FD and pointer of it.
-rw-r--r--src/vty_interface_cmds.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/vty_interface_cmds.c b/src/vty_interface_cmds.c
index 6e4f17c..18b1505 100644
--- a/src/vty_interface_cmds.c
+++ b/src/vty_interface_cmds.c
@@ -252,15 +252,32 @@ DEFUN(allow_inject, allow_inject_cmd,
return CMD_SUCCESS;
}
-DEFUN(show_sctp, show_sctp_cmd,
- "show sctp-connections",
- SHOW_STR "Active SCTP connections\n")
+DEFUN(show_sctp_count, show_sctp_count_cmd,
+ "show sctp-connections count",
+ SHOW_STR "Number of SCTP connections\n")
{
int count = sctp_m2ua_conn_count(bsc->m2ua_trans);
vty_out(vty, "Active SCTP connections are: %d.%s", count, VTY_NEWLINE);
return CMD_SUCCESS;
}
+DEFUN(show_sctp_details, show_sctp_details_cmd,
+ "show sctp-connections details",
+ SHOW_STR "Details of SCTP connections\n")
+{
+ struct sctp_m2ua_conn *conn;
+
+ llist_for_each_entry(conn, &bsc->m2ua_trans->conns, entry) {
+ vty_out(vty,
+ "SCTP Conn ASP UP: %d, ident: %d,%d,%d,%d fd: %d ptr: %p.%s",
+ conn->asp_up, conn->asp_ident[0], conn->asp_ident[1],
+ conn->asp_ident[2], conn->asp_ident[3],
+ conn->queue.bfd.fd, conn, VTY_NEWLINE);
+ }
+
+ return CMD_WARNING;
+}
+
void cell_vty_init_cmds(void)
{
/* special commands */
@@ -277,5 +294,6 @@ void cell_vty_init_cmds(void)
install_element_ve(&show_slc_cmd);
install_element_ve(&show_msc_cmd);
- install_element_ve(&show_sctp_cmd);
+ install_element_ve(&show_sctp_count_cmd);
+ install_element_ve(&show_sctp_details_cmd);
}