From 8affef5059c3663f581bd3142de606bfc124a7ab Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 1 Jun 2010 01:03:13 +0800 Subject: [nat] Introduce the concept of access-list One can set one access-list to one BSC and one access-list to one NAT. The matching of IMSIs remains the same for now, also applying the white/blacklist. Access lists can not be deleted for now and no perf opt is done (e.g. one could cache the result of the last lookup in the bsc struct). --- openbsc/tests/bsc-nat/bsc_nat_test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'openbsc/tests') diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index 6ad987034..87018d46e 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -640,22 +640,28 @@ static void test_cr_filter() int i, res, contype; struct msgb *msg = msgb_alloc(4096, "test_cr_filter"); struct bsc_nat_parsed *parsed; + struct bsc_nat_access_list *nat_lst, *bsc_lst; struct bsc_nat *nat = bsc_nat_alloc(); struct bsc_connection *bsc = bsc_connection_alloc(nat); bsc->cfg = bsc_config_alloc(nat, "foo", 1234); + bsc->cfg->acc_lst_name = "bsc"; + nat->acc_lst_name = "nat"; for (i = 0; i < ARRAY_SIZE(cr_filter); ++i) { msgb_reset(msg); copy_to_msg(msg, cr_filter[i].data, cr_filter[i].length); - bsc_parse_reg(nat, &nat->imsi_deny_re, &nat->imsi_deny, + nat_lst = bsc_nat_accs_list_get(nat, "nat"); + bsc_lst = bsc_nat_accs_list_get(nat, "bsc"); + + bsc_parse_reg(nat_lst, &nat_lst->imsi_deny_re, &nat_lst->imsi_deny, cr_filter[i].nat_imsi_deny ? 1 : 0, &cr_filter[i].nat_imsi_deny); - bsc_parse_reg(bsc->cfg, &bsc->cfg->imsi_allow_re, &bsc->cfg->imsi_allow, + bsc_parse_reg(bsc_lst, &bsc_lst->imsi_allow_re, &bsc_lst->imsi_allow, cr_filter[i].bsc_imsi_allow ? 1 : 0, &cr_filter[i].bsc_imsi_allow); - bsc_parse_reg(bsc->cfg, &bsc->cfg->imsi_deny_re, &bsc->cfg->imsi_deny, + bsc_parse_reg(bsc_lst, &bsc_lst->imsi_deny_re, &bsc_lst->imsi_deny, cr_filter[i].bsc_imsi_deny ? 1 : 0, &cr_filter[i].bsc_imsi_deny); -- cgit v1.2.3