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
This commit is contained in:
Neels Hofmeyr 2020-10-15 19:17:10 +02:00 committed by neels
parent 7c02e4cfd5
commit 60e5ddf65d
5 changed files with 13 additions and 69 deletions

View File

@ -128,8 +128,6 @@ struct bsc_msc_data {
/* Connection data */ /* Connection data */
struct osmo_plmn_id core_plmn; struct osmo_plmn_id core_plmn;
int core_lac;
int core_ci;
/* audio codecs */ /* audio codecs */
struct gsm48_multi_rate_conf amr_conf; struct gsm48_multi_rate_conf amr_conf;

View File

@ -5976,12 +5976,6 @@ static void write_msc(struct vty *vty, struct bsc_msc_data *msc)
if (msc->core_plmn.mcc != GSM_MCC_MNC_INVALID) if (msc->core_plmn.mcc != GSM_MCC_MNC_INVALID)
vty_out(vty, " core-mobile-country-code %s%s", vty_out(vty, " core-mobile-country-code %s%s",
osmo_mcc_name(msc->core_plmn.mcc), VTY_NEWLINE); 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) { if (msc->audio_length != 0) {
int i; int i;
@ -6105,25 +6099,21 @@ DEFUN_ATTR(cfg_net_bsc_mcc,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN_ATTR(cfg_net_bsc_lac, DEFUN_DEPRECATED(cfg_net_bsc_lac,
cfg_net_bsc_lac_cmd, cfg_net_bsc_lac_cmd,
"core-location-area-code <0-65535>", "core-location-area-code <0-65535>",
"Use this location area code for the core network\n" "LAC value\n", "Legacy configuration that no longer has any effect\n-\n")
CMD_ATTR_IMMEDIATE)
{ {
struct bsc_msc_data *data = bsc_msc_data(vty); vty_out(vty, "%% Deprecated 'core-location-area-code' config no longer has any effect%s", VTY_NEWLINE);
data->core_lac = atoi(argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
DEFUN_ATTR(cfg_net_bsc_ci, DEFUN_DEPRECATED(cfg_net_bsc_ci,
cfg_net_bsc_ci_cmd, cfg_net_bsc_ci_cmd,
"core-cell-identity <0-65535>", "core-cell-identity <0-65535>",
"Use this cell identity for the core network\n" "CI value\n", "Legacy configuration that no longer has any effect\n-\n")
CMD_ATTR_IMMEDIATE)
{ {
struct bsc_msc_data *data = bsc_msc_data(vty); vty_out(vty, "%% Deprecated 'core-cell-identity' config no longer has any effect%s", VTY_NEWLINE);
data->core_ci = atoi(argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
} }

View File

@ -92,26 +92,11 @@ static int bsc_patch_mm_info(struct gsm_subscriber_connection *conn,
return 0; 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. * Messages coming back from the MSC.
*/ */
int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg) 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; struct gsm48_hdr *gh;
uint8_t pdisc; uint8_t pdisc;
uint8_t mtype; uint8_t mtype;
@ -130,19 +115,7 @@ int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg)
return 0; return 0;
mtype = gsm48_hdr_msg_type(gh); mtype = gsm48_hdr_msg_type(gh);
msc = conn->sccp.msc; if (mtype == GSM48_MT_MM_INFO) {
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) {
bsc_patch_mm_info(conn, &gh->data[0], length); bsc_patch_mm_info(conn, &gh->data[0], length);
} }

View File

@ -229,8 +229,6 @@ struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *net, int nr)
.mcc = GSM_MCC_MNC_INVALID, .mcc = GSM_MCC_MNC_INVALID,
.mnc = 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->nr = nr;
msc_data->allow_emerg = 1; msc_data->allow_emerg = 1;
@ -285,8 +283,8 @@ struct osmo_cell_global_id *cgi_for_msc(struct bsc_msc_data *msc, struct gsm_bts
cgi.lai.plmn.mnc = msc->core_plmn.mnc; cgi.lai.plmn.mnc = msc->core_plmn.mnc;
cgi.lai.plmn.mnc_3_digits = msc->core_plmn.mnc_3_digits; 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.lai.lac = bts->location_area_code;
cgi.cell_identity = (msc->core_ci != -1) ? msc->core_ci : bts->cell_identity; cgi.cell_identity = bts->cell_identity;
return &cgi; return &cgi;
} }

View File

@ -172,21 +172,6 @@ class TestVTYBSC(TestVTYGenericBSC):
res = self.vty.command("show network") res = self.vty.command("show network")
self.assertTrue(res.startswith('BSC is on Country Code') >= 0) 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): def add_bsc_test(suite, workdir):
if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")): if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc/osmo-bsc")):