resurrect meas_feed.c: vty, vty-test

At this point, meas-feed is usable again, however, osmo-bsc is not able to
include the IMSI in every report like osmo-nitb did.

In consequence, the meas-vis and meas-web tools are unable to handle the
current measurement reports: these so far use the IMSI to list reports, and all
reports without an IMSI are collapsed onto the same line, swapping values.

So though osmo-bsc now sends usable measurement reports via meas-feed, two
avenues to improve should be pursued:

OS#3192: the visualization tools should use bts,ts,ss numbers, not IMSI.
OS#2969: osmo-bsc should always know a mobile identity.

Related: OS#2968
Change-Id: I186c7a995dd2b81746c32a58b55da64ed195a1ce
This commit is contained in:
Neels Hofmeyr 2018-04-20 15:53:53 +02:00 committed by Neels Hofmeyr
parent ad7277073c
commit f28f1ef9af
3 changed files with 69 additions and 3 deletions

View File

@ -1,5 +1,4 @@
#ifndef _OPENBSC_MEAS_FEED_H
#define _OPENBSC_MEAS_FEED_H
#pragma once
#include <stdint.h>
@ -37,5 +36,8 @@ enum meas_feed_msgtype {
#define MEAS_FEED_VERSION 1
int meas_feed_cfg_set(const char *dst_host, uint16_t dst_port);
void meas_feed_scenario_set(const char *name);
#endif
void meas_feed_cfg_get(char **host, uint16_t *port);
const char *meas_feed_scenario_get(void);

View File

@ -61,6 +61,7 @@
#include <osmocom/bsc/handover_vty.h>
#include <osmocom/bsc/gsm_04_08_utils.h>
#include <osmocom/bsc/acc_ramp.h>
#include <osmocom/bsc/meas_feed.h>
#include <inttypes.h>
@ -1017,6 +1018,22 @@ static int config_write_net(struct vty *vty)
vty_out(vty, " periodic location update %u%s",
gsmnet->t3212 * 6, VTY_NEWLINE);
{
uint16_t meas_port;
char *meas_host;
const char *meas_scenario;
meas_feed_cfg_get(&meas_host, &meas_port);
meas_scenario = meas_feed_scenario_get();
if (meas_port)
vty_out(vty, " meas-feed destination %s %u%s",
meas_host, meas_port, VTY_NEWLINE);
if (strlen(meas_scenario) > 0)
vty_out(vty, " meas-feed scenario %s%s",
meas_scenario, VTY_NEWLINE);
}
return CMD_SUCCESS;
}
@ -4699,6 +4716,32 @@ DEFUN(cfg_net_no_per_loc_upd, cfg_net_no_per_loc_upd_cmd,
return CMD_SUCCESS;
}
#define MEAS_FEED_STR "Measurement Report export\n"
DEFUN(cfg_net_meas_feed_dest, cfg_net_meas_feed_dest_cmd,
"meas-feed destination ADDR <0-65535>",
MEAS_FEED_STR "Where to forward Measurement Report feeds\n" "address or hostname\n" "port number\n")
{
int rc;
const char *host = argv[0];
uint16_t port = atoi(argv[1]);
rc = meas_feed_cfg_set(host, port);
if (rc < 0)
return CMD_WARNING;
return CMD_SUCCESS;
}
DEFUN(cfg_net_meas_feed_scenario, cfg_net_meas_feed_scenario_cmd,
"meas-feed scenario NAME",
MEAS_FEED_STR "Set a name to include in the Measurement Report feeds\n" "Name string, up to 31 characters\n")
{
meas_feed_scenario_set(argv[0]);
return CMD_SUCCESS;
}
extern int bsc_vty_init_extra(void);
int bsc_vty_init(struct gsm_network *network)
@ -4741,6 +4784,8 @@ int bsc_vty_init(struct gsm_network *network)
install_element(GSMNET_NODE, &cfg_net_per_loc_upd_cmd);
install_element(GSMNET_NODE, &cfg_net_no_per_loc_upd_cmd);
install_element(GSMNET_NODE, &cfg_net_dyn_ts_allow_tch_f_cmd);
install_element(GSMNET_NODE, &cfg_net_meas_feed_dest_cmd);
install_element(GSMNET_NODE, &cfg_net_meas_feed_scenario_cmd);
install_element_ve(&bsc_show_net_cmd);
install_element_ve(&show_bts_cmd);

19
tests/osmo-bsc.vty Normal file
View File

@ -0,0 +1,19 @@
OsmoBSC> enable
OsmoBSC# configure terminal
OsmoBSC(config)# network
OsmoBSC(config-net)# list
...
meas-feed destination ADDR <0-65535>
meas-feed scenario NAME
...
OsmoBSC(config-net)# meas-feed destination 127.0.0.23 4223
OsmoBSC(config-net)# meas-feed scenario foo23
OsmoBSC(config-net)# show running-config
...
network
...
meas-feed destination 127.0.0.23 4223
meas-feed scenario foo23
...