aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2016-09-28osmo_select_main(): drop useless call to osmo_timers_check()3G_2016_09Neels Hofmeyr1-2/+0
osmo_timers_check() does nothing more than counting the active timers. It is of no use to count them when not using the return value in any way. Change-Id: I8d35ca90a4c16d6f1c7f9793d663e5479783efed
2016-09-28AMR: add function to check speech framesMax1-0/+21
Add convenience function osmo_amr_is_speech() to check if given AMR frame is speech frame: non-speech frames often require special processing. Change-Id: Ifaab02a2f581acc302b367d34fd2fc28a4d1e2e3
2016-09-27gsm0408_test: initialize msgb talloc ctxNeels Hofmeyr1-0/+1
Change-Id: Ib26214add1932e93651c248cc09fbc68339b4dce
2016-09-27msgb: add msgb_talloc_ctx_init(), deprecate msgb_set_talloc_ctx()Neels Hofmeyr2-2/+24
So far each and every main() scope creates a msgb talloc context and either passes it to msgb_set_talloc_ctx() or sets tall_msgb_ctx directly (by defining it extern first). Remove some code duplication: add one central function that creates the "msgb" talloc context for all. Most users of msgb employ a talloc_named_const(), but osmo-bts uses a talloc_pool() instead. Offer both ways by means of the pool_size argument, and for both ways make sure the context is called "msgb". Suggest that msgb users should move to this new function: deprecate msgb_set_talloc_ctx(). To be able to do so, include core/defs.h in msgb.h. There's a tradeoff between hiding the msgb talloc context behind API that tries to guess all use cases versus avoiding code dup. This patch opts against code dup and boldly assumes that all future use is covered. Also, the new function suggests to not access tall_msgb_ctx directly, which can be considered a style improvement. It seems that not all main scopes that use msgb actually initialize the msgb ctx. As a fallback for these, explicitly initialize tall_msgb_ctx to NULL. Change-Id: I747fbbf977c4d2c868c8dead64cfc5fd86eb8d4c
2016-09-26bitrev_test: don't omit last byte from test result checkNeels Hofmeyr2-25/+28
The osmo_hexdump of the output in sh_chk() omitted the last byte of the returned bytes from the osmo_nibble_shift_*() functions. Determine the number of bytes from nibbles divided by two plus one for any odd nibble number. Output this number of bytes of output data. Memset the output buffer to get well-defined bytes for unwritten places. Also assert that we have enough buffer length for all nibbles. Change-Id: I011f42bca555caec0dfe8688ff1f28303fa04fad
2016-09-26Fix ASAN failure in bitrev_testMax2-3/+3
Previously while testing osmo_nibble_shift_left_unal() following error was triggered by AddressSanitizer upon offs == 12 and the last sh_chk line, i.e. shift left of 12 nibbles from in2: ==3890== ERROR: AddressSanitizer: stack-buffer-overflow on address 0xbff5b5b6 at pc 0xb6186862 bp 0xbff5b4a8 sp 0xbff5b49c READ of size 1 at 0xbff5b5b6 thread T0 #0 0xb6186861 (/home/msuraev/source/gsm/libosmocore/src/.libs/libosmocore.so.7.0.0+0xc861) #1 0x8049d8b (/home/msuraev/source/gsm/libosmocore/tests/bits/.libs/lt-bitrev_test+0x8049d8b) #2 0x804a9d1 (/home/msuraev/source/gsm/libosmocore/tests/bits/.libs/lt-bitrev_test+0x804a9d1) #3 0xb5fe3af2 (/lib/i386-linux-gnu/libc-2.19.so+0x19af2) #4 0x8048a30 (/home/msuraev/source/gsm/libosmocore/tests/bits/.libs/lt-bitrev_test+0x8048a30) Address 0xbff5b5b6 is located at offset 38 in frame <main> of T0's stack: This frame has 3 object(s): [32, 38) 'in2' [96, 104) 'out' [160, 168) 'in1' The reason is incorrect range in test cycle. Fix it and adjust test output accordingly. Tweaked-by: Neels Hofmeyr <nhofmeyr@sysmocom.de> Fixes: OW#1589 ("undefined behavior in libosmocore triggered by tests") Change-Id: I5eb3f600290c05b4ab9ac2450a28d616e6b415fd
2016-09-24utils/conv_gen.py: code style changes (line width, tabs, etc.)Vadim Yanitskiy1-181/+233
Change-Id: I8550910b9f5c16efc6f15f23c7ee52122c588752
2016-09-23gprs: Increase NS_ALLOC_SIZE to 3kDaniel Willmann1-1/+2
2k can be insufficient when responding with a STATUS message to a long LLC packet because the original message is included in the STATUS. Change-Id: I6f76751cfadf61e87ce4367a38907083e1c98562 Ticket: SYS#2967 Sponsored-by: On-Waves ehf
2016-09-23log CTRL bind address and portNeels Hofmeyr1-0/+3
Log 'CTRL at 1.2.3.4 5678' from ctrl_interface_setup*. All callers can now drop any extra 'CTRL at 1.2.3.4 5678' logging. Change-Id: If449d0514e3d0cc1b346d7452194d931aa090166
2016-09-23log telnet bind address and portNeels Hofmeyr1-1/+8
Log 'telnet at 1.2.3.4 5678' from telnet_init*. All callers can now drop any extra 'VTY at 1.2.3.4 5678' logging. Change-Id: I1da7b9076311d9458caea732fc0daace6533a3fd
2016-09-22timer_test: set 8 as default steps, use the default in testsuite.atNeels Hofmeyr3-16/+281
Change-Id: I5070578e9fe2bdacaad000eaafb8dc5f549d6f3e
2016-09-22timer_test: print more details to stdout to checkNeels Hofmeyr2-4/+116
The test is now fully deterministic, so include all detail in stdout, to check for. Change-Id: Iecf6387f1d25253fcf1260777673853030c1d326
2016-09-22timer_test: redirect some output from stderr to stdoutNeels Hofmeyr2-20/+24
This way we can check the output in timer_test.ok. Change-Id: Ia3bba1c650be3558d370e0f59d4ee7f36ef97506
2016-09-22timer_test: remove all random elementsNeels Hofmeyr1-3/+6
Change-Id: I9833031407e99f5d7a1144c26b68a7e320b2020d
2016-09-22timer_test: do not use real time: deterministic and fasterNeels Hofmeyr1-20/+15
Use osmo_gettimeofday_override* to decouple the timer test from real time. No longer call osmo_select_main(), since select() actually waits for real time. This reduces the timer_test to the osmo_timer_* logic and excludes the real time and osmo_timers_nearest() accuracy testing with actual waiting involved. This may be seen as a loss, but is more fit for a test suite. The main point here is to get deterministic results in jenkins, so that we don't have to retrigger jobs based on timing failures; added bonus is that the test runs much faster now. Change-Id: Ic5649512df86dd17070daa2f314159eafaf8feb8
2016-09-22add osmo_gettimeofday as a shim around gettimeofdayNeels Hofmeyr10-17/+87
This allows feeding a custom time for unit tests by overriding osmo_gettimeofday. Change-Id: Ic7a81a6eb51f27fe452962b91f2eae2070d87089
2016-09-22timer_test: remove unused precision values and confusing logNeels Hofmeyr2-8/+2
Change-Id: I1570b7096c757d63d23e0950feeeb7230f8a5c9f
2016-09-22timer_test: also report early finishes, report timing on errorNeels Hofmeyr2-5/+19
When a timer was late, show the timing details. Also count whether timers fired early, for completeness' sake. Change-Id: Id3942637d77a28b5092ffffcc3e6d9d67c2b8e68
2016-09-22fix timer_test: don't forget to set tv_usec on the stop timeNeels Hofmeyr1-0/+1
The timer_test schedules timers and records the desired stop time. Also store the usec value of the desired stop time, because scheduling at e.g. sec N usec 999999 but recording sec N usec 0, and then receiving a timer at sec N+1 usec 0 is only 1 usec late, but records as 1000000 usecs late. This might have been the main cause of the timer test not working well on the osmocom build server. Change-Id: I13bb60f7d341a397f95d13d9c63c40188b6cd5a0
2016-09-19remove unused local variable in get_rate_ctr()Neels Hofmeyr1-1/+1
Unused after 22886d9e320ecf734d2827d825a191b977f70d2c "Fix retrieving rate_ctr over control interface" Change-Id: Ib5411da80c4eb4f905a5ed87c60477eca2cdff42
2016-09-19remove unused function get_rate_ctr_group()Neels Hofmeyr1-37/+0
Unused after 22886d9e320ecf734d2827d825a191b977f70d2c "Fix retrieving rate_ctr over control interface" Change-Id: I405367ef6ba5833957778a79dd398ce5ea29307e
2016-09-10build: tests: don't link system installed libosmogsm.Neels Hofmeyr1-5/+10
Add src/gsm/libosmogsm.la explicitly to some test linkages, because otherwise the linker would pick the libosmogsm already installed on the system instead of the one that was just built in the source tree. I noticed because a libosmogsm needing some more symbols from libosmocodec was still installed, while the patch that cause it was already removed. Thus I caught all(?) test binaries that linked libosmogsm from $PREFIX. Change-Id: Ie61d60e1506f16de20add70fd0f44ebfa7a00a75
2016-09-09fix GGSN Ctrl port to 4257Neels Hofmeyr2-1/+2
4253 used to collide with the sysmobts-mgr VTY port. Note, openggsn does not actually have a Ctrl interface yet. Change-Id: If0fa0e606dabd5bc89907a56ef18cdbbbdedb4b7
2016-09-09comment: */ports.h: link to wiki + manuals, indicate used portsNeels Hofmeyr2-2/+16
Change-Id: I6a7bf04e589ccfaea98f20900a9bfe9dd4808dce
2016-09-09Add Marker to ph_tch_paramMax2-1/+3
Extend struct ph_tch_param with Marker bit from RTP header to indicate speech onset in case of DTX. Change-Id: Ic664902630b9d335ff9abc7a9ca7249eaf80e05f Related: OS#1750
2016-09-09libosmocodec link fix on MacOSXAnatoly Orlov1-0/+1
Fixes the following bug: CCLD libosmocodec.la Undefined symbols for architecture x86_64: "_bitvec_get_bit_pos", referenced from: _osmo_fr_check_sid in gsm610.o "_bitvec_get_uint", referenced from: _osmo_hr_check_sid in gsm620.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [libosmocodec.la] Error 1 Change-Id: Id7358b94e274b529a8da38a0b2ef8c892b6dd7a5
2016-09-09fix error msg: msgb_put(): say "msgb_put", not "msgb_push"Neels Hofmeyr1-1/+1
Change-Id: I72f31ebad693f98eb088a99b83aeb10cf9acc29e
2016-08-30core/counter: add osmo_counter_dec()Alexander Couzens1-0/+6
Change-Id: I030140a45afa295c3ebc4d3ccaffd437b984f515
2016-08-29IuPS: add GMM Service Request related constants and value_strNeels Hofmeyr3-0/+28
Change-Id: Ie023fc78099932f95cc8f1b3a04fe25dfd14bc35
2016-08-29fix printf format for commit 'osmo_sock_init(): include host and port in ↵Neels Hofmeyr1-1/+1
error messages' Related: CID#143566 Change-Id: I75c542089749a0875d3d1913151fe838d7722ff2
2016-08-27osmo_sock_init(): include host and port in error messagesNeels Hofmeyr1-5/+16
For programs like osmo-hnbgw with numerous sockets, the message that some unspecified connection was refused is not very helpful. Also output the host and port where an error occured. Instead of perror, use fprintf(stderr, ..., strerror()) to be able to include a format string and print host and port as passed to osmo_sock_init(). Change-Id: I8d0343f51310699b78fcb83fd76fd93764acf3dc
2016-08-20vty: use VTY_BIND_ADDR_DEFAULT instead of "127.0.0.1"Neels Hofmeyr1-1/+1
Change-Id: Ice0688ac9847524cb546f6d41547090b6a3cb3d8
2016-08-09configure: check for pkg-config presenceNeels Hofmeyr1-0/+15
On a fresh installation, I was puzzled by a configure.ac 'syntax error' for PKG_CHECK_MODULES(TALLOC). It took me some time to figure out that merely pkg-config was missing. Add a check for pkg-config, which isn't as straightforward as I would wish, so comment generously. Change-Id: I2e7cdc37eb59f9947a45fbc5baddbaf71b655bc0
2016-08-08Add control interface port for GGSNMax1-0/+1
Change-Id: Ie7232189fe3265a8631fd3652b2c8c152cdee918 Related: OS#1646
2016-08-08Add .mailmap file for mapping mail addresses in shortlogHarald Welte1-0/+12
Change-Id: Id6b42bb9ab10f46b76b26057c8228e5da480286d
2016-08-04Extend L1SAP with MeasurementsMax2-1/+5
We already have RSSI parameter in PH-DATA. Add other measurement information (BER, BTO, Link Quality). Change-Id: I2b127eb1856c4cd1bc46490a89592a595f1ee86b Related: OS#1616
2016-08-01fsm: Make sure we call 'onenter' of new state, not old stateHarald Welte1-0/+1
Change-Id: I1a0181c25d9debe935e86d97ddffc24675e56a5f
2016-08-01lapd_core: Fix crash in lapd_dl_flush_hist()Harald Welte1-1/+1
When lapd_dl_flush_hist() was called before we actually had started a transmit history from lapd_dl_init(), we woul segfault before this patch. Change-Id: Ifa677c9b335dd2884b4f3e44699d901957a0500b
2016-07-28Mark input string to osmo_talloc_replace_string() as constHarald Welte1-1/+1
This allows us to pass in strings that are 'const', which for the source of a copy should be the normal/regular case anyway. Change-Id: Icee6a5f88babd3a4e30bf0886f0f8d3b865d80ce
2016-07-25egprs: Add CPS tables from TS 04.60Tom Tsou5-1/+137
Includes EGPRS coding and puncturing scheme (CPS) tables from 3GPP TS 04.60. Currently osmo-bts-trx is the only user of CPS table values, but this may change with gprsdecode and other utilities. Change-Id: I09fe6514a0e2e51bb3206f8387633f7e0255345f
2016-07-24Update structure in libosmocore for 11 bit RACHbhargava1-1/+11
Parameters are added to the structure ph_rach_ind_param to differentiate the type of RACH received from Layer 1. This is to further support the 11 bit RACH. Change-Id: Ic4f0f2424a3af7599d986044be25ea4fcc0ca477
2016-07-23Add define for invalid TAMax1-0/+2
Add GSM48_TA_INVALID which is invalid Timing Advance value according to 3GPP TS 44.018 § 10.5.2.40. Change-Id: I061760ccac656f39164562a7883f8ab522cd0911 Related: OS#1526
2016-07-23rsl: add rsl_act_type_name()Neels Hofmeyr3-0/+22
Change-Id: Ie90c76d8aef42d5e2c9be94f4b206d4994e305f8
2016-07-23dyn TS: add definitions for dynamic TCH/F_TCH/H_PDCHNeels Hofmeyr4-0/+6
Add: * GSM_PCHAN_TCH_F_TCH_H_PDCH * NM_CHANC_OSMO_TCHFull_TCHHalf_PDCH * RSL_CHAN_OSMO_PDCH * RSL_ACT_OSMO_PDCH Related: OS#1776 Change-Id: Ib1a8b11f37af4686d00ac88beba38557aa29edc2
2016-07-23gsm_08_58.h: introduce RSL_CHAN_NR_1 constantNeels Hofmeyr1-0/+1
Using the RSL_CHAN_* constants, we sometimes need to add 1 to the chan bits to indicate e.g. the second TCH/H channel. RSL_CHAN_NR_1 marks this lowest channel bit that needs to be added. The name is analogous to RSL_CHAN_NR_MASK. Change-Id: Iea06432039d1cd23cc6b5acec308bb829b596d47
2016-07-17fix compiler warning: gsup.c: missing bracesNeels Hofmeyr1-1/+1
osmo_auth_vector's first member is an array, so for a zero initializer, we should add a second set of array braces. Change-Id: Iace448caca8152e46244f26c3af250f2035c99eb
2016-07-16bitvec: Force inlining of bitvec_set_bit_pos/bitvec_set_bitHolger Hans Peter Freyther1-2/+2
The PCU is using bitvec_write_field a lot but on the arm-poky-linux-gnueabi-gcc v4.8.1 the calls to set_bit and set_bit_pos are not inlined. The inlined variant has been a more quick for the PCU compressed bitmap decompression testcase. Used objdump -d to look at the bitvec_write_field before and after the change. The branch to bitvec_set_bit is gone and a inlined version has been used. Change-Id: I0b6b90610f4c17f02e4efa064c3bf1ac2dccb22a
2016-07-16Add function to check TA validityMax1-0/+10
Check if given Timing Advance is valid according to 3GPP TS 44.018 § 10.5.2.40. Change-Id: I5cb6149d6e36fda8cb3f557e4d6d3a724da805a5 Related: OS#1545
2016-07-12ussd: Decode interrogateSS that doesn't have testHolger Hans Peter Freyther2-0/+13
Keith of Rhizomatica has an issue of a unrejected interrogateSS. Start with just decoding the message and printing the empty test and the code. What is kind of missing is the classification between invoke, returnResult and returnResultLast that we need to add in the long run. Change-Id: Iadfa156707a96f2a34f3948c7cc9a74435f17114
2016-07-12Add EGPRS RLC/MAC headers from 3GPP TS 04.60Tom Tsou2-0/+209
For shared use by osmo-pcu and osmo-bts-trx. Change-Id: I500cdc87cd30faf36c8cd92d234642f809c8f2aa