aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-11 19:59:28 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-11 20:00:22 +0800
commitd6238120dd94aeb0f6b03e6e065faf14ff5f5e3c (patch)
treea52e7b22a5c7cfa3726d22a464a48fa80921703a
parent7407aec9218f0f8555889663524289e5ba4c1961 (diff)
bsc_msc_ip: Add an extra command to show the MSC status.
-rw-r--r--openbsc/src/bsc_msc_ip.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c
index ece817f1..8bb50eb9 100644
--- a/openbsc/src/bsc_msc_ip.c
+++ b/openbsc/src/bsc_msc_ip.c
@@ -47,6 +47,8 @@
#include <openbsc/bsc_nat.h>
#include <openbsc/bsc_msc_rf.h>
+#include <vty/command.h>
+
#include <osmocore/select.h>
#include <osmocore/talloc.h>
#include <osmocore/write_queue.h>
@@ -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);
+}