osmo-msc/openbsc/src
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
..
gprs gprs_gmm: Avoid assertion in the sending code during routing area update 2013-07-31 16:12:02 +02:00
ipaccess ipaccess: The proxy code checked the array but not the element 2013-07-14 09:04:50 +02:00
libbsc expiration: Allow to disable the periodic location updating procedure 2013-07-27 22:02:24 +02:00
libcommon oml: Add a missing break switch for NM_OC_BS11 2013-07-18 12:03:31 +02:00
libctrl ctrlif: Flush/Clear write_queue when closing the control socket 2013-06-24 10:59:40 +02:00
libgb Makefile.am: Use AM_CPPFLAGS 2013-06-12 09:16:27 +02:00
libmgcp libmgcp: add enum mgcp_type and use it 2013-07-08 16:46:06 +02:00
libmsc expiration: Allow to disable the periodic location updating procedure 2013-07-27 22:02:24 +02:00
libtrau Makefile.am: Use AM_CPPFLAGS 2013-06-12 09:16:27 +02:00
osmo-bsc misc: Fix compilation warnings 2013-07-27 20:03:08 +02:00
osmo-bsc_mgcp Makefile.am: Use AM_CPPFLAGS 2013-06-12 09:16:27 +02:00
osmo-bsc_nat nat: Introduce a prefix lookup tree (trie) for number rewriting 2013-07-31 16:36:40 +02:00
osmo-nitb Makefile.am: Use AM_CPPFLAGS 2013-06-12 09:16:27 +02:00
utils misc: Fix compilation warnings 2013-07-27 20:03:08 +02:00
Makefile.am Makefile.am: Use AM_CPPFLAGS 2013-06-12 09:16:27 +02:00