summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gsm0480: add gsm0480_create_ussd_notify() and *_release_complete()Neels Hofmeyr2016-12-013-0/+33
| | | | | | | | | | | Add two functions to create USSD messages. Moves and generalizes code from openbsc. Pending: use the new functions in openbsc. It looks like _release_complete() should also set trans_id and direction flag; but since this is moving code from openbsc that is apparently working, just place a fixme comment and don't change the functionality. Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0
* gsm0480: code dup: introduce and use gsm0480_l3hdr_push()Neels Hofmeyr2016-12-013-13/+19
| | | | | | | | Add function gsm0480_l3hdr_push() to push a struct gsm48_hdr to the start of a msgb. Use in gsm0480.c and gsm0411_utils.c. Further callers of the new function will follow in openbsc as well as another libosmocore patch for ussd. Change-Id: I54fce6053ab8362015686fe22dbcd38bf1366700
* gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and CHREQ_T_PDCH_TWO_PHASEAlexander Couzens2016-12-011-0/+2
| | | | | | For BSC-located pcu the BSC must understand the PDCH chan request. Change-Id: Ice44dcaaf798f93af3652a96c567f8e16a6cf784
* timer: only call the callback if not NULLAlexander Couzens2016-11-281-1/+2
| | | | | | Fix a crash in osmo-sgsn. Change-Id: I04d58d9580708cc0f6d0f4aa17d3e9f2c6235c8e
* ctrl_cmd_parse: Make coverity FORWARD_NULL happyHarald Welte2016-11-261-0/+1
| | | | | | | | | | | | The 'strtok_r' function requires passing a NULL as the first parameter on subsequent calls in order to ensure the code picks up where it left off on a previous call. However, Coverity doesn't quite realize this and points out that if a NULL was passed in as the third argument it would result in a possible NULL deref because the strtok_r function will assign the third argument to the first in the call is NULL. Change-Id: I7a9d08d0d4eae76a5207d285e32a25d1b384a57f Fixes: Coverity CID 135186
* Introduce osmo_strlcpy() function so we can stop using strncpy()Harald Welte2016-11-262-0/+24
| | | | | | | | | | | | | | | | I'm aware of the existing criticism on stlrcpy(), but I think it is still better than what we have now: stnrcpy(), sometimes with Coverity warnings and sometimes with a manual setting of the termination byte. The implementation follows the linux kernel strlcpy() which is claimed to be BSD compatible. We could of course link against libbsd on Linux instead, but I think it's reasonably small and simple to provide our own implementation. Future versions of libosmocore could use some autoconf magic and preprocessor macros to use the system-provided strlcpy() if it exists. Change-Id: Ifdc99b0e3b8631f1e771e58acaf9efb00a9cd493
* osmo_gsup_encode(): Make coverity happy by invariant checkingHarald Welte2016-11-261-0/+1
| | | | | | | | | gsm48_encode_bcd_number() can theoretically return a length in excess of the size of the bcd_buf, but only in case an overly-long IMSI is passed into the function (which would be illegal in the first place). Change-Id: If3dc68ee13ff784b487bbc686b777cec9057d537 Fixes: Coverity CID 135216
* osmo-sim-test.c: Fix rmsg checkHarald Welte2016-11-261-1/+1
| | | | | | | | we wanted to check for !rmsg, but used to check for !msg, missing error returns from read_record_nr(). Change-Id: I79b6a94b1aa947c8329317b0626865c3cd4159c1 Fixes: Coverity CID 57672
* telnet_interface: Handle osmo_fd_register() eror return codeHarald Welte2016-11-261-1/+6
| | | | | Change-Id: I5bc1c2cbb04e363d868355b5ed866b4840f16c61 Fixes: Coverity 57637
* osmo_sock_init(): Fix memory leak in error pathHarald Welte2016-11-261-0/+1
| | | | | | | We forgot to call freeaddrinfo() in an error path. Change-Id: Iccbd3beef4c4a70dc443131b909c45e650d8c6a2 Fixes: Coverity CID 135217
* Fix unchecked return valueof osmo_fd_register()Harald Welte2016-11-261-4/+12
| | | | | Change-Id: Ib040a7f94eb1bbec8270b66fd4c2aedef9d5346a Fixes: Coverity CID 57636
* build: make check: disable sim_test when built with --disable-pcscNeels Hofmeyr2016-11-164-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Numerous issues caused sim_test to be attempted even though libosmosim was not built: In configure.ac, the ENABLE_PCSC variable lacked an AC_SUBST() to be exported. Furthermore in configure.ac, no value 'yes'/'no' was assigned to the ENABLE_PCSC variable, only to the enable_pcsc value. In testsuite.at, encapsulating the sim_test in 'if ENABLE_PCSC' seems to have no effect, regardless (not even when using a variable that should be defined accurately). So fix with these steps, similarly to how we do it in openbsc: In AC_ARG_ENABLE, directly use 'ENABLE_PCSC' to assign 'yes'/'no'. Export the same using AC_SUBST(). Add tests/atlocal.in to translate ENABLE_PCSC to enable_sim_test (also add atlocal to AC_OUTPUT and distclean). Use enable_sim_test in testuite.at, as seen in openbsc: use AT_CHECK() to indicate skipping the test if enable_sim_test isn't 'yes'. Change-Id: I9e8740c7d2dfbd272e22fee85972ef3fda7184a8
* gsm_08_58.h: Add more Ericsson specific RSL IE IdentifiersHarald Welte2016-11-161-3/+22
| | | | Change-Id: Ib43948da956f23609b1b0995ecac0c796cc7c629
* RSL: Add defines for ericsson systinfo SI13Philipp2016-11-161-0/+4
| | | | | | | | | | | | | | Ericsson uses non standard information element tags when setting up the SI13 system information configuration. This applies to RSL_SYSTEM_INFO_13, which is normally 0x28, instead Ericsson uses RSL_ERIC_SYSTEM_INFO_13, which is set to 0x0C. Furthermore, Ericsson adds a propritary field called BCCH-Mapping, which is tagged as 0xf2 (RSL_IE_ERIC_BCCH_MAPPING) This patch addes these two information element tags in gsm_08_58.h Change-Id: Idc27352e286b9b8bbcbf0b31bdb676c3d13487a9
* Extend IPA error loggingMax2016-11-161-2/+2
| | | | | | | | Output more information in case of IPA protocol errors to make debugging easier. Change-Id: I7632d6e679e076bfbec9abc12da4a46cc27ccea1 Related: SYS#3028
* vty: Skip printing non-initialized log categoriesDaniel Willmann2016-11-151-0/+3
| | | | | | | | | Without this patch the vty command show logging vty will cause a segfault if not all elements of the log_categories array are defined. Ticket: OW#3053 Sponsored-by: On-Waves ehf Change-Id: Ieeba649c3bde6c9376d8e32b00b92beb37c08ef2
* msgb: add msgb_push_u{8,16,32}() functionsHarald Welte2016-11-111-0/+30
| | | | | | | Those work analoguous to msgb_put_*() but pre-pend the given value into the msg headroom, rather than appending it to the end. Change-Id: I7de63e9d04c2d2b678f1f20eef37f9be2c4f5ec2
* bssgp_rx_paging(): Fix parsing of P-TMSI IE in Paging messageHarald Welte2016-11-111-1/+2
| | | | | | | | | | | | | | | | | | | | | This was actually discovered by the following compiler warning in gcc-6.2.0: CC gprs_bssgp_bss.lo gprs_bssgp_bss.c: In function ‘bssgp_rx_paging’: gprs_bssgp_bss.c:544:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (TLVP_PRESENT(&tp, BSSGP_IE_TMSI) && ^~ gprs_bssgp_bss.c:548:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ *(pinfo->ptmsi) = ntohl(*(uint32_t *) ^ This is an actual bug. If we recevied a BSSGP Paging Request without P-TMSI, we might crash or report some random memory as P-TMSI to the caller in the output data structure. Change-Id: Ib4f307827cd7cccc91c1415a6fb5428d7cf8416d
* gan: Mark gan_pdisc_vals[] as public / non-static symbolHarald Welte2016-11-111-1/+1
| | | | | | | It is actually listed in libosmogsm.map, but still used to be a static symbol. That couldn't have worked. Change-Id: I6f3f04b683d906674ee7da9bab5762bb00cea916
* bssgp_vty: Remove dead code and compiler warningHarald Welte2016-11-111-7/+0
| | | | | | | | gprs_bssgp_vty.c:48:34: warning: ‘gprs_bssgp_timer_strs’ defined but not used [-Wunused-const-variable=] static const struct value_string gprs_bssgp_timer_strs[] = { ^~~~~~~~~~~~~~~~~~~~~ Change-Id: Ia41ccb7b227c41996cdef51dc6779bfc5b5a8d48
* statsd: Fix compiler warning (int32_t vs. int64_t)Harald Welte2016-11-113-3/+4
| | | | | | | | | Fixes the following compiler warning: stats_statsd.c: In function ‘osmo_stats_reporter_create_statsd’: stats_statsd.c:54:18: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] srep->send_item = osmo_stats_reporter_statsd_send_item; Change-Id: Id36914906e0982f6ac092a311210727de66b343a
* bitcomp: Remove the t4 decoding from libosmocoreHolger Hans Peter Freyther2016-11-104-151/+0
| | | | | | | | | | | | As outlined by mail on the 13th of July the tree based approach to decoding in the PCU is faster by order of magnitude. Instead of having a slow implementation in the library and a quick one in the PCU, let's only have a quick one in the PCU and at some point in the future move it to libosmocore. Execute the plan and remove t4_decode. Change-Id: I021424444625a097560d086c217c81eac4a5ee44
* Add logging and testing for FSM deallocationMax2016-11-082-4/+6
| | | | | | | | osmo_fsm_inst_alloc() logs allocation but osmo_fsm_inst_free() is silent. Fix this by adding log message for deallocation to make FSM lifecycle tracking easier. Also make sure it's covered by test suite. Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2
* Add null-pointer check to osmo_amr_rtp_dec()Max2016-11-072-6/+12
| | | | | | | Check that RTP payload we're about to decode is not NULL and return proper error code instead of segfaulting. Add corresponding test case. Change-Id: Ib6cda9900a41ed16bbfbde9df3de9d38e0a7469b
* Add osmo_fsm_unregister() to headerMax2016-11-022-1/+2
| | | | | | | Previously function was defined but not exposed so there were a way to register FSM but no way to unregister it. Change-Id: I2e749d896009784b77d6d5952fcc38e1c131db2b
* utils/conv_gen.py: explicitly import reduce()Vadim Yanitskiy2016-11-021-0/+1
| | | | | | | | This change finally makes the script able to be executed in Python 3 environment. Due to new Python 3 restrictions, the reduce() should be imported explicitly. Change-Id: Icbc81c29f1a226aeed2c1245a5d60809fe124005
* utils/conv_gen.py: don't mix print and write()Vadim Yanitskiy2016-11-021-32/+34
| | | | | | | This is mostly a code style change, but it also increases the compatibility with Python 3. Change-Id: I5c8271d973f766aeb9cbcab30c4eddfdab54fcbb
* Fix typo in osmo_fsm_log_addr()Max2016-11-011-1/+1
| | | | | | | Previously function parameter was ignored, fsm_log_addr was always set to false. Change-Id: I74f06eab2dfa81dbb95e01f0b4b26448fd1b98f8
* gsm0408: Completing GSM 04.08 RR message typesPhilipp2016-10-274-2/+123
| | | | | | | | | | | - Add missing message types to be up to date with the latest specification release (3GPP TS 04.18) - Add value strings to translate RR message type identifiers into human readable strings. (see gsm48_rr_msg_name() in gsm48.h Change-Id: I3ceb070bf4dc8f5a071a5d43c6aa2d4e84c2dec6
* COSMETIC: moving rr_cause_name() in gsm48.cPhilipp2016-10-271-5/+5
| | | | | | | | | | rr_cause_name() is located a far of from value_string rr_cause_names[] while other value string functions are located right below their related value string definitions. This commit moves rr_cause_name() below rr_cause_names[] as it should be Change-Id: Ie6c03a6ea02c370d8733db5ba2a709610cd70ce7
* utils/conv_gen.py: add EDGE MCS 1-9 definitionsVadim Yanitskiy2016-10-233-1/+301
| | | | Change-Id: Ie1452342f524a8b60f2babc07398a1d9c9e06aa3
* utils/conv_gen.py: fix some typosVadim Yanitskiy2016-10-231-6/+6
| | | | Change-Id: I3327b92715744af4ef61496ef0121555d9d24799
* utils/conv_gen.py: add RACH, SCH and TCH/AHS definitionsVadim Yanitskiy2016-10-233-1/+212
| | | | Change-Id: I0ea7151f4e8119a8798a9e129b951559e56b0d93
* gsm/gsm0503.h: fix typoVadim Yanitskiy2016-10-231-1/+1
| | | | Change-Id: I263d61111544eeb7227e1e0e8f2d14479eae2079
* utils/conv_gen.py: improve output formattingVadim Yanitskiy2016-10-231-6/+32
| | | | | | | | | | | To keep the generated tables readable, line with should be limited. So, now there are the following limitations: - _print_term(): up to 12 numbers per line, - _print_puncture(): up to 12 numbers per line, - _print_x(): up to 4 blocks per line. Change-Id: I95256c4ad402a3c088bdb6c5a5cda8b17c31881c
* utils/conv_gen.py: generate a single fileVadim Yanitskiy2016-10-233-326/+321
| | | | | | | | | | | | | | | | Instead of generating every convolutional code into a separate file (such as conv_xcch_gen.c, conv_cs3_gen.c), it is better to have a single file, containing all definitions, because as many convolutional codes we add, as many entries we will have to add into 'src/gsm/Makefile.am'. This approach increases readability of the Makefile.am, and also makes us able to share some data between some convolutional code definitions. For example: xCCH, RACH, SCH, TCH/F, both CS2 and CS3 may use the same *_state[][2] and *_output[][2] arrays within a single file. This optimization is currently WIP. Change-Id: Ib4e4ee5fdde38429e68e3b2fa50ec03a18f59daa
* Revert "Constify ctrl_cmd struct fields where appropriate"Neels Hofmeyr2016-10-202-4/+3
| | | | | | | | | | | | | This reverts commit ed9d6da5df98538adc70aa03cb569eb9505d04b6. The commit is good as such, but it causes many compiler warnings in the OpenBSC build. We want this to be re-applied as soon as we have patches ready that fix the fallout in openbsc.git. See also https://lists.osmocom.org/pipermail/openbsc/2016-October/009802.html Related: OS#1829 Change-Id: I722ad60232a6ef5b4cb984b92c42851de26b3ccd
* vty/show asciidoc: counters: improve table headersAlexander Couzens2016-10-181-5/+8
| | | | | | | | add [options=header] to every table header vty/show asciidoc: rename reference field into "Reference" vty/show asciidoc: capilize table header field names Change-Id: Ie991f4db77a60afb86a2a0b35c137586527f6228
* vty/show asciidoc: add user readable description of the versionAlexander Couzens2016-10-181-0/+10
| | | | Change-Id: Ie0f1b3894361c58386da9defb225979fa0ee6a18
* stats_statsd: use int64_t instead of int for value and delta.Alexander Couzens2016-10-181-3/+3
| | | | | | | The stats infrastructure use int64_t for values and delta. So the statsd reporter get call with int64_t. Change-Id: I33df86de60007a64fa853d6d3af9b609877a8fc6
* vty/osmo_counter: use name if description is NULLAlexander Couzens2016-10-131-1/+5
| | | | | | | | | | | `show stats` shows (null) for osmocom_counters when description is null. OpenBSC> show stats Ungrouped counters: (null): 4 Change-Id: I553b88a6fca688924b1f2b49e8cb17e90f057bb1
* configure: add --enable-sanitize, use in jenkins.shNeels Hofmeyr2016-10-122-2/+15
| | | | | | | | | | | | | --enable-sanitize adds address sanitizer CFLAGS/CPPFLAGS to the entire build. Also pass UBSAN_OPTIONS to the test suite run (only has effect during runtime). Add this flag to jenkins.sh's configure step. To ensure that we get the sanitize results, add 'make check' to jenkins to catch sanitize failures; Keep 'make distcheck' without ASAN; it has its own configure which omits --enable-sanitize. This way we test both with and without ASAN. Change-Id: Idf7f46fa048608c2951f2473cb528f6c8dc2681d
* gsm/Makefile.am: use proper top_builddir/top_srcdir pathsNeels Hofmeyr2016-10-121-3/+3
| | | | | | | | | | This fixes the conv*gen.c targets when building in a different directory than the source tree. Notably, building in a different dir worked when the generated sources were already present from a previous build inside the source directory. Change-Id: I5a9b780ad4ba607ea39854dcf7207ed05f5447bc
* Add function to send TRAP over Control InterfaceMax2016-10-122-0/+22
| | | | | Change-Id: Ic0b8d88c4f5c4d42c3f8fb754f8eabf049c9e388 Related: OS#1646
* jenkins.sh: drop unecessary PATH, now in slave configNeels Hofmeyr2016-10-121-1/+0
| | | | Change-Id: Ifaff3e5e13c920eb716a5609bfec2f96e10f17b0
* gsm0408: Adding 3g spcific RR message typesPhilipp2016-10-121-0/+5
| | | | | | | | | | GSM 04.18, which is the successor of GSM 04.08, describes additional RR 3g specific message types. This commit adds four new message types related to paging and notifiction See also 3GPP TS 04.18, section 10.4, table 10.4.1 Change-Id: I071cc9ecac342b5221fa0ec0b782b04b51b40e93
* fix USSD: SS message type mask should be 0x3f, not 0xbfNeels Hofmeyr2016-10-121-1/+1
| | | | | | | | | | | | | | See 04.80[1], section 3.4: the highest two bits are used as counter or ignored and do not contribute to the SS "Miscellaneous message group". Previous mask of 0xbf included the highest bit, fix to 0x3f. Observed a value of 0xbb that should mean 0x3b="Register" during testing of 3G USSD requests, which seem to be the first to send a nonzero highest bit to our code. The erratic mask of 0xbf lead to an unhandled message type of 0xbb. [1] 3GPP TS 24.080 version 7.2.0 Release 7 / ETSI TS 124 080 V7.2.0 (2006-09) Change-Id: I299001a9e36c16f55622a0acd5d4a55ca49d0055
* Constify ctrl_cmd struct fields where appropriateMax2016-10-112-3/+4
| | | | Change-Id: I3f55c1d4b965d215dc9b16f4b284b7fea4bde9e9
* build: be robust against install-sh files above the root dirNeels Hofmeyr2016-10-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | 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: If2afbe62e9ceeac8052c7b882ff92a548f3af0bf
* Mark inline header function as staticMax2016-09-301-1/+1
| | | | Change-Id: Ib751f7467d54cbcae76f72448a38e30f2ecc63d4