[PATCH] osmo-bsc[master]: cosmetic: bsc_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
Mon Mar 5 14:05:29 UTC 2018


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6963

to look at the new patch set (#6).

cosmetic: bsc_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: Ic16bc0bab3f2d4721e86a1a04f9d9f988d777df2
---
M include/osmocom/bsc/common_bsc.h
M src/ipaccess/ipaccess-config.c
M src/libbsc/bsc_init.c
M src/libbsc/net_init.c
M src/utils/bs11_config.c
M tests/bsc/bsc_test.c
M tests/bssap/bssap_test.c
M tests/channel/channel_test.c
M tests/gsm0408/gsm0408_test.c
M tests/handover/handover_test.c
10 files changed, 14 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/63/6963/6

diff --git a/include/osmocom/bsc/common_bsc.h b/include/osmocom/bsc/common_bsc.h
index d3c7ff5..c23d20c 100644
--- a/include/osmocom/bsc/common_bsc.h
+++ b/include/osmocom/bsc/common_bsc.h
@@ -2,6 +2,4 @@
 
 #include <stdint.h>
 
-struct gsm_network *bsc_network_init(void *ctx,
-				     uint16_t country_code,
-				     uint16_t network_code);
+struct gsm_network *bsc_network_init(void *ctx);
diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c
index 7e8cafd..a1985b7 100644
--- a/src/ipaccess/ipaccess-config.c
+++ b/src/ipaccess/ipaccess-config.c
@@ -992,7 +992,7 @@
 	}
 	libosmo_abis_init(tall_ctx_config);
 
-	bsc_gsmnet = bsc_network_init(tall_bsc_ctx, 1, 1);
+	bsc_gsmnet = bsc_network_init(tall_bsc_ctx);
 	if (!bsc_gsmnet)
 		exit(1);
 
diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c
index 2fddc80..a2f0504 100644
--- a/src/libbsc/bsc_init.c
+++ b/src/libbsc/bsc_init.c
@@ -547,7 +547,7 @@
 int bsc_network_alloc(void)
 {
 	/* initialize our data structures */
-	bsc_gsmnet = bsc_network_init(tall_bsc_ctx, 1, 1);
+	bsc_gsmnet = bsc_network_init(tall_bsc_ctx);
 	if (!bsc_gsmnet)
 		return -ENOMEM;
 
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index 2f65a52..e44c335 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -22,6 +22,7 @@
 #include <osmocom/bsc/gsm_04_08_utils.h>
 #include <osmocom/bsc/handover_cfg.h>
 #include <osmocom/bsc/chan_alloc.h>
+#include <osmocom/bsc/common_bsc.h>
 
 /* XXX hard-coded for now */
 #define T3122_CHAN_LOAD_SAMPLE_INTERVAL 1 /* in seconds */
@@ -38,9 +39,7 @@
 	osmo_timer_schedule(&net->t3122_chan_load_timer, T3122_CHAN_LOAD_SAMPLE_INTERVAL, 0);
 }
 
-struct gsm_network *bsc_network_init(void *ctx,
-				     uint16_t country_code,
-				     uint16_t network_code)
+struct gsm_network *bsc_network_init(void *ctx)
 {
 	struct gsm_network *net;
 
@@ -48,8 +47,9 @@
 	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/utils/bs11_config.c b/src/utils/bs11_config.c
index 8e947eb..bc0f488 100644
--- a/src/utils/bs11_config.c
+++ b/src/utils/bs11_config.c
@@ -915,7 +915,7 @@
 	handle_options(argc, argv);
 	bts_model_bs11_init();
 
-	gsmnet = bsc_network_init(tall_bs11cfg_ctx, 1, 1);
+	gsmnet = bsc_network_init(tall_bs11cfg_ctx);
 	if (!gsmnet) {
 		fprintf(stderr, "Unable to allocate gsm network\n");
 		exit(1);
diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c
index 9c35d2f..541a44c 100644
--- a/tests/bsc/bsc_test.c
+++ b/tests/bsc/bsc_test.c
@@ -122,7 +122,7 @@
 {
 	int i;
 
-	struct gsm_network *net = bsc_network_init(NULL, 1, 1);
+	struct gsm_network *net = bsc_network_init(NULL);
 	struct gsm_bts *bts = gsm_bts_alloc(net, 0);
 	struct bsc_msc_data *msc;
 	struct gsm_subscriber_connection *conn;
diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c
index ad8974f..cf60e38 100644
--- a/tests/bssap/bssap_test.c
+++ b/tests/bssap/bssap_test.c
@@ -89,7 +89,7 @@
 	struct bsc_msc_data *msc;
 	struct gsm_bts *bts;
 
-	bsc_gsmnet = bsc_network_init(NULL, 1, 1);
+	bsc_gsmnet = bsc_network_init(NULL);
 	bsc_gsmnet->bsc_data->rf_ctrl = talloc_zero(NULL, struct osmo_bsc_rf);
 	bsc_gsmnet->bsc_data->rf_ctrl->policy = S_RF_ON;
 
diff --git a/tests/channel/channel_test.c b/tests/channel/channel_test.c
index f37877e..b41e3d6 100644
--- a/tests/channel/channel_test.c
+++ b/tests/channel/channel_test.c
@@ -38,7 +38,7 @@
 	printf("Testing the lchan printing:");
 
 	/* Create a dummy network */
-	network = bsc_network_init(tall_bsc_ctx, 1, 1);
+	network = bsc_network_init(tall_bsc_ctx);
 	if (!network)
 		exit(1);
 	/* Add a BTS with some reasonanbly non-zero id */
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index aeec56f..9f5a5c4 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -834,7 +834,7 @@
 	osmo_init_logging(&log_info);
 	log_set_log_level(osmo_stderr_target, LOGL_INFO);
 
-	net = bsc_network_init(tall_bsc_ctx, 1, 1);
+	net = bsc_network_init(tall_bsc_ctx);
 	if (!net) {
 		printf("Network init failure.\n");
 		return EXIT_FAILURE;
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index d1f75ba..8ba97fd 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1293,7 +1293,7 @@
 	log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_BASENAME);
 
 	/* Create a dummy network */
-	bsc_gsmnet = bsc_network_init(NULL, 1, 1);
+	bsc_gsmnet = bsc_network_init(NULL);
 	if (!bsc_gsmnet)
 		exit(1);
 

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic16bc0bab3f2d4721e86a1a04f9d9f988d777df2
Gerrit-PatchSet: 6
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list