aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/vty.c
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-03-20 10:30:33 +0100
committerosmith <osmith@sysmocom.de>2020-03-24 08:01:05 +0000
commitae4d85d891c6fde179f16db7eed0b6e3fa468705 (patch)
treee3653d8a86047f9b44c8002dc31308639b322fe9 /src/common/vty.c
parentdbb5addf7de034911f2ef0c6f5d457b4a2735084 (diff)
VTY: add "test send-failure-event-report"
Send test failure event report OML message to the BSC. I found this useful while manually testing related handling code in OsmoBSC. Related: OS#1605 Change-Id: I0c4eba1636d8faf5012db26643bdf1d9fb6bfa1e
Diffstat (limited to 'src/common/vty.c')
-rw-r--r--src/common/vty.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/common/vty.c b/src/common/vty.c
index ab38dc19..2cf32246 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -928,6 +928,25 @@ DEFUN(show_bts, show_bts_cmd, "show bts <0-255>",
return CMD_SUCCESS;
}
+DEFUN(test_send_failure_event_report, test_send_failure_event_report_cmd, "test send-failure-event-report <0-255>",
+ "Various testing commands\n"
+ "Send a test OML failure event report to the BSC\n" BTS_NR_STR)
+{
+ struct gsm_network *net = gsmnet_from_vty(vty);
+ int bts_nr = atoi(argv[0]);
+ struct gsm_bts *bts;
+
+ if (bts_nr >= net->num_bts) {
+ vty_out(vty, "%% can't find BTS '%s'%s", argv[0], VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ bts = gsm_bts_num(net, bts_nr);
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MINOR, OSMO_EVT_WARN_SW_WARN, "test message sent from VTY");
+
+ return CMD_SUCCESS;
+}
+
static void trx_dump_vty(struct vty *vty, struct gsm_bts_trx *trx)
{
vty_out(vty, "TRX %u of BTS %u is on ARFCN %u%s",
@@ -1716,6 +1735,7 @@ int bts_vty_init(struct gsm_bts *bts)
install_element(ENABLE_NODE, &bts_t_t_l_jitter_buf_cmd);
install_element(ENABLE_NODE, &bts_t_t_l_loopback_cmd);
install_element(ENABLE_NODE, &no_bts_t_t_l_loopback_cmd);
+ install_element(ENABLE_NODE, &test_send_failure_event_report_cmd);
install_element(CONFIG_NODE, &cfg_phy_cmd);
install_node(&phy_node, config_write_phy);