[PATCH] osmo-msc[master]: cosmetic: gsm_network_init(): imply default 001-01 PLMN

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
Wed Feb 28 18:30:32 UTC 2018


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

cosmetic: gsm_network_init(): imply default 001-01 PLMN

All callers pass mcc=1, mnc=1, so just have it as default.
(Prepare for net->country_code etc to be replaced by net->plmn)

Change-Id: Ibcd1cc38f170895305ae176a5574384c74a33939
---
M include/osmocom/msc/common_cs.h
M src/libcommon-cs/common_cs.c
M src/osmo-msc/msc_main.c
M tests/msc_vlr/msc_vlr_tests.c
4 files changed, 6 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/03/7003/1

diff --git a/include/osmocom/msc/common_cs.h b/include/osmocom/msc/common_cs.h
index 6dc956f..273a8fe 100644
--- a/include/osmocom/msc/common_cs.h
+++ b/include/osmocom/msc/common_cs.h
@@ -17,10 +17,7 @@
 	uint8_t key[MAX_A5_KEY_LEN];
 };
 
-struct gsm_network *gsm_network_init(void *ctx,
-				     uint16_t country_code,
-				     uint16_t network_code,
-				     mncc_recv_cb_t mncc_recv);
+struct gsm_network *gsm_network_init(void *ctx, mncc_recv_cb_t mncc_recv);
 
 int common_cs_vty_init(struct gsm_network *network,
                  int (* config_write_net )(struct vty *));
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
index a2f5cb3..c64719b 100644
--- a/src/libcommon-cs/common_cs.c
+++ b/src/libcommon-cs/common_cs.c
@@ -37,10 +37,7 @@
  * The long term aim should be to have entirely separate structs for libbsc and
  * libmsc with some common general items.
  */
-struct gsm_network *gsm_network_init(void *ctx,
-				     uint16_t country_code,
-				     uint16_t network_code,
-				     mncc_recv_cb_t mncc_recv)
+struct gsm_network *gsm_network_init(void *ctx, mncc_recv_cb_t mncc_recv)
 {
 	struct gsm_network *net;
 
@@ -48,8 +45,8 @@
 	if (!net)
 		return NULL;
 
-	net->country_code = country_code;
-	net->network_code = network_code;
+	net->country_code = 1;
+	net->network_code = 1;
 	/* Permit a compile-time default of A5/3 and A5/1 */
 	net->a5_encryption_mask = (1 << 3) | (1 << 1);
 
diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c
index da28083..f49c480 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -202,7 +202,7 @@
 struct gsm_network *msc_network_alloc(void *ctx,
 				      mncc_recv_cb_t mncc_recv)
 {
-	struct gsm_network *net = gsm_network_init(ctx, 1, 1, mncc_recv);
+	struct gsm_network *net = gsm_network_init(ctx, mncc_recv);
 	if (!net)
 		return NULL;
 
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index f514286..362f32d 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -845,7 +845,7 @@
 
 struct gsm_network *test_net(void *ctx)
 {
-	struct gsm_network *net = gsm_network_init(ctx, 1, 1, mncc_recv);
+	struct gsm_network *net = gsm_network_init(ctx, mncc_recv);
 
 	net->gsup_server_addr_str = talloc_strdup(net, "no_gsup_server");
 	net->gsup_server_port = 0;

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

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



More information about the gerrit-log mailing list