aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-16 02:17:43 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-16 02:49:12 +0800
commitc93c5238727f7ce7a19bbe8b966ef05551eef0c6 (patch)
treeac9512b14b79c70994d6d1eeac2e7a5087fb9200 /openbsc
parented1c872352040e2699766562e6c05d68d917fc7a (diff)
[bsc_msc_ip] Move the command to the right place
Apparently I could not find the vty_interface_bsc.c when I was searching for it. Move an extra BSC command into that file.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/bsc_msc_ip.c28
-rw-r--r--openbsc/src/vty_interface_bsc.c20
2 files changed, 20 insertions, 28 deletions
diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c
index 34e4fe34..0166a76c 100644
--- a/openbsc/src/bsc_msc_ip.c
+++ b/openbsc/src/bsc_msc_ip.c
@@ -47,8 +47,6 @@
#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>
@@ -78,9 +76,6 @@ 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()
{
return &active_connections;
@@ -1244,8 +1239,6 @@ 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;
@@ -1262,24 +1255,3 @@ int main(int argc, char **argv)
}
}
-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);
-}
diff --git a/openbsc/src/vty_interface_bsc.c b/openbsc/src/vty_interface_bsc.c
index 06ef75e2..abbba2eb 100644
--- a/openbsc/src/vty_interface_bsc.c
+++ b/openbsc/src/vty_interface_bsc.c
@@ -27,6 +27,7 @@
#include <vty/vty.h>
#include <openbsc/gsm_data.h>
+#include <openbsc/bsc_msc.h>
#include <openbsc/vty.h>
#include <sccp/sccp.h>
@@ -63,6 +64,24 @@ 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 (!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",
+ gsmnet->msc_con->ip, gsmnet->msc_con->port,
+ gsmnet->msc_con->is_connected, VTY_NEWLINE);
+
+ return CMD_SUCCESS;
+}
+
+
int bsc_vty_init_extra(struct gsm_network *net)
{
gsmnet = net;
@@ -70,6 +89,7 @@ int bsc_vty_init_extra(struct gsm_network *net)
/* get runtime information */
install_element(VIEW_NODE, &show_bsc_cmd);
install_element(VIEW_NODE, &show_stats_cmd);
+ install_element(VIEW_NODE, &show_msc_cmd);
return 0;
}