aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-03-31 21:40:26 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-04-05 22:33:14 +0200
commitea50732df21442c8d33806d30040d6d81f7aab90 (patch)
tree30625c8da6ef496a767e3385fbf488edc0f08d11 /src/gb
parent793a2907d553095d77d73e8bf7cc132667ee7240 (diff)
Add vty command to explicitly reset given BVCI
It's useful for debugging and is similar to existing reset command for nsvc.
Diffstat (limited to 'src/gb')
-rw-r--r--src/gb/gprs_bssgp_vty.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c
index 080867b5..a3af69b7 100644
--- a/src/gb/gprs_bssgp_vty.c
+++ b/src/gb/gprs_bssgp_vty.c
@@ -33,6 +33,7 @@
#include <osmocom/core/rate_ctr.h>
#include <osmocom/gprs/gprs_ns.h>
#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/gprs/gprs_bssgp_bss.h>
#include <osmocom/vty/vty.h>
#include <osmocom/vty/command.h>
@@ -113,6 +114,24 @@ static void dump_bssgp(struct vty *vty, int stats)
}
}
+DEFUN(bvc_reset, bvc_reset_cmd,
+ "bssgp bvc nsei <0-65535> bvci <0-65535> reset",
+ "Initiate BVC RESET procedure for a given NSEI and BVCI\n")
+{
+ int r;
+ uint16_t nsei = atoi(argv[0]), bvci = atoi(argv[1]);
+ struct bssgp_bvc_ctx *bvc = btsctx_by_bvci_nsei(bvci, nsei);
+ if (!bvc) {
+ vty_out(vty, "No BVC for NSEI %d BVCI %d%s", nsei, bvci,
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ r = bssgp_tx_bvc_reset(bvc, bvci, BSSGP_CAUSE_OML_INTERV);
+ vty_out(vty, "Sent BVC RESET for NSEI %d BVCI %d: %d%s", nsei, bvci, r,
+ VTY_NEWLINE);
+ return CMD_SUCCESS;
+}
+
#define BSSGP_STR "Show information about the BSSGP protocol\n"
DEFUN(show_bssgp, show_bssgp_cmd, "show bssgp",
@@ -185,6 +204,7 @@ int bssgp_vty_init(void)
install_element_ve(&show_bssgp_stats_cmd);
install_element_ve(&show_bvc_cmd);
install_element_ve(&logging_fltr_bvc_cmd);
+ install_element_ve(&bvc_reset_cmd);
install_element(CFG_LOG_NODE, &logging_fltr_bvc_cmd);