aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_vty.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-08-16 16:48:07 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-08-24 15:42:37 +0200
commit070b2c66510eb2079c56a8f4a13130f494fd44be (patch)
treedef3bb812ed82e3a5b1629947f44ee4182636aa0 /openbsc/src/libbsc/bsc_vty.c
parent3f08ccfe79edfa75c6e0f7eb2068b6cc5014808a (diff)
osmo-bsc: fix handover (signalling only) and add VTX command to trigger
Add VTY commands to trigger a handover of an lchan/subscriber connection. Fix assertion problem / crash
Diffstat (limited to 'openbsc/src/libbsc/bsc_vty.c')
-rw-r--r--openbsc/src/libbsc/bsc_vty.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 554b55298..159ec8277 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -56,6 +56,7 @@
#include <openbsc/pcu_if.h>
#include <openbsc/common_cs.h>
#include <openbsc/vlr.h>
+#include <openbsc/handover.h>
#include <inttypes.h>
@@ -1344,6 +1345,83 @@ DEFUN(show_lchan_summary,
return lchan_summary(vty, argc, argv, lchan_dump_short_vty);
}
+DEFUN(show_subscr_conn,
+ show_subscr_conn_cmd,
+ "show conns",
+ SHOW_STR "Display currently active subscriber connections\n")
+{
+ struct gsm_subscriber_connection *conn;
+ struct gsm_network *net = gsmnet_from_vty(vty);
+ bool no_conns = true;
+ unsigned int count = 0;
+
+ vty_out(vty, "Active subscriber connections: %s", VTY_NEWLINE);
+
+ llist_for_each_entry(conn, &net->subscr_conns, entry) {
+ vty_out(vty, "conn nr #%u:%s", count, VTY_NEWLINE);
+ lchan_dump_full_vty(vty, conn->lchan);
+ no_conns = false;
+ count++;
+ }
+
+ if (no_conns)
+ vty_out(vty, "None%s", VTY_NEWLINE);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(handover_subscr_conn,
+ handover_subscr_conn_cmd,
+ "handover conn-nr CONN_NR bts BTS",
+ "Handover subscriber connection\n"
+ "Subscriber connection index\n" "index\n" "BTS to handover to\n" "BTS\n")
+{
+ struct gsm_subscriber_connection *conn;
+ struct gsm_network *net = gsmnet_from_vty(vty);
+ unsigned int count = 0;
+ unsigned int conn_nr = atoi(argv[0]);
+ unsigned int bts_nr = atoi(argv[1]);
+ struct gsm_lchan *lchan;
+ struct gsm_bts *bts;
+ struct gsm_bts *new_bts = NULL;
+
+ /* Lookup the BTS where we want to handover to */
+ llist_for_each_entry(bts, &net->bts_list, list) {
+ if (bts->nr == bts_nr) {
+ new_bts = bts;
+ break;
+ }
+ }
+
+ if (!new_bts) {
+ vty_out(vty, "Unable to trigger handover,"
+ "specified bts #%u does not exist%s", bts_nr,
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ /* Find the connection/lchan that we want to handover */
+ llist_for_each_entry(conn, &net->subscr_conns, entry) {
+ if (count == conn_nr) {
+ lchan = conn->lchan;
+ bts = conn->bts;
+
+ vty_out(vty, "starting handover for conn nr #%u...%s",
+ count, VTY_NEWLINE);
+ lchan_dump_full_vty(vty, lchan);
+ bsc_handover_start(lchan, new_bts);
+ return CMD_SUCCESS;
+ }
+ count++;
+ }
+
+ vty_out(vty, "Unable to trigger handover,"
+ "specified connection #%u does not exist%s", conn_nr,
+ VTY_NEWLINE);
+
+ return CMD_WARNING;
+}
+
static void paging_dump_vty(struct vty *vty, struct gsm_paging_request *pag)
{
vty_out(vty, "Paging on BTS %u%s", pag->bts->nr, VTY_NEWLINE);
@@ -4105,6 +4183,9 @@ int bsc_vty_init(struct gsm_network *network)
install_element_ve(&show_lchan_cmd);
install_element_ve(&show_lchan_summary_cmd);
+ install_element_ve(&show_subscr_conn_cmd);
+ install_element_ve(&handover_subscr_conn_cmd);
+
install_element_ve(&show_paging_cmd);
install_element_ve(&show_paging_group_cmd);