drop features 'core-location-area-code' and 'core-cell-identity'
This feature apparently assigned a fixed LAC and CI to a specific MSC, but
looking at the implementation was obviously not useful.
Keep the vty commands for legacy compat, now without effect besides logging an
error via vty_out().
Related: OS#4751
Change-Id: I6bee704e7e5d5b6b86473323bae1fa9fce9241ee
diff --git a/include/osmocom/bsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h
index 5622a42..e5f48d1 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -128,8 +128,6 @@
/* Connection data */
struct osmo_plmn_id core_plmn;
- int core_lac;
- int core_ci;
/* audio codecs */
struct gsm48_multi_rate_conf amr_conf;
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index bdabe88..e91e01c 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -5976,12 +5976,6 @@
if (msc->core_plmn.mcc != GSM_MCC_MNC_INVALID)
vty_out(vty, " core-mobile-country-code %s%s",
osmo_mcc_name(msc->core_plmn.mcc), VTY_NEWLINE);
- if (msc->core_lac != -1)
- vty_out(vty, " core-location-area-code %d%s",
- msc->core_lac, VTY_NEWLINE);
- if (msc->core_ci != -1)
- vty_out(vty, " core-cell-identity %d%s",
- msc->core_ci, VTY_NEWLINE);
if (msc->audio_length != 0) {
int i;
@@ -6105,25 +6099,21 @@
return CMD_SUCCESS;
}
-DEFUN_ATTR(cfg_net_bsc_lac,
- cfg_net_bsc_lac_cmd,
- "core-location-area-code <0-65535>",
- "Use this location area code for the core network\n" "LAC value\n",
- CMD_ATTR_IMMEDIATE)
+DEFUN_DEPRECATED(cfg_net_bsc_lac,
+ cfg_net_bsc_lac_cmd,
+ "core-location-area-code <0-65535>",
+ "Legacy configuration that no longer has any effect\n-\n")
{
- struct bsc_msc_data *data = bsc_msc_data(vty);
- data->core_lac = atoi(argv[0]);
+ vty_out(vty, "%% Deprecated 'core-location-area-code' config no longer has any effect%s", VTY_NEWLINE);
return CMD_SUCCESS;
}
-DEFUN_ATTR(cfg_net_bsc_ci,
- cfg_net_bsc_ci_cmd,
- "core-cell-identity <0-65535>",
- "Use this cell identity for the core network\n" "CI value\n",
- CMD_ATTR_IMMEDIATE)
+DEFUN_DEPRECATED(cfg_net_bsc_ci,
+ cfg_net_bsc_ci_cmd,
+ "core-cell-identity <0-65535>",
+ "Legacy configuration that no longer has any effect\n-\n")
{
- struct bsc_msc_data *data = bsc_msc_data(vty);
- data->core_ci = atoi(argv[0]);
+ vty_out(vty, "%% Deprecated 'core-cell-identity' config no longer has any effect%s", VTY_NEWLINE);
return CMD_SUCCESS;
}
diff --git a/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c
index f664231..497b3e4 100644
--- a/src/osmo-bsc/osmo_bsc_filter.c
+++ b/src/osmo-bsc/osmo_bsc_filter.c
@@ -92,26 +92,11 @@
return 0;
}
-static int has_core_identity(struct bsc_msc_data *msc)
-{
- if (msc->core_plmn.mnc != GSM_MCC_MNC_INVALID)
- return 1;
- if (msc->core_plmn.mcc != GSM_MCC_MNC_INVALID)
- return 1;
- if (msc->core_lac != -1)
- return 1;
- if (msc->core_ci != -1)
- return 1;
- return 0;
-}
-
/**
* Messages coming back from the MSC.
*/
int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
- struct bsc_msc_data *msc;
- struct gsm48_loc_area_id *lai;
struct gsm48_hdr *gh;
uint8_t pdisc;
uint8_t mtype;
@@ -130,19 +115,7 @@
return 0;
mtype = gsm48_hdr_msg_type(gh);
- msc = conn->sccp.msc;
-
- if (mtype == GSM48_MT_MM_LOC_UPD_ACCEPT) {
- struct gsm_bts *bts = conn_get_bts(conn);
- if (bts && has_core_identity(msc)) {
- if (msgb_l3len(msg) >= sizeof(*gh) + sizeof(*lai)) {
- /* overwrite LAI in the message */
- lai = (struct gsm48_loc_area_id *) &gh->data[0];
- gsm48_generate_lai2(lai, bts_lai(bts));
- }
- }
- return 0;
- } else if (mtype == GSM48_MT_MM_INFO) {
+ if (mtype == GSM48_MT_MM_INFO) {
bsc_patch_mm_info(conn, &gh->data[0], length);
}
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index 583b6ff..772bea5 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -229,8 +229,6 @@
.mcc = GSM_MCC_MNC_INVALID,
.mnc = GSM_MCC_MNC_INVALID,
};
- msc_data->core_ci = -1;
- msc_data->core_lac = -1;
msc_data->nr = nr;
msc_data->allow_emerg = 1;
@@ -285,8 +283,8 @@
cgi.lai.plmn.mnc = msc->core_plmn.mnc;
cgi.lai.plmn.mnc_3_digits = msc->core_plmn.mnc_3_digits;
}
- cgi.lai.lac = (msc->core_lac != -1) ? msc->core_lac : bts->location_area_code;
- cgi.cell_identity = (msc->core_ci != -1) ? msc->core_ci : bts->cell_identity;
+ cgi.lai.lac = bts->location_area_code;
+ cgi.cell_identity = bts->cell_identity;
return &cgi;
}
diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py
index c96965c..34ddcc7 100755
--- a/tests/vty_test_runner.py
+++ b/tests/vty_test_runner.py
@@ -172,21 +172,6 @@
res = self.vty.command("show network")
self.assertTrue(res.startswith('BSC is on Country Code') >= 0)
- def testMscDataCoreLACCI(self):
- self.vty.enable()
- res = self.vty.command("show running-config")
- self.assertEqual(res.find("core-location-area-code"), -1)
- self.assertEqual(res.find("core-cell-identity"), -1)
-
- self.vty.command("configure terminal")
- self.vty.command("msc 0")
- self.vty.command("core-location-area-code 666")
- self.vty.command("core-cell-identity 333")
-
- res = self.vty.command("show running-config")
- self.assertTrue(res.find("core-location-area-code 666") > 0)
- self.assertTrue(res.find("core-cell-identity 333") > 0)
-
def add_bsc_test(suite, workdir):
if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")):