aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/vty_interface_layer3.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-11-11 10:58:51 +0100
committerHarald Welte <laforge@gnumonks.org>2015-01-01 13:03:03 +0100
commitb4771a6871efb3cf12b371aedc575912984ca528 (patch)
treecfda932aa489b0ec304ceac51f2a6b123191714d /openbsc/src/libmsc/vty_interface_layer3.c
parent7ff77ec713c6569715077344563ff9ab1719619c (diff)
Initial support for export + curses-visualization of measurements
This extends osmo_nitb to offer a UDP feed of real-time measurement reports, which can be used by (a variety of) external tools for visualization or other processing. We also add a small ncurses based tool (meas_vis) which shows a baragraph display of the last few mobile stations that were active, indicating their uplink/downlink receive level and quality. <WARNING> This sends non-portable structures like gsm_meas_rep over UDP and assumes the receiver has identical alignment and endianness! Before this feature is merged, it either needs to be converted to a unix domain socket (but they don't do multicast, which would be nice) or the wire format needs to change into something portable with defined alignment and encoding </WARNING>
Diffstat (limited to 'openbsc/src/libmsc/vty_interface_layer3.c')
-rw-r--r--openbsc/src/libmsc/vty_interface_layer3.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index f9213f542..06ef2d1ae 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -49,6 +49,8 @@
#include <openbsc/mncc_int.h>
#include <openbsc/handover.h>
+#include "meas_feed.h"
+
extern struct gsm_network *gsmnet_from_vty(struct vty *v);
static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr, int pending)
@@ -947,6 +949,11 @@ static const struct value_string tchh_codec_names[] = {
static int config_write_mncc_int(struct vty *vty)
{
+ uint16_t meas_port;
+ char *meas_host;
+
+ meas_feed_cfg_get(&meas_host, &meas_port);
+
vty_out(vty, "mncc-int%s", VTY_NEWLINE);
vty_out(vty, " default-codec tch-f %s%s",
get_value_string(tchf_codec_names, mncc_int.def_codec[0]),
@@ -954,6 +961,10 @@ static int config_write_mncc_int(struct vty *vty)
vty_out(vty, " default-codec tch-h %s%s",
get_value_string(tchh_codec_names, mncc_int.def_codec[1]),
VTY_NEWLINE);
+ if (meas_port)
+ vty_out(vty, " meas-feed destination %s %u%s",
+ meas_host, meas_port, VTY_NEWLINE);
+
return CMD_SUCCESS;
}
@@ -994,6 +1005,28 @@ DEFUN_DEPRECATED(log_level_sms, log_level_sms_cmd,
return CMD_SUCCESS;
}
+DEFUN(mnccint_meas_feed, mnccint_meas_feed_cmd,
+ "meas-feed destination ADDR <0-65535>",
+ "FIXME")
+{
+ int rc;
+
+ rc = meas_feed_cfg_set(argv[0], atoi(argv[1]));
+ if (rc < 0)
+ return CMD_WARNING;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(meas_feed_scenario, meas_feed_scenario_cmd,
+ "meas-feed scenario NAME",
+ "FIXME")
+{
+ meas_feed_scenario_set(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
int bsc_vty_init_extra(void)
{
osmo_signal_register_handler(SS_SCALL, scall_cbfn, NULL);
@@ -1028,12 +1061,14 @@ int bsc_vty_init_extra(void)
install_element(ENABLE_NODE, &smsqueue_clear_cmd);
install_element(ENABLE_NODE, &smsqueue_fail_cmd);
install_element(ENABLE_NODE, &subscriber_send_pending_sms_cmd);
+ install_element(ENABLE_NODE, &meas_feed_scenario_cmd);
install_element(CONFIG_NODE, &cfg_mncc_int_cmd);
install_node(&mncc_int_node, config_write_mncc_int);
vty_install_default(MNCC_INT_NODE);
install_element(MNCC_INT_NODE, &mnccint_def_codec_f_cmd);
install_element(MNCC_INT_NODE, &mnccint_def_codec_h_cmd);
+ install_element(MNCC_INT_NODE, &mnccint_meas_feed_cmd);
install_element(CFG_LOG_NODE, &log_level_sms_cmd);