Commit Graph

5655 Commits

Author SHA1 Message Date
Neels Hofmeyr f1a56dea7b jenkins.sh: use osmo-build-dep.sh, log test failures
Like in libosmo-abis' jenkins.sh

Change-Id: I4d6ffd5b230dd095650cc2231678b66056a8e4b5
2016-10-12 11:29:22 +00:00
Max 1e646f02f4 DTX DL: use FSM for AMR
- consolidate all DTX-specific things in a separate struct
- rename struct fields to better reflect meaning
- add pointer to DL FSM for AMR
- remove unused flag
- expand buffer to hold cached payload alongside with CMR/CMI

Change-Id: Idac8609faf9b5ced818fde899ccfc6ed0c42e8fd
2016-10-12 11:22:22 +00:00
Neels Hofmeyr 756fb30c8a gsm_trx_name(): don't break if trx is NULL
Just as a general precaution deemed to fit such a convenience function that
lives in libcommon, no actual failure observed.

Change-Id: I8e77fe1abc402469fd037e2fde2f46e2c8114f59
2016-10-10 03:26:36 +02:00
Neels Hofmeyr a6ba6a370b abis_rsl_rx_dchan(): guard against lchan_lookup() returning NULL
Found this by coincidence, no actual failure case was observed.

lchan_lookup() does have a return NULL code path, so we should not blindly use
its returned pointer.

Change-Id: I34ce126d36420b8194c88c0faa865294334a6658
2016-10-10 03:24:09 +02:00
Neels Hofmeyr 5275c152e5 Revert "bsc: count the usage of codec by setting the lchan active"
This reverts commit 38e9ea3f7f.

Introduced a reproducable segfault, because msg->trx is not actually set/used
in the openbsc code paths.

 Program received signal SIGSEGV, Segmentation fault.
 count_codecs (lchan=0x1, bts=<optimized out>) at ../../../src/libbsc/abis_rsl.c:104
 104                             rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_CODEC_V1_FR]);
 (gdb) bt
 #0  count_codecs (lchan=0x1, bts=<optimized out>) at ../../../src/libbsc/abis_rsl.c:104
 #1  0x0000000000425661 in abis_rsl_rx_dchan (msg=<optimized out>) at ../../../src/libbsc/abis_rsl.c:1516
 #2  abis_rsl_rcvmsg (msg=0x8143f0) at ../../../src/libbsc/abis_rsl.c:2611
 #3  0x00007ffff71420d0 in handle_ts1_read (bfd=<optimized out>) at ../../src/input/ipaccess.c:271
 #4  ipaccess_fd_cb (bfd=0x815af8, what=1) at ../../src/input/ipaccess.c:386
 #5  0x00007ffff7779b62 in osmo_fd_disp_fds (_eset=0x7fffffffe590, _wset=0x7fffffffe510, _rset=0x7fffffffe490) at ../../src/select.c:149
 #6  osmo_select_main (polling=polling@entry=0) at ../../src/select.c:189
 #7  0x0000000000406fac in main (argc=<optimized out>, argv=0x7fffffffe738) at ../../../src/osmo-nitb/bsc_hack.c:385
2016-10-10 02:33:59 +02:00
Max 2d66bb2099 DTX: add flag for AMR HR P*
Add flag to explicitly track the state of DTX DL for AMR HR whe
SID_FIRST_P1 has been sent to L1 already but no next frame available
yet: this can be followed by SID_FIRST_P2 or SID_FIRST_INH depending on
arrival of voice frame within next 60 ms.

Change-Id: Id28b07b8e83cfe5e84de48a2f124084036580cd4
2016-10-05 05:48:16 +00:00
Max 63c18ca791 DTX: extend SID cache
In addition to RTP payload SID cache got to store CMR/CMI prefix. Extend
the buffer so it can fit in.

Change-Id: Ibd4a63604a82cad3ce65f0752bffefa4b083e1b3
Fixes: Coverity CID#149508
2016-10-05 05:48:11 +00:00
Alexander Couzens 3316397921 gprs/gprs_llc: count UI frames over SAPI in the statistics
Change-Id: I5f38d70e046ce9ca1342e6f862329dc3cded8995
2016-10-04 17:53:21 +02:00
Alexander Couzens 92f552f344 msc: add counters to track call attempts/active/success/failed
active_calls describe all calls in active state.
call.complete Call got terminated by disconnect requested either by MS or MSC.
call.incomplete Call got terminated by any other reason.
call.active Calls reached active state.
Change-Id: I49b93af2e6a0ba16c2fb00b7b83974e8a6a16df3
2016-10-04 01:08:12 +02:00
Alexander Couzens 38e9ea3f7f bsc: count the usage of codec by setting the lchan active
we count the codec when the channel was successful setted up

Change-Id: Ifc8a406a11dce16b9e7f3310841e470545550a2c
2016-10-04 00:55:05 +02:00
Neels Hofmeyr a8f91df851 configure: check for pkg-config presence
Change-Id: I1484fc8b870df6f0aeef0c13078c66d0cfa97e75
2016-10-01 01:01:53 +02:00
Neels Hofmeyr b81031292b build: be robust against install-sh files above the root dir
Explicitly set AC_CONFIG_AUX_DIR.

To reproduce the error avoided by this patch:

  rm install-sh        # in case it was already generated.
  touch ../install-sh  # yes, outside this source tree
  autoreconf -fi

This will produce an error like

  ...
  configure.ac:16: error: required file '../ltmain.sh' not found
  configure.ac:5: installing '../missing'
  src/Makefile.am: installing '../depcomp'
  autoreconf: automake failed with exit status: 1

See also automake (vim `which automake`) and look for 'sub locate_aux_dir'.

Change-Id: I3b6d9ad4e5af44c2bdf3844c7bf8e8517bd61d8e
2016-10-01 01:01:53 +02:00
Philipp Maier ea291e3004 SGSN: Fixing build config
Tests for V.42bis, slhc, llc-xid and sndcp-xid are built and
executed on all build configurations, but are only needed when
the sgsn (gprs) is built. This patch adds conditions check
if the tests mentioned abvove are needed or not.

Change-Id: I6921e6198ea7f99fe5276f91cbc522091853bc4e
2016-09-30 12:42:48 +00:00
Neels Hofmeyr 0867b72055 vty_test_runner.py: fix indents to use spaces, fix vim comment
Most of this file uses four spaces of indenting. Replace all tabs with spaces.

Remove the erratic 'set' from the recently added vim comment at the bottom.

Change-Id: I4273b3314defb1e5b31b509c2ac7d7c6cd6834cf
2016-09-30 12:42:20 +00:00
Neels Hofmeyr 0a45c1e77d vty_test_runner.py: make unittest print all output by default
Add option to TextTestRunner that shows print output on stdout.
It's better to see everything in our jenkins runs and not hide test output.

Change-Id: If4be1ad1c81c9ed4ab9b208b4c6d1e4b2cc8fdd5
2016-09-30 12:42:20 +00:00
Neels Hofmeyr aba82097b6 log CTRL bind only once
After libosmocore 38d232ee5d2ceb045d9ad6d3a23afcb4972523f7 which outputs
'CTRL at <ip> <port>' from ctrl_interface_setup_dynip(), there's no need to log
the CTRL bind here anymore.

Change-Id: I1a874efe365a1ecf8ec37b058215b95b9a635ec2
2016-09-30 03:12:46 +02:00
Neels Hofmeyr c6a44bbab9 fix: send SNDCP XID only on GERAN Gb contexts
Add a condition for GERAN Gb.

SNDCP and IuPS were developed on separate branches, and the merge results in
code trying to use an llme on a UTRAN Iu context where the llme is NULL,
leading to stack corruption upon PDP ctx act.

Change-Id: Ibb20d738c1b64d36630ce8eceb54c33ba4f1b003
2016-09-29 03:24:57 +02:00
Neels Hofmeyr caeb62d7ff vty_test_runner.py: fix nat_msc_test(): socket attach: reduce timeout, retry
In nat_msc_test(), upon socket timeout, retry up to six times. Reduce the
timeout between retries. This should get rid of sporadic test failures that
we've been seeing a lot on jenkins lately.

Raise an exception upon unexpected vty response.

Print more detail to stdout. Since we would actually want as much output as we
can get in a test suite, remove the 'if (verbose)' and just always print the
connection source. unittest is keeping all stdout silent by default anyway.

Change-Id: I2f83eef55592778e54164a90e1eabeb80fb918da
2016-09-28 23:53:24 +02:00
Harald Welte 7e5bb6283d COSMETIC: 'if' is not a function, so there is space before '('
Change-Id: Ic22623dffce998d70a3c67aa6e445de98f558ed7
2016-09-28 00:47:28 +00:00
Neels Hofmeyr 3ea9fece6d cosmetic: bs11: also use ts_is_tch()
Use the recently added ts_is_tch() function instead of an explicit switch to
determine TCH pchan types. This is a cosmetic change since the bs11 does not
support dynamic channels (which was the main motivator behind ts_is_tch()).

Change-Id: Idf8ce51c76a83210fe3d70e18c51bbaffebb8ad5
2016-09-28 00:28:01 +00:00
Neels Hofmeyr 255dbfe655 dyn TS: fix: e1_config.c: switch(pchan) for dyn TS
Add ts_is_tch() in gsm_data_shared.h/.c and use it to replace a switch on the
pchan in e1_config.c.

This patch is not due to an actual observed failure. A general grep for switch
on pchan turned up this instance that doesn't handle dyn TS properly. Hence
this patch is not actually tested with real equipment.

Change-Id: Ide4f156034bab77140d2d9a8c462d68ae6f0d6a6
2016-09-28 00:28:01 +00:00
Neels Hofmeyr 23c3aa37ac dyn TS: fix: abis_om2000: also handle dyn TS as TCH
Add ts2comb() to switch on dyn TS so that dyn TS in TCH mode are also treated
like normal TCH/H or TCH/F pchans. Use ts2comb() instead of pchan2comb().

Change-Id: Iddc51a4409488d91db59228ca66aaab73ce3f1df
2016-09-28 00:28:01 +00:00
Neels Hofmeyr c3f72f63af dyn TS: fix: ts_subslots() for TCH/F_PDCH in PDCH mode
In gsm_data_shared.c, add ts_pchan() to determine actual pchan type for dynamic
and non-dynamic TS.

Use in ts_subslots() to fix the value returned for TCH/F_PDCH in PDCH mode.
Adjust the assertion in channel_test.c accordingly.

Drop GSM_PCHAN_TCH_F_PDCH, which is now handled in ts_pchan().
Explicitly add GSM_PCHAN_PDCH as zero in subslots_per_pchan[] (cosmetic).
Adjust the comment in subslots_per_pchan[].

The fix for the number of subslots affects only one caller: bts_chan_load() in
chan_alloc.c. Before this, it would always include a TCH/F_PDCH in the
load_counter->total, now it is skipped when in PDCH mode. Whether this is the
way bts_chan_load() should handle dynamic TS is a separate discussion, so far
I'm only making sure that the two dyn TS kinds act in the same way:
TCH/F_TCH/H_PDCH is only counted when in TCH mode, and TCH/F_PDCH should match.

Change-Id: Icd6668667ad2be7ad20866ffd185bf3b8711ccd6
2016-09-28 00:28:01 +00:00
Neels Hofmeyr 2afffd5cf6 Revert "bts: extend bts_chan_load to allow counting tch only"
This reverts commit 308cb0719d.

Problems in this commit:

openbsc/src/libbsc/chan_alloc.c:523:   case GSM_PCHAN_TCH_F_PDCH:
This is actually wrong, GSM_PCHAN_TCH_F_PDCH use ts->flags, not ts->dyn below
(due to historical reasons and could be unified).

560:   if (only_count_tch && !chan_is_tch(ts))
This has exactly one effect: it excludes GSM_PCHAN_TCH_F_PDCH when in PDCH
mode, because for all other PDCH (plain PDCH and TCH/F_TCH/H_PDCH in PDCH mode)
below ts_subslots() returns 0 and skips the for() loop. I consider this a bug
in TCH/F_PDCH, to be fixed in an upcoming commit.

I don't see why we need the only_count_tch argument, because this should
normally only count TCH, weren't it for the TCH/F_PDCH bug.

If dyn TS should be counted differently, we should do this in a different way.

Change-Id: I34dbbaf53a800115e3d03bd44028cad675f3b525
2016-09-28 00:28:01 +00:00
Neels Hofmeyr e289a2a86a channel_test: test nr of subslots for dyn pchan, with error
Add test_dyn_ts_subslots() and call from main(). Update channel_test.ok.

This includes erratic assert to show a bug for TCH/F_PDCH in PDCH mode: the nr
of subslots should be the same as for a normal PDCH, i.e. zero. This will be
adjusted along with the fix in an upcoming commit.

Change-Id: I09685be3fb3ed1ead4577b772a9fbc31967980d1
2016-09-28 00:28:01 +00:00
Neels Hofmeyr 8d878e8a28 channel test: prepare to add another test function
Move the main() guts to test_request_chan(), so that I can add another test in
an upcoming commit.

Change-Id: I1349d0f416806416080d4667ad697f7db1ea252d
2016-09-28 00:28:01 +00:00
Neels Hofmeyr 57e8a1fee0 cosmetic: comment typo on e1_config.c
Change-Id: I894adf562670abf26665a1eb09592682ab8b31b5
2016-09-27 09:59:39 +00:00
Philipp Maier 3163f336f2 SLHC: Improving slhc (RFC1144) testcase
- Adding Testcases for  UNCOMPRESSED_TCP and TYPE_IP
- Minor cosmetic changes

Change-Id: I555fa3c9b9f78424102f359ef1c27b290fa9c9e9
2016-09-27 05:52:20 +00:00
Neels Hofmeyr dab3e34d0b log VTY telnet bind only once
After libosmocore 55dc2edc89c1a85187ef8aafc09f7d922383231f which outputs
'telnet at <ip> <port>' from telnet_init_dynif(), there's no need to log the
telnet VTY bind here anymore.

Change-Id: I97a730b28759df1d549a5049f47a3da1c16a3447
2016-09-27 05:00:18 +00:00
Neels Hofmeyr 89d20b60ef vty_test_runner.py: raise exception when MSC socket connection fails
Instead of below error, raise an exception to describe what's happening.

Seen in a jenkins run on https://gerrit.osmocom.org/#/c/945/2:

ERROR: testBSCreload (__main__.TestVTYNAT)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./vty_test_runner.py", line 787, in testBSCreload
    msc = nat_msc_test(self, ip, port)
  File "./vty_test_runner.py", line 1251, in nat_msc_test
    return conn
UnboundLocalError: local variable 'conn' referenced before assignment

Change-Id: Iae26e7345267a21aed0b108b089453832889c9fa
2016-09-26 13:00:35 +02:00
Neels Hofmeyr 23d37c91af cosmetic: vty_test_runner.py: add comment for vim auto settings
Change-Id: I61a0476a0317b011432bb4f6f593cfdcaf1c072b
2016-09-26 13:00:35 +02:00
Neels Hofmeyr a9f2bb5ab8 mscsplit: directly access gsm_network backpointer from gsm_subscriber_connection
The previous commit added a network backpointer to gsm_subscriber_connection.
Use it wherever it makes sense, to skip the step through the bts structure.

In some places, remove local variables that become unused.

Change-Id: I34537025986713291e14c8212a81539b497befd4
2016-09-26 02:25:46 +02:00
Neels Hofmeyr 5e0b0a658f mscsplit: add gsm_network backpointer to gsm_subscriber_connection
We want to be able to use a network backpointer without having to go through a
gsm_bts struct.

This commit adds the network pointer, the subsequent commit applies direct
access to the network structure from gsm_subscriber_connection.

Change-Id: If8870972f1b3e333c2a4cce97cdc95bdee0382a1
2016-09-26 02:25:46 +02:00
Neels Hofmeyr 663debcb90 mscsplit: abis vty: decouple from global bsc_gsmnet variable
Publish gsmnet_from_vty() in openbsc/vty.h and use in the abis VTY functions.

Change-Id: Ib65a18db06b8bc4fc7d56bf56dd64a52cc1cd253
2016-09-26 02:25:46 +02:00
Neels Hofmeyr 43d86bfc94 mscsplit: bsc_vty_init(): decouple from global bsc_gsmnet
Add an explicit gsm_network pointer instead of using the bsc_gsmnet global.
This allows passing a gsm_network struct from the main() scope, which helps to
decouple libmsc from libbsc.

Change-Id: I9e2c0d9c18d4cebb5efb71565ad84df2bc2e0251
2016-09-26 02:25:46 +02:00
Neels Hofmeyr c13e687742 mscsplit: talloc_ctx_init(): decouple from global tall_bsc_ctx
Decouple the talloc context allocations from global tall_bsc_ctx pointer.

It appears that talloc_ctx_init() was intended for general use, since it is
located in libcommon. It is currently used only by osmo-nitb; but the upcoming
osmo-cscn will use it as well.

Instead of defining in osmo-nitb main file, add definition in gsm_data.h.

Change-Id: I168106599b788f586be0ff0af4699b9746c1b103
2016-09-26 02:25:46 +02:00
Neels Hofmeyr 77c8d5ffb5 mscsplit: gsm_network_init(): add explicit root talloc ctx
Decouple the root talloc context from libbsc's global talloc_bsc_ctx.

This allows to define the root talloc ctx from a main() scope, which in turn
helps decouple libmsc from libbsc.

Change-Id: I92f6b47b1eeea2e8f3fba66f25d7e708e5659f8a
2016-09-26 02:25:46 +02:00
Neels Hofmeyr d90fa42dc9 mscsplit: move subscriber conns list into struct gsm_network
Replace the global sub_connections llist with gsm_network.subscr_conns.
Initialize and apply where applicable.

Remove bsc_api_sub_connections(), callers now access gsm_network->subscr_conns
directly.

This allows using the subscr_conns from libmsc without having to link libbsc.

Change-Id: Ice2a7ca04910bcfaaff22539abe68a6349e8631c
2016-09-26 02:25:46 +02:00
Neels Hofmeyr 0ce98c749a mscsplit: bsc_init: don't pass telnet dummy conn
We want to create the telnet for VTY only after reading the config file, and
the dummy_conn was a workaround to be able to do so, but is not needed:
gsmnet_from_vty() used to expect vty->priv to point to a gsm_network struct,
but that is not actually the case anymore. It is using a static pointer to
store the gsm_network struct instead.

Change-Id: I51e7224c5a4cd5baf564bee871cf2fa6e885cda7
2016-09-26 02:25:46 +02:00
Philipp Maier 73f83d533b SNDCP: add V.42bis data compression functionality
- Add compression control for V.42bis Add code to handle compression
   (gprs_sndcp_dcomp.c/h)
 - Add Adjustments in SNDCP
 - Add VTY commands

Change-Id: I6d36cbdf2f5c5f83ca9ba57c70452f02b8582e7e
2016-09-24 03:17:59 +00:00
Philipp Maier d8b45778de V.42bis: integration and unit test
- Edit previously committed V.42bis implementation to function
   outside IAXmodem.
 - Add unit test to verify the correct function of V.42bis

Change-Id: I689413f2541b6def0625ce6bd96f1f488f05f99d
2016-09-24 03:17:59 +00:00
Philipp Maier 0b11db7e9f V.42bis: add sourcecode from IAXmodem (SPANDSP)
V.42bis is a data compression method found in modems. It has also
been specified for GPRS as data compression algorithm.

The implementation has been taken from IAXmodem:

https://sourceforge.net/p/iaxmodem/code/HEAD/tree/
svn checkout svn://svn.code.sf.net/p/iaxmodem/code/ iaxmodem-code
Revision: r36

Change-Id: Iabedece9f97ca944a1e3f747bb073e532c4e9dca
2016-09-24 03:17:59 +00:00
Philipp Maier f1f34360fb SNDCP: add RFC1144 header compression functionality
- Add module to handle compression entities
- Add module to control header compression
- Introduce VTY commands for heade compression configuration
- Add changes in sndcp and llc to integrate header compression

Change-Id: Ia00260dc09978844c2865957b4d43000b78b5e43
2016-09-24 03:17:58 +00:00
Philipp Maier 2c7f83762a RFC1144: integration and unit-test
The previously pushed slhc implementation has been modified to compile
and function outside of the kernel. Also debug log messages were added
and datatypes ware matched. The implementation is now ready to be used

Change-Id: I7a638e88a43b3eb9d006751a03ef2570e36613f0
2016-09-24 03:17:58 +00:00
Philipp Maier b3e116c74d RFC1144: add slhc code from linux kernel
SLHC is an Implementation of RFC1144 TCP/IP header compression. We will need
RFC1144 compression to compress GPRS TCP/IP traffic. The implementation pushed
with this commit was taken from:

git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
commit 29b4817d4018df78086157ea3a55c1d9424a7cfc

Change-Id: Ied69c143678dc4a64cecc671f5c4dfebe19d8519
2016-09-24 03:17:58 +00:00
Philipp Maier 22611be3d9 SNDCP: add SNDCP-XID encoder/decoder and unit test
The SNDCP-XID (or layer-3 xid) is used to exchange layer-3 parameters
such as compression. The encoder encodes a bytestream that is then
sent as regular XID field from LLC.

We will need the SNDCP-XID to negotiate the parameters for our
upcomming GPRS data and header compression features

Change-Id: If2d63fe2550864cafef3156b1dc0629037c49c1e
2016-09-24 03:17:58 +00:00
Alexander Couzens 308cb0719d bts: extend bts_chan_load to allow counting tch only
Change-Id: I86f1d502649747b6b9aefcb39081b14110e8f494
2016-09-23 02:43:12 +00:00
Neels Hofmeyr 7c359eb4b4 cosmetic fixes in libcommon/talloc_ctx.c
Add copyright notice, remove obsolete include, remove unneeded line break.

Change-Id: I4d06a0323aee5a003b06edd179fc61e1936acae5
2016-09-22 21:11:42 +02:00
Neels Hofmeyr 8ce66fd19e cosmetic: transaction.h: 1 comment typo, 1 whitespace
Change-Id: Ia2629f9d9887b50b25c6996531b7ef518fb33335
2016-09-19 11:51:12 +00:00
Neels Hofmeyr 1e918c3d31 debug log for sms: fix/add
One logged the wrong function name. Add others.

Change-Id: Ied5d8e84d5d192c826bc131be8907eaa55190479
2016-09-18 23:40:06 +02:00