osmo-msc/openbsc/src/osmo-bsc_nat
Holger Hans Peter Freyther 85d3b34ed2 nat: Introduce a prefix lookup tree (trie) for number rewriting
* It is a trie. The max depth of the trie is the length of the
longest prefix. The lookup is O(lookuped_prefix), but as the prefix
length is limited, the lookup time is constant.

* Each node can hold the entire prefix, has place for the rewrite
  rule with up to three digits.

* A trie with 20k entries will take about 3MB ram.

* Filling the trie 100 times takes ~800ms on my i7 laptop

* 10.000.000 lookups take 315ms.. (for the same prefix).

* 93/99 lines are tested, 6/6 functions are tested, 49 of 54 branches
  are tested. Only memory allocation failures are not covered

* A late addition is to handle the '+' sign and to increase the number
  of chars in the rewrite prefix. The timing/line coverage has not
  been updated after this change.
2013-07-31 16:36:40 +02:00
..
Makefile.am nat: Introduce a prefix lookup tree (trie) for number rewriting 2013-07-31 16:36:40 +02:00
bsc_filter.c src: port openBSC over libosmo-abis 2011-08-19 22:38:35 +02:00
bsc_mgcp_utils.c nat: Address coverity warning about uninitialized addr 2013-07-05 07:48:04 +02:00
bsc_nat.c nat: Introduce a prefix lookup tree (trie) for number rewriting 2013-07-31 16:36:40 +02:00
bsc_nat_ctrl.c nat: Please coverity and initialize the saveptr to NULL 2013-07-05 07:45:08 +02:00
bsc_nat_filter.c nat: Rename "struct sccp_connections" to "struct nat_sccp_connection" 2013-04-16 09:53:13 +02:00
bsc_nat_rewrite.c nat: number could point to an address on the stack that can be reused 2013-07-05 07:50:30 +02:00
bsc_nat_rewrite_trie.c nat: Introduce a prefix lookup tree (trie) for number rewriting 2013-07-31 16:36:40 +02:00
bsc_nat_utils.c nat: Extract the LAC/CI from the Complete Layer3 Information 2013-04-16 14:14:17 +02:00
bsc_nat_vty.c nat: Add a no number-rewrite command and call it through a VTY test 2013-07-31 16:36:13 +02:00
bsc_sccp.c nat: Rename "struct sccp_connections" to "struct nat_sccp_connection" 2013-04-16 09:53:13 +02:00
bsc_ussd.c nat: Fix compiler warning and cast uint16_t to uint8_t 2013-07-03 16:18:37 +02:00