diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-05 02:09:40 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2018-03-07 15:34:48 +0000 |
commit | f93970b167aba2805cc67e1326591f31fbe93ada (patch) | |
tree | fefb1abf602475204e443563b634596df9ff5444 /src/osmo-bsc/osmo_bsc_msc.c | |
parent | 56dec0c75358fe42954f9e7949ebd0c163377b10 (diff) |
implement support for 3-digit MNC with leading zeros
Add 3-digit flags and use the new RAI and LAI API from libosmocore throughout
the code base to be able to handle an MNC < 100 that has three digits (leading
zeros).
The changes to abis_test and gsm0408_test show that this code now handles
3-digit MNC correctly, by not dropping the leading zero as 0xf in the encoded
PLMN.
Re-implement CTRL commands 'mcc', 'mnc' and 'mcc-mnc-apply' to preserve the
presence of the third digit of the MNC. Always reply with all leading zeros.
Adjust the expected results in ctrl_test_runner.py, to show that it works.
In VTY and CTRL, the parsing of MCC and MNC is inherently made stricter by use
of osmo_{mcc,mnc}_from_str() -- they will no longer allow surplus characters
and detect errno returned by strtol() (in contrast to atoi()).
Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore),
Ib7176b1d65a03b76f41f94bc9d3293a8a07d24c6 (libosmocore),
I020a4f11791c61742a3d795f782805f7b7e8733e (libosmocore)
Change-Id: I8e722103344186fde118b26d8353db95a4581daa
Diffstat (limited to 'src/osmo-bsc/osmo_bsc_msc.c')
-rw-r--r-- | src/osmo-bsc/osmo_bsc_msc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c index 46be2e644..e0c7556a9 100644 --- a/src/osmo-bsc/osmo_bsc_msc.c +++ b/src/osmo-bsc/osmo_bsc_msc.c @@ -581,8 +581,10 @@ struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *net, int nr) INIT_LLIST_HEAD(&msc_data->dests); msc_data->ping_timeout = 20; msc_data->pong_timeout = 5; - msc_data->core_mnc = -1; - msc_data->core_mcc = -1; + msc_data->core_plmn = (struct osmo_plmn_id){ + .mcc = GSM_MCC_MNC_INVALID, + .mnc = GSM_MCC_MNC_INVALID, + }; msc_data->core_ci = -1; msc_data->core_lac = -1; msc_data->rtp_base = 4000; |