Change in osmo-bts[master]: vty: add 'gsmtap-sapi (enable-all|disable-all)' command

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Fri Sep 4 06:06:24 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/19978 )


Change subject: vty: add 'gsmtap-sapi (enable-all|disable-all)' command
......................................................................

vty: add 'gsmtap-sapi (enable-all|disable-all)' command

It's more convenient to use one command to enable/disable sending
of all kinds of UL/DL messages at once, rather than specifying
all of them individually.

Adjust config_write_bts_single(), so it would not print unknown
GSMTAP SAPI entries if gsmtap_sapi_mask is set to UINT32_MAX.

Change-Id: Icd7fce860ecdcf8ffa107bdfee7ec94ea9ea6cb2
---
M src/common/vty.c
1 file changed, 23 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/19978/1

diff --git a/src/common/vty.c b/src/common/vty.c
index 49e6edf..d5993d6 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -251,9 +251,12 @@
 			bts->agch_queue.thresh_level, bts->agch_queue.low_level,
 			bts->agch_queue.high_level, VTY_NEWLINE);
 
-	for (i = 0; i < 32; i++) {
+	for (i = 0; i < sizeof(uint32_t) * 8; i++) {
 		if (gsmtap_sapi_mask & ((uint32_t) 1 << i)) {
-			sapi_buf = osmo_str_tolower(get_value_string(gsmtap_sapi_names, i));
+			sapi_buf = get_value_string_or_null(gsmtap_sapi_names, i);
+			if (sapi_buf == NULL)
+				continue;
+			sapi_buf = osmo_str_tolower(sapi_buf);
 			vty_out(vty, " gsmtap-sapi %s%s", sapi_buf, VTY_NEWLINE);
 		}
 	}
@@ -1410,6 +1413,23 @@
 	"logical channel commands\n"	\
 	"logical channel number\n"
 
+DEFUN(cfg_trx_gsmtap_sapi_all, cfg_trx_gsmtap_sapi_all_cmd,
+	"gsmtap-sapi (enable-all|disable-all)",
+	"Enable/disable sending of UL/DL messages over GSMTAP\n"
+	"Enable all kinds of messages (all SAPI)\n"
+	"Disable all kinds of messages (all SAPI)\n")
+{
+	if (argv[0][0] == 'e') {
+		gsmtap_sapi_mask = UINT32_MAX;
+		gsmtap_sapi_acch = 1;
+	} else {
+		gsmtap_sapi_mask = 0x00;
+		gsmtap_sapi_acch = 0;
+	}
+
+	return CMD_SUCCESS;
+}
+
 DEFUN(cfg_trx_gsmtap_sapi, cfg_trx_gsmtap_sapi_cmd,
 	"HIDDEN", "HIDDEN")
 {
@@ -1721,6 +1741,7 @@
 	install_element(BTS_NODE, &cfg_bts_smscb_tgt_qlen_cmd);
 	install_element(BTS_NODE, &cfg_bts_smscb_qhyst_cmd);
 
+	install_element(BTS_NODE, &cfg_trx_gsmtap_sapi_all_cmd);
 	install_element(BTS_NODE, &cfg_trx_gsmtap_sapi_cmd);
 	install_element(BTS_NODE, &cfg_trx_no_gsmtap_sapi_cmd);
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/19978
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Icd7fce860ecdcf8ffa107bdfee7ec94ea9ea6cb2
Gerrit-Change-Number: 19978
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200904/582157ec/attachment.htm>


More information about the gerrit-log mailing list