[PATCH] openbsc[master]: mscsplit: abis vty: decouple from global bsc_gsmnet variable

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Sep 22 18:56:17 UTC 2016


Review at  https://gerrit.osmocom.org/925

mscsplit: abis vty: decouple from global bsc_gsmnet variable

Publish gsmnet_from_vty() in openbsc/vty.h and use in the abis VTY functions.

Change-Id: Ib65a18db06b8bc4fc7d56bf56dd64a52cc1cd253
---
M openbsc/include/openbsc/vty.h
M openbsc/src/libbsc/abis_nm_vty.c
M openbsc/src/libbsc/abis_om2000_vty.c
3 files changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/25/925/1

diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h
index 78e87f0..315db0d 100644
--- a/openbsc/include/openbsc/vty.h
+++ b/openbsc/include/openbsc/vty.h
@@ -46,4 +46,6 @@
 int bsc_vty_init(const struct log_info *cat, struct gsm_network *network);
 int bsc_vty_init_extra(void);
 
+struct gsm_network *gsmnet_from_vty(struct vty *vty);
+
 #endif
diff --git a/openbsc/src/libbsc/abis_nm_vty.c b/openbsc/src/libbsc/abis_nm_vty.c
index a14e5c2..6ec0a4a 100644
--- a/openbsc/src/libbsc/abis_nm_vty.c
+++ b/openbsc/src/libbsc/abis_nm_vty.c
@@ -94,7 +94,7 @@
 	struct oml_node_state *oms;
 	int bts_nr = atoi(argv[0]);
 
-	bts = gsm_bts_num(bsc_gsmnet, bts_nr);
+	bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr);
 	if (!bts) {
 		vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE);
 		return CMD_WARNING;
@@ -128,7 +128,7 @@
 	struct oml_node_state *oms;
 	int bts_nr = atoi(argv[0]);
 
-	bts = gsm_bts_num(bsc_gsmnet, bts_nr);
+	bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr);
 	if (!bts) {
 		vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE);
 		return CMD_WARNING;
diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c
index 8325e29..72422a1 100644
--- a/openbsc/src/libbsc/abis_om2000_vty.c
+++ b/openbsc/src/libbsc/abis_om2000_vty.c
@@ -82,7 +82,7 @@
 	struct oml_node_state *oms;
 	int bts_nr = atoi(argv[0]);
 
-	bts = gsm_bts_num(bsc_gsmnet, bts_nr);
+	bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr);
 	if (!bts) {
 		vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE);
 		return CMD_WARNING;
@@ -122,7 +122,7 @@
 	struct oml_node_state *oms;
 	int bts_nr = atoi(argv[0]);
 
-	bts = gsm_bts_num(bsc_gsmnet, bts_nr);
+	bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr);
 	if (!bts) {
 		vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE);
 		return CMD_WARNING;

-- 
To view, visit https://gerrit.osmocom.org/925
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib65a18db06b8bc4fc7d56bf56dd64a52cc1cd253
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list