From e575ce69ce3f973e0dd0157acc8853e5ccbe9330 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 11 May 2010 19:07:39 +0800 Subject: nat: Print the MSC status with a new vty command. --- openbsc/src/nat/bsc_nat_vty.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'openbsc/src/nat/bsc_nat_vty.c') diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c index ff6a5ecc0..79b784998 100644 --- a/openbsc/src/nat/bsc_nat_vty.c +++ b/openbsc/src/nat/bsc_nat_vty.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -181,6 +182,22 @@ DEFUN(show_stats, return CMD_SUCCESS; } +DEFUN(show_msc, + show_msc_cmd, + "show msc connection", + SHOW_STR "Show the status of the MSC connection.") +{ + if (!_nat->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", + _nat->msc_con->ip, _nat->msc_con->port, + _nat->msc_con->is_connected, VTY_NEWLINE); + return CMD_SUCCESS; +} + DEFUN(close_bsc, close_bsc_cmd, "close bsc connection BSC_NR", @@ -406,6 +423,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat) install_element(VIEW_NODE, &show_bsc_cfg_cmd); install_element(VIEW_NODE, &show_stats_cmd); install_element(VIEW_NODE, &close_bsc_cmd); + install_element(VIEW_NODE, &show_msc_cmd); openbsc_vty_add_cmds(); -- cgit v1.2.3