Commit Graph

11 Commits

Author SHA1 Message Date
Andreas Eversberg d074f8f396 Add EFR support to TRAU muxer + test case
Decoding and encoding of FR and EFR TRAU frames are put into seperate
functions. CRC check is done to detect bad EFR TRAU frames.

The test case includes FR and EFR transcoding.

EFR support was tested with Nokia InSite BTS and Siemens BS11.
2013-12-19 10:12:28 +01:00
Jacob Erlbeck 51a869c80c gbproxy: Add test program to test gbproxy message handling
This program tests the gbproxy implementation by passing NS messages
to a modified gbproxy that dumps the resulting messages, signals, and
state.

It focusses on testing abnormal situations like port changes.

Ticket: OW#874
Sponsored-by: On-Waves ehf
2013-10-15 15:10:22 +02:00
Jacob Erlbeck 946d1415c2 bsc/mminfo: Patch timezone and DST in MM Info messages
This adds in-place patching of the time information in the
MM INFORMATION message. The timezone in the 'Local time zone' and
the 'Universal time and local time zone' information elements
and the offset in the 'Network Daylight Saving Time' information
element are optionally set.

The new values are determined by the 'timezone' vty command in the
config_net_bts node. That command is extended by an optional
DST offset parameter.

Tests are provided for the vty part and for the plain
bsc_scan_msc_msg() function.

Sponsored-by: On-Waves ehf
Ticket: OW#978
2013-09-19 10:57:13 +02:00
Holger Hans Peter Freyther ddf191eafc nat: Allow to use the prefix lookup to rewrite numbers
* Increase the rewritten rule to five digits (this is the easiest
  for the unit test). This will add another 40kb to the runtime size.

* Create a unit test that tests adding and removing the prefix rules.

* Use the regexp match to replace from one package
2013-07-31 16:36:40 +02:00
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
Holger Hans Peter Freyther a7328a5642 smpp: Move the coding/mode detection into a utils file
Make sure to not ever have issues with this code again, move the
utility code to a new file and create a basic testcase. The method
currently has 100% line and branch coverage. My initial patched
missed the smpp_utils.c file and I re-did the copying (and verifying
the branch coverage)
2013-07-27 20:03:10 +02:00
Holger Hans Peter Freyther 1f8276e588 nat: Introduce a global IMSI barr list using red-black trees 2013-01-07 15:02:34 +01:00
Holger Hans Peter Freyther bce5675e5f abis: Create a routine that can parse all SW Descriptions of a SW Config
Be able to parse the entire SW Config IE. Parse the SW Descruption
into a struct provided by the caller.
2012-12-19 16:37:55 +01:00
Holger Hans Peter Freyther 511f9c3e4a si: Partially implement the range encoding for the SI.
I saw the old copy of the "Appendix J" code too late and I have
discovered some quirks and I am more familar with my implementation.
Most noticable 'w' only needs to be as big as the input arfcn but
requires the 'w' to be initialized. The power_of_2 implementation
differs as well (mine matches the output of wirehsark).

The f0 could be chosen in a better way but right now picking
the lower bound is the easiest. It is not clear if to use
modulo if the range is chosen in the middle. This can be improved
in the future. Right now I have no bit fiddling for range128, 256
and 1024 as I was running out of time.
2012-10-22 15:23:58 +02:00
Holger Hans Peter Freyther 93ef33edb6 tests: Use atlocal/atlocal.in to enable/disable the NAT test
Kill the hacking, use atlocal to remember if the NAT test should
be enabled and then skip the test (exit with 77).
2012-01-09 22:53:04 +01:00
Holger Hans Peter Freyther 6c88217c19 tests: Introduce running tests with GNU autotest in OpenBSC
The quality of the tests is of different value but it is good to
get started and improve from here.
2012-01-06 18:52:05 +01:00