pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/29358 )
Change subject: vty: Allow setting LAC as hexadecimal value ......................................................................
vty: Allow setting LAC as hexadecimal value
The LAC value currently configured is now printed as hexadecimal value too. It can still be entered as a decimal value in order to keep backward compatibility, though the hexadecimal one is now preferred.
Related: OS#5631 Depends: libosmocore.git Ia2b7fbbf5502c28374c21dbff548232680da27d4 Change-Id: I9090d73ae9d39244b79b9dbafa1b164faebabc52 --- M TODO-RELEASE M doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus01-4trx.cfg M doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-4trx.cfg M doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-8trx.cfg M doc/examples/osmo-bsc/ericsson/osmo-bsc.rbs2308.cfg M doc/examples/osmo-bsc/nokia/osmo-bsc.insite.cfg M doc/examples/osmo-bsc/osmo-bsc-4trx.cfg M doc/examples/osmo-bsc/osmo-bsc-minimal.cfg M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg M doc/examples/osmo-bsc/siemens/osmo-bsc.bs11.cfg M doc/manuals/chapters/bts-examples.adoc M doc/manuals/chapters/bts.adoc M doc/manuals/chapters/handover.adoc M src/osmo-bsc/bts_vty.c M tests/ctrl/osmo-bsc-apply-config-file.cfg M tests/ctrl/osmo-bsc-neigh-test.cfg M tests/handover/handover_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c M tests/neighbor_ident.vty 20 files changed, 45 insertions(+), 46 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/58/29358/1
diff --git a/TODO-RELEASE b/TODO-RELEASE index f172501..532f154 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libosmogsm >1.7.0 BTS_FEAT_OSMUX, RSL_IE_OSMO_OSMUX_CID +libosmocore >1.7.0 vty hexadecimal range support (location_area_code) diff --git a/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus01-4trx.cfg b/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus01-4trx.cfg index 8ef1619..7d676d6 100644 --- a/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus01-4trx.cfg +++ b/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus01-4trx.cfg @@ -33,7 +33,7 @@ band GSM900 om2000 version-limit oml gen 12 rev 10 cell_identity 0 - location_area_code 1 + location_area_code 0x0001 training_sequence_code 7 base_station_id_code 63 ms max power 15 diff --git a/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-4trx.cfg b/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-4trx.cfg index 7c9b847..464b37f 100644 --- a/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-4trx.cfg +++ b/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-4trx.cfg @@ -33,7 +33,7 @@ band GSM900 om2000 version-limit oml gen 12 rev 10 cell_identity 0 - location_area_code 1 + location_area_code 0x0001 training_sequence_code 7 base_station_id_code 63 ms max power 15 diff --git a/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-8trx.cfg b/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-8trx.cfg index 6db88b5..844bf05 100644 --- a/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-8trx.cfg +++ b/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-8trx.cfg @@ -33,7 +33,7 @@ band GSM900 om2000 version-limit oml gen 12 rev 10 cell_identity 0 - location_area_code 1 + location_area_code 0x0001 training_sequence_code 7 base_station_id_code 63 ms max power 15 diff --git a/doc/examples/osmo-bsc/ericsson/osmo-bsc.rbs2308.cfg b/doc/examples/osmo-bsc/ericsson/osmo-bsc.rbs2308.cfg index a90cfa1..82283c8 100644 --- a/doc/examples/osmo-bsc/ericsson/osmo-bsc.rbs2308.cfg +++ b/doc/examples/osmo-bsc/ericsson/osmo-bsc.rbs2308.cfg @@ -39,7 +39,7 @@ type rbs2000 band PCS1900 cell_identity 0 - location_area_code 1 + location_area_code 0x0001 training_sequence_code 7 base_station_id_code 63 ms max power 33 diff --git a/doc/examples/osmo-bsc/nokia/osmo-bsc.insite.cfg b/doc/examples/osmo-bsc/nokia/osmo-bsc.insite.cfg index a8e8e5c..0b0afa8 100644 --- a/doc/examples/osmo-bsc/nokia/osmo-bsc.insite.cfg +++ b/doc/examples/osmo-bsc/nokia/osmo-bsc.insite.cfg @@ -27,7 +27,7 @@ type nokia_site band GSM1900 cell_identity 1 - location_area_code 1 + location_area_code 0x0001 base_station_id_code 63 training_sequence_code 7
diff --git a/doc/examples/osmo-bsc/osmo-bsc-4trx.cfg b/doc/examples/osmo-bsc/osmo-bsc-4trx.cfg index 206a3c7..f2fcf77 100644 --- a/doc/examples/osmo-bsc/osmo-bsc-4trx.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc-4trx.cfg @@ -11,7 +11,7 @@ type osmo-bts band DCS1800 cell_identity 6969 - location_area_code 1 + location_area_code 0x0001 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 diff --git a/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg b/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg index 2258495..5e1ac11 100644 --- a/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg @@ -4,7 +4,7 @@ bts 0 type osmo-bts band GSM-1800 - location_area_code 23 + location_area_code 0x0017 ipa unit-id 1800 0 trx 0 rf_locked 0 diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg index 22afa07..17ca152 100644 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -23,7 +23,7 @@ type osmo-bts band DCS1800 cell_identity 6969 - location_area_code 1 + location_area_code 0x0001 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg index 21187c7..a053dbe 100644 --- a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg @@ -22,7 +22,7 @@ type osmo-bts band DCS1800 cell_identity 0 - location_area_code 1 + location_area_code 0x0001 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 diff --git a/doc/examples/osmo-bsc/siemens/osmo-bsc.bs11.cfg b/doc/examples/osmo-bsc/siemens/osmo-bsc.bs11.cfg index a308db5..8d75296 100644 --- a/doc/examples/osmo-bsc/siemens/osmo-bsc.bs11.cfg +++ b/doc/examples/osmo-bsc/siemens/osmo-bsc.bs11.cfg @@ -39,7 +39,7 @@ type bs11 band GSM900 cell_identity 1 - location_area_code 1 + location_area_code 0x0001 training_sequence_code 7 base_station_id_code 63 oml e1 line 2 timeslot 1 sub-slot full diff --git a/doc/manuals/chapters/bts-examples.adoc b/doc/manuals/chapters/bts-examples.adoc index 2afc8ff..1f3652b 100644 --- a/doc/manuals/chapters/bts-examples.adoc +++ b/doc/manuals/chapters/bts-examples.adoc @@ -26,7 +26,7 @@ type nanobts <2> band DCS1800 <3> cell_identity 0 - location_area_code 1 + location_area_code 0x0001 training_sequence_code 7 base_station_id_code 63 ms max power 15 @@ -104,7 +104,7 @@ type nanobts band DCS1800 cell_identity 0 - location_area_code 1 + location_area_code 0x0001 training_sequence_code 7 base_station_id_code 63 ms max power 15 @@ -197,7 +197,7 @@ band GSM900 om2000 version-limit oml gen 12 rev 10 <2> cell_identity 0 - location_area_code 1 + location_area_code 0x0001 training_sequence_code 7 base_station_id_code 63 ms max power 15 diff --git a/doc/manuals/chapters/bts.adoc b/doc/manuals/chapters/bts.adoc index 4662c1a..177d1c5 100644 --- a/doc/manuals/chapters/bts.adoc +++ b/doc/manuals/chapters/bts.adoc @@ -108,7 +108,7 @@ type osmo-bts band DCS1800 description The new BTS in Baikonur - location_area_code 2342 + location_area_code 0x0926 cell_identity 5 base_station_id_code 63 ip.access unit_id 8888 0 diff --git a/doc/manuals/chapters/handover.adoc b/doc/manuals/chapters/handover.adoc index f567259..4affe3b 100644 --- a/doc/manuals/chapters/handover.adoc +++ b/doc/manuals/chapters/handover.adoc @@ -223,15 +223,15 @@ network
bts 0 - # this cell's LAC=23 CI=5 - location_area_code 23 + # this cell's LAC=0x0017 CI=5 + location_area_code 0x0017 cell_identity 5 # reference bts 1 neighbor lac-ci 23 6
bts 1 - # this cell's LAC=23 CI=6 - location_area_code 23 + # this cell's LAC=0x0017 CI=6 + location_area_code 0x0017 cell_identity 6 # reference bts 0 neighbor lac-ci 23 5 @@ -252,8 +252,8 @@ network
bts 0 - # this cell's LAC=23 CI=5 - location_area_code 23 + # this cell's LAC=0x0017 CI=5 + location_area_code 0x0017 cell_identity 5 # this cell's ARFCN=1 BSIC=1 trx 0 @@ -263,8 +263,8 @@ neighbor lac-ci 23 6 arfcn 2 bsic 2
bts 1 - # LAC=23 CI=6 - location_area_code 23 + # LAC=0x0017 CI=6 + location_area_code 0x0017 cell_identity 6 # this cell's ARFCN=2 BSIC=2 trx 0 @@ -286,8 +286,8 @@ # BSC Alpha's osmo-bsc.cfg network bts 0 - # this cell's LAC=23 CI=6 - location_area_code 23 + # this cell's LAC=0x0017 CI=6 + location_area_code 0x0017 cell_identity 6 # this cell's ARFCN=2 BSIC=2 trx 0 @@ -299,8 +299,8 @@ # BSC Beta's osmo-bsc.cfg network bts 0 - # this cell's LAC=42 CI=3 - location_area_code 42 + # this cell's LAC=0x002A CI=3 + location_area_code 0x002A cell_identity 3 # this cell's ARFCN=1 BSIC=3 trx 0 diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 3900768..8ce6142 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -276,17 +276,15 @@ DEFUN_USRATTR(cfg_bts_lac, cfg_bts_lac_cmd, X(BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK), - "location_area_code <0-65535>", - "Set the Location Area Code (LAC) of this BTS\n" "LAC\n") + "location_area_code (<0-65535>|<0x0000-0xffff>)", + "Set the Location Area Code (LAC) of this BTS\n" + "LAC in decimal format\n" + "LAC in hexdecimal format\n") { struct gsm_bts *bts = vty->index; - int lac = atoi(argv[0]); - - if (lac < 0 || lac > 0xffff) { - vty_out(vty, "%% LAC %d is not in the valid range (0-65535)%s", - lac, VTY_NEWLINE); + int lac; + if(osmo_str_to_int(&lac, argv[0], 0, 0, 0xffff) < 0) return CMD_WARNING; - }
if (lac == GSM_LAC_RESERVED_DETACHED || lac == GSM_LAC_RESERVED_ALL_BTS) { vty_out(vty, "%% LAC %d is reserved by GSM 04.08%s", @@ -4307,7 +4305,7 @@ vty_out(vty, " description %s%s", bts->description, VTY_NEWLINE); vty_out(vty, " band %s%s", gsm_band_name(bts->band), VTY_NEWLINE); vty_out(vty, " cell_identity %u%s", bts->cell_identity, VTY_NEWLINE); - vty_out(vty, " location_area_code %u%s", bts->location_area_code, + vty_out(vty, " location_area_code 0x%04x%s", bts->location_area_code, VTY_NEWLINE); if (bts->dtxu != GSM48_DTX_SHALL_NOT_BE_USED) vty_out(vty, " dtx uplink%s%s", diff --git a/tests/ctrl/osmo-bsc-apply-config-file.cfg b/tests/ctrl/osmo-bsc-apply-config-file.cfg index 0094cd7..5f27465 100644 --- a/tests/ctrl/osmo-bsc-apply-config-file.cfg +++ b/tests/ctrl/osmo-bsc-apply-config-file.cfg @@ -3,7 +3,7 @@ type osmo-bts band DCS1800 cell_identity 123 - location_area_code 1 + location_area_code 0x0001 base_station_id_code 55 ms max power 15 cell reselection hysteresis 4 diff --git a/tests/ctrl/osmo-bsc-neigh-test.cfg b/tests/ctrl/osmo-bsc-neigh-test.cfg index baf5f36..b1c5bdf 100644 --- a/tests/ctrl/osmo-bsc-neigh-test.cfg +++ b/tests/ctrl/osmo-bsc-neigh-test.cfg @@ -20,7 +20,7 @@ type osmo-bts band DCS1800 cell_identity 6969 - location_area_code 1 + location_area_code 0x0001 base_station_id_code 63 ms max power 15 cell reselection hysteresis 4 @@ -77,7 +77,7 @@ type osmo-bts band DCS1800 cell_identity 123 - location_area_code 1 + location_area_code 0x0001 base_station_id_code 55 ms max power 15 cell reselection hysteresis 4 diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index d237ab7..6830b48 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -257,7 +257,7 @@ return NULL; }
- bts->location_area_code = 23; + bts->location_area_code = 0x0017; bts->cell_identity = ci++; bts->c0->arfcn = arfcn++;
diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 32e2c53..83b6c5e 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -160,7 +160,7 @@ bts->c0->arfcn = 866; bts->cell_identity = 1337; bts->network->plmn = (struct osmo_plmn_id){ .mcc=1, .mnc=1 }; - bts->location_area_code = 1; + bts->location_area_code = 0x0001; bts->gprs.rac = 0; uint8_t attr_bts_expected[] = { 0x19, 0x73, 0x6d, 0x67, 0x61, 0x5b, 0x55, 0x18, 0x06, 0x0e, 0x00, diff --git a/tests/neighbor_ident.vty b/tests/neighbor_ident.vty index 950d852..211159c 100644 --- a/tests/neighbor_ident.vty +++ b/tests/neighbor_ident.vty @@ -21,7 +21,7 @@ OsmoBSC(config-net)# bts 0 OsmoBSC(config-net-bts)# type osmo-bts OsmoBSC(config-net-bts)# base_station_id_code 10 -OsmoBSC(config-net-bts)# location_area_code 20 +OsmoBSC(config-net-bts)# location_area_code 0x0014 OsmoBSC(config-net-bts)# cell_identity 30 OsmoBSC(config-net-bts)# trx 0 OsmoBSC(config-net-bts-trx)# arfcn 40 @@ -31,7 +31,7 @@ OsmoBSC(config-net)# bts 1 OsmoBSC(config-net-bts)# type osmo-bts OsmoBSC(config-net-bts)# base_station_id_code 11 -OsmoBSC(config-net-bts)# location_area_code 21 +OsmoBSC(config-net-bts)# location_area_code 0x0015 OsmoBSC(config-net-bts)# cell_identity 31 OsmoBSC(config-net-bts)# trx 0 OsmoBSC(config-net-bts-trx)# arfcn 41 @@ -41,7 +41,7 @@ OsmoBSC(config-net)# bts 2 OsmoBSC(config-net-bts)# type osmo-bts OsmoBSC(config-net-bts)# base_station_id_code 12 -OsmoBSC(config-net-bts)# location_area_code 22 +OsmoBSC(config-net-bts)# location_area_code 0x0016 OsmoBSC(config-net-bts)# cell_identity 65535 OsmoBSC(config-net-bts)# trx 0 OsmoBSC(config-net-bts-trx)# arfcn 42 @@ -53,7 +53,7 @@ bts 0 ... cell_identity 30 - location_area_code 20 + location_area_code 0x0014 base_station_id_code 10 ... trx 0 @@ -63,7 +63,7 @@ bts 1 ... cell_identity 31 - location_area_code 21 + location_area_code 0x0015 base_station_id_code 11 ... trx 0 @@ -73,7 +73,7 @@ bts 2 ... cell_identity 65535 - location_area_code 22 + location_area_code 0x0016 base_station_id_code 12 ... trx 0