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-10 06:37:35 +0200
commitcf60a01cd052faf7181aa3adce5c97fd31e5c5ef (patch)
tree42678856bea5315f973d2183bc1d15c7c6e1a7da
parentf2312cb04c55b074dfe908b336fc19439f60b7d3 (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 56b8ada..8c4d71d 100644
--- a/src/vty_interface_cmds.c
+++ b/src/vty_interface_cmds.c
@@ -253,15 +253,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 */
@@ -278,5 +295,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);
}