diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-05-27 19:21:24 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-06-01 20:45:12 +0200 |
commit | acc4031cf5dc4b1625054bf74abbc60008c8a5c0 (patch) | |
tree | d453529478da9b15618fef50ef5685db9e75f5bc /openbsc/tests/bsc-nat | |
parent | 9c20571280fb7cf61bb7211cce0dbbfed9fad7b9 (diff) |
nat: Look into the TPDU/SMS-SUBMIT and use the TP-DestAddress for matches
Match the used SMSC and the destination of the SMS and change
the SMSC address if both are matched.
Diffstat (limited to 'openbsc/tests/bsc-nat')
-rw-r--r-- | openbsc/tests/bsc-nat/bsc_nat_test.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index a31efcaef..d198424a4 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -989,15 +989,23 @@ static void test_smsc_rewrite() struct bsc_nat *nat = bsc_nat_alloc(); /* a fake list */ - struct osmo_config_list entries; - struct osmo_config_entry entry; - - INIT_LLIST_HEAD(&entries.entry); - entry.mcc = "^515039"; - entry.option = "639180000105()"; - entry.text = "6666666666667"; - llist_add_tail(&entry.list, &entries.entry); - bsc_nat_num_rewr_entry_adapt(nat, &nat->smsc_rewr, &entries); + struct osmo_config_list smsc_entries, dest_entries; + struct osmo_config_entry smsc_entry, dest_entry; + + INIT_LLIST_HEAD(&smsc_entries.entry); + INIT_LLIST_HEAD(&dest_entries.entry); + smsc_entry.mcc = "^515039"; + smsc_entry.option = "639180000105()"; + smsc_entry.text = "6666666666667"; + llist_add_tail(&smsc_entry.list, &smsc_entries.entry); + dest_entry.mcc = "515"; + dest_entry.mnc = "03"; + dest_entry.option = "^0049"; + dest_entry.text = ""; + llist_add_tail(&dest_entry.list, &dest_entries.entry); + + bsc_nat_num_rewr_entry_adapt(nat, &nat->smsc_rewr, &smsc_entries); + bsc_nat_num_rewr_entry_adapt(nat, &nat->tpdest_match, &dest_entries); copy_to_msg(msg, smsc_rewrite, ARRAY_SIZE(smsc_rewrite)); parsed = bsc_nat_parse(msg); |