aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-05-27 12:38:58 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-06-01 20:40:35 +0200
commitad75eababc153d513e75f7f052818ca02acd9533 (patch)
tree495be345f80cbe4f975ec15367c49433350a6c71 /openbsc/tests
parent384ef099209f92afb0af0c48756731a105da23f5 (diff)
nat: Allow to have a regexp to match the MSISDN
The idea that MCC and MNC is enough to classify a subscriber turns out to be wrong. Certain operatos license a number range of IMSIs to others. When we see a '^' in the MCC field we treat it as a regexp. The code now turns the MCC/MNC into a regexp for the IMSI. It is not using extended POSIX regexp to match the behavior of the access list.
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/bsc-nat/bsc_nat_test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index 1645f705f..32f4f72ff 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -854,7 +854,7 @@ static void test_setup_rewrite()
entry.option = "^0([1-9])";
entry.text = "0049";
llist_add_tail(&entry.list, &entries.entry);
- nat->num_rewr = &entries;
+ bsc_nat_num_rewr_entry_adapt(nat, &entries);
/* verify that nothing changed */
msgb_reset(msg);
@@ -917,6 +917,7 @@ static void test_setup_rewrite()
/* Make sure that a wildcard is matching */
entry.mnc = "*";
+ bsc_nat_num_rewr_entry_adapt(nat, &entries);
msg = msgb_alloc(4096, "test_dt_filter");
copy_to_msg(msg, cc_setup_national, ARRAY_SIZE(cc_setup_national));
parsed = bsc_nat_parse(msg);
@@ -951,6 +952,7 @@ static void test_setup_rewrite()
/* Make sure that a wildcard is matching */
entry.mnc = "09";
+ bsc_nat_num_rewr_entry_adapt(nat, &entries);
msg = msgb_alloc(4096, "test_dt_filter");
copy_to_msg(msg, cc_setup_national, ARRAY_SIZE(cc_setup_national));
parsed = bsc_nat_parse(msg);