diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-11 19:07:39 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-11 20:00:16 +0800 |
commit | e575ce69ce3f973e0dd0157acc8853e5ccbe9330 (patch) | |
tree | 53beb95947c26d474f860b23a97f4c62c7ec3a00 /openbsc/src/nat/bsc_nat_vty.c | |
parent | c1ca0ff0910b36222f14d07ca8e8b14d3ea33cc0 (diff) |
nat: Print the MSC status with a new vty command.
Diffstat (limited to 'openbsc/src/nat/bsc_nat_vty.c')
-rw-r--r-- | openbsc/src/nat/bsc_nat_vty.c | 18 |
1 files changed, 18 insertions, 0 deletions
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 <vty/vty.h> #include <openbsc/bsc_nat.h> +#include <openbsc/bsc_msc.h> #include <openbsc/gsm_04_08.h> #include <openbsc/mgcp.h> #include <openbsc/vty.h> @@ -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(); |