From bdc55fad62e333951a0eb1fc7b96aaaec16dd6ff Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 21 Feb 2018 00:39:07 +0100 Subject: implement support for 3-digit MNC with leading zeros Receive the mnc_3_digits flag from the PCU interface. Bump the PCU interface to 9. This is one part of the three identical pcuif_proto.h patches: - I49cd762c3c9d7ee6a82451bdf3ffa2a060767947 (osmo-bts) - I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu) - I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 (osmo-bsc) 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). Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore), Ib7176b1d65a03b76f41f94bc9d3293a8a07d24c6 (libosmocore) Change-Id: I787fed84a7b613158a5618dd5cffafe4e4927234 --- tests/alloc/AllocTest.cpp | 1 + tests/alloc/MslotTest.cpp | 1 + tests/edge/EdgeTest.cpp | 1 + tests/emu/pcu_emu.cpp | 3 ++- tests/fn/FnTest.cpp | 1 + tests/llc/LlcTest.cpp | 1 + tests/ms/MsTest.cpp | 1 + tests/tbf/TbfTest.cpp | 11 ++++++----- tests/types/TypesTest.cpp | 1 + 9 files changed, 15 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 1c98e462..9f6e6c46 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -36,6 +36,7 @@ extern "C" { /* globals used by the code */ void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; +bool spoof_mnc_3_digits = false; static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, diff --git a/tests/alloc/MslotTest.cpp b/tests/alloc/MslotTest.cpp index 92f92fae..ebe04cad 100644 --- a/tests/alloc/MslotTest.cpp +++ b/tests/alloc/MslotTest.cpp @@ -37,6 +37,7 @@ extern "C" { /* globals used by the code */ void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; +bool spoof_mnc_3_digits = false; static inline void test_all_classes(struct gprs_rlcmac_trx *trx, bool clear_masks) { diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index eb9ef42a..cd80c05f 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -46,6 +46,7 @@ extern "C" { void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; +bool spoof_mnc_3_digits = false; static void check_coding_scheme(GprsCodingScheme& cs, GprsCodingScheme::Mode mode) { diff --git a/tests/emu/pcu_emu.cpp b/tests/emu/pcu_emu.cpp index 957ddf60..4cc37f38 100644 --- a/tests/emu/pcu_emu.cpp +++ b/tests/emu/pcu_emu.cpp @@ -40,6 +40,7 @@ static size_t current_test; /* Extern data to please the underlying code */ void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; +bool spoof_mnc_3_digits = false; extern void test_replay_gprs_attach(struct gprs_bssgp_pcu *pcu); extern void test_replay_gprs_data(struct gprs_bssgp_pcu *, struct msgb *, struct tlv_parsed *); @@ -99,7 +100,7 @@ void create_and_connect_bssgp(struct gprs_rlcmac_bts *bts, struct gprs_bssgp_pcu *pcu; pcu = gprs_bssgp_create_and_connect(bts, 0, sgsn_ip, sgsn_port, - 20, 20, 20, 0x901, 0x99, 1, 0, 0); + 20, 20, 20, 901, 99, false, 1, 0, 0); pcu->on_unblock_ack = bvci_unblocked; pcu->on_dl_unit_data = bssgp_data; } diff --git a/tests/fn/FnTest.cpp b/tests/fn/FnTest.cpp index 279903c8..1e3ff113 100644 --- a/tests/fn/FnTest.cpp +++ b/tests/fn/FnTest.cpp @@ -34,6 +34,7 @@ extern "C" { /* globals used by the code */ void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; +bool spoof_mnc_3_digits = false; static uint32_t calc_fn(BTS * bts, uint32_t rfn) { diff --git a/tests/llc/LlcTest.cpp b/tests/llc/LlcTest.cpp index f827ef14..eb693f56 100644 --- a/tests/llc/LlcTest.cpp +++ b/tests/llc/LlcTest.cpp @@ -40,6 +40,7 @@ extern "C" { void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; +bool spoof_mnc_3_digits = false; static void enqueue_data(gprs_llc_queue *queue, const uint8_t *data, size_t len, gprs_llc_queue::MetaInfo *info = 0) diff --git a/tests/ms/MsTest.cpp b/tests/ms/MsTest.cpp index ac35998a..46015045 100644 --- a/tests/ms/MsTest.cpp +++ b/tests/ms/MsTest.cpp @@ -41,6 +41,7 @@ extern "C" { void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; +bool spoof_mnc_3_digits = false; static void test_ms_state() { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index fb9158f9..662708a6 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -47,6 +47,7 @@ extern "C" { void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; +bool spoof_mnc_3_digits = false; static void check_tbf(gprs_rlcmac_tbf *tbf) { @@ -449,7 +450,7 @@ static void test_tbf_exhaustion() bts = the_bts.bts_data(); setup_bts(&the_bts, ts_no); gprs_bssgp_create_and_connect(bts, 33001, 0, 33001, - 1234, 1234, 1234, 1, 1, 0, 0, 0); + 1234, 1234, 1234, 1, 1, false, 0, 0, 0); for (i = 0; i < 1024; i++) { uint32_t tlli = 0xc0000000 + i; @@ -492,7 +493,7 @@ static void test_tbf_dl_llc_loss() bts->ms_idle_sec = 10; /* keep the MS object */ gprs_bssgp_create_and_connect(bts, 33001, 0, 33001, - 1234, 1234, 1234, 1, 1, 0, 0, 0); + 1234, 1234, 1234, 1, 1, false, 0, 0, 0); /* Handle LLC frame 1 */ memset(buf, 1, sizeof(buf)); @@ -2161,7 +2162,7 @@ static void test_tbf_gprs_egprs() bts->egprs_enabled = 1; gprs_bssgp_create_and_connect(bts, 33001, 0, 33001, - 1234, 1234, 1234, 1, 1, 0, 0, 0); + 1234, 1234, 1234, 1, 1, false, 0, 0, 0); /* Does not support EGPRS */ rc = gprs_rlcmac_dl_tbf::handle(bts, tlli, 0, imsi, ms_class, 0, @@ -2223,7 +2224,7 @@ static void test_tbf_ws() bts->trx[0].pdch[5].enable(); gprs_bssgp_create_and_connect(bts, 33001, 0, 33001, - 1234, 1234, 1234, 1, 1, 0, 0, 0); + 1234, 1234, 1234, 1, 1, false, 0, 0, 0); /* Does no support EGPRS */ dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); @@ -2261,7 +2262,7 @@ static void test_tbf_update_ws(void) bts->trx[0].pdch[5].enable(); gprs_bssgp_create_and_connect(bts, 33001, 0, 33001, - 1234, 1234, 1234, 1, 1, 0, 0, 0); + 1234, 1234, 1234, 1, 1, false, 0, 0, 0); /* EGPRS-only */ bts->egprs_enabled = 1; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 5c4da221..3a43897b 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -44,6 +44,7 @@ extern "C" { void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; +bool spoof_mnc_3_digits = false; static void test_llc(void) { -- cgit v1.2.3