From d6238120dd94aeb0f6b03e6e065faf14ff5f5e3c Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 11 May 2010 19:59:28 +0800 Subject: bsc_msc_ip: Add an extra command to show the MSC status. --- openbsc/src/bsc_msc_ip.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c index ece817f1d..8bb50eb9a 100644 --- a/openbsc/src/bsc_msc_ip.c +++ b/openbsc/src/bsc_msc_ip.c @@ -47,6 +47,8 @@ #include #include +#include + #include #include #include @@ -75,6 +77,8 @@ static struct timer_list msc_pong_timeout; extern int bsc_bootstrap_network(int (*layer4)(struct gsm_network *, int, void *), const char *cfg_file); extern int bsc_shutdown_net(struct gsm_network *net); +static void install_extra_commands(); + struct llist_head *bsc_sccp_connections() { @@ -1221,6 +1225,8 @@ int main(int argc, char **argv) exit(1); } + install_extra_commands(); + msc_ping_timeout.cb = msc_ping_timeout_cb; msc_pong_timeout.cb = msc_pong_timeout_cb; @@ -1236,3 +1242,25 @@ int main(int argc, char **argv) bsc_select_main(0); } } + +DEFUN(show_msc, + show_msc_cmd, + "show msc connection", + SHOW_STR "Show the status of the MSC connection.") +{ + if (!bsc_gsmnet->msc_con) { + vty_out(vty, "The MSC is not yet configured.\n"); + return CMD_WARNING; + } + + vty_out(vty, "MSC on %s:%d is connected: %d%s\n", + bsc_gsmnet->msc_con->ip, bsc_gsmnet->msc_con->port, + bsc_gsmnet->msc_con->is_connected, VTY_NEWLINE); + + return CMD_SUCCESS; +} + +static void install_extra_commands() +{ + install_element(VIEW_NODE, &show_msc_cmd); +} -- cgit v1.2.3