diff options
author | Stefan Sperling <ssperling@sysmocom.de> | 2018-01-11 14:53:18 +0100 |
---|---|---|
committer | Stefan Sperling <ssperling@sysmocom.de> | 2018-01-16 14:14:01 +0100 |
commit | 714c2f9552c5ce54d4a29e72b4bd1d830524a992 (patch) | |
tree | b989f3c2524b381d93d9eea522412282a1b83466 /tests/bssap | |
parent | 74b8cdb8e9d7112026ec3c6e346e5c667d261db3 (diff) |
Move BTS selection for paging from osmo_bsc_grace.c into osmo_bsc_bssap.c.
We can now either page an invidual BTS directly or page several BTS in a
given location area. This decision is taken based on the contents of the
cell identifier list in the paging request. Select a set of BTS for paging
while processing the cell identifier list, rather than requiring the
paging layer to loop over all BTS in the MSC.
This change requires some adjustment in bssap_test. In particular,
this test must now add a BTS to its network in order to pass.
The purpose of this change is to make the layering a bit cleaner.
There is one functional change: We no longer abort paging if paging fails
for a particular BTS. Instead, we keep trying to page on other BTS.
Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d
Suggested-by: Harald Welte
Depends: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d
Related: OS#2753
Diffstat (limited to 'tests/bssap')
-rw-r--r-- | tests/bssap/bssap_test.c | 13 | ||||
-rw-r--r-- | tests/bssap/bssap_test.err | 6 |
2 files changed, 14 insertions, 5 deletions
diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c index c97393d5e..1d8fe7720 100644 --- a/tests/bssap/bssap_test.c +++ b/tests/bssap/bssap_test.c @@ -24,6 +24,7 @@ #include <osmocom/bsc/signal.h> #include <osmocom/bsc/bsc_subscriber.h> #include <osmocom/bsc/bsc_msc_data.h> +#include <osmocom/bsc/gsm_data_shared.h> #include <osmocom/bsc/common_bsc.h> #include <osmocom/bsc/osmo_bsc_rf.h> @@ -41,9 +42,9 @@ uint16_t gl_expect_lac = 0; /* override, requires '-Wl,--wrap=bsc_grace_paging_request' */ int __real_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, struct gsm_bts *bts); int __wrap_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) + struct bsc_msc_data *msc, struct gsm_bts *bts) { if (subscr->lac == GSM_LAC_RESERVED_ALL_BTS) fprintf(stderr, "BSC paging started on entire BSS (%u)\n", subscr->lac); @@ -86,6 +87,7 @@ void test_cell_identifier() int rc; struct gsm_network *net; struct bsc_msc_data *msc; + struct gsm_bts *bts; net = bsc_network_init(NULL, 1, 1); net->bsc_data->rf_ctrl = talloc_zero(NULL, struct osmo_bsc_rf); @@ -94,6 +96,12 @@ void test_cell_identifier() msc = talloc_zero(net, struct bsc_msc_data); msc->network = net; + bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_UNKNOWN, 0); + if (bts == NULL) { + fprintf(stderr, "gsm_bts_alloc_register() returned NULL\n"); + return; + } + log_set_log_level(osmo_stderr_target, LOGL_DEBUG); for (i = 0; i < ARRAY_SIZE(cell_identifier_tests); i++) { @@ -102,6 +110,7 @@ void test_cell_identifier() msg = msgb_from_hex("test_cell_identifier", 1024, cell_identifier_tests[i].msg); gl_expect_lac = cell_identifier_tests[i].expect_lac; + bts->location_area_code = (gl_expect_lac == GSM_LAC_RESERVED_ALL_BTS ? 0 : gl_expect_lac); rc = bsc_handle_udt(msc, msg, msgb_l2len(msg)); fprintf(stderr, "bsc_handle_udt() returned %d\n", rc); diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err index f24ff7c8c..abe1defc3 100644 --- a/tests/bssap/bssap_test.err +++ b/tests/bssap/bssap_test.err @@ -2,14 +2,14 @@ 0: DMSC Rx MSC UDT: 00 16 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 03 05 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 BSC paging started with LAC 101 bsc_handle_udt() returned 0 1: DMSC Rx MSC UDT: 00 14 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 01 06 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe BSC paging started on entire BSS (65534) bsc_handle_udt() returned 0 @@ -22,6 +22,6 @@ bsc_handle_udt() returned 0 3: DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 00 f1 10 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 BSC paging started with LAC 101 bsc_handle_udt() returned 0 |