summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* bitvec: Fix interface to consistently use unsigned intMax2016-01-222-12/+12
| | | | | | | Use unsigned int for the length throughout the interface. We will never have a a negative length. Sponsored-by: On-Waves ehf
* bitvec: Fix unaligned memory access in osmo_revbytebits_bufMax2016-01-221-2/+1
| | | | | | | | | | | | | The undefined behavior sanitizer found the 32bit load from an unaligned memory address. This will cause an exception on ARMv5te and a manual fix-up. [hfreyther: On armv6, x86 the usage of memcpy leads to shorter amount of instructions but on armv5te the memcpy is not expanded leading to a branch. Use the version of max until we have the time to benchmark it] Sponsored-by: On-Waves ehf
* Fix sporadic out-of-bounds errorMax2016-01-221-13/+21
| | | | | | | | This code dealing with bit shifting sometimes gets 1 byte beyond array boundary while calculating index. This is now explicitly checked and prevented. Ticket: OW#1198 Sponsored-by: On-Waves ehf
* kasumi: Fix build with gcc5 that changed behavior of inlineHolger Hans Peter Freyther2016-01-211-1/+1
| | | | | GCC 5 has changed inline semantics (https://gcc.gnu.org/gcc-5/porting_to.html) and apparently that now fails to link.
* debian: Avoid linking with -Bsymbolic-functionsHolger Hans Peter Freyther2016-01-181-0/+3
| | | | | | | | | | Our tests want to be able to change symbols from the library and even by using --wrap=XYZ it is not possible right now. One option would be to use static linking but that is not always enabled, the other is to skip tests on Ubuntu and the third one is to disable that linking mode. This means that the dynamic linker needs to spend some more time but we do spend this time on all other distros and this looks acceptable.
* comment typoNeels Hofmeyr2016-01-181-1/+1
|
* msgb/test: Add test case for error casesJacob Erlbeck2016-01-152-0/+24
| | | | | | Include a test for msgb_trim. Sponsored-by: On-Waves ehf
* msgb: Assert len >= 0 in msgb_trimJacob Erlbeck2016-01-151-0/+2
| | | | | | | | | | | Currently msgb_trim only checks for len > data_len and returns -1 in that case, allowing the caller to fix it somehow. Using a negative length will always lead to a corrupt msgb, but this is not being checked. This commit adds a check for len < 0 and a conditional call to MSGB_ABORT. Sponsored-by: On-Waves ehf
* msgb/test: Add tests for msgb_resize_area and msgb_copyJacob Erlbeck2016-01-152-0/+149
| | | | Sponsored-by: On-Waves ehf
* msgb/test: Add functions to catch and check exceptionsJacob Erlbeck2016-01-152-1/+32
| | | | | | | | | | | | | | | | Currently the msgb error handling cannot be fully tested, since in many cases osmo_panic will be called. This will in turn call abort(). Using an osmo_panic_handler that just returns will not help, since many msgb functions rely on MSGB_ABORT to not return at all. This commit uses an alternative osmo_panic_raise handler that just calls longjmp to return to the test function. Since some of this activity is logged to stderr where the strings may contain variable parts like pointer addresses, stderr checking is disabled in testsuite.at. Sponsored-by: On-Waves ehf
* msgb/test: Add test for msgb message buffersJacob Erlbeck2016-01-154-2/+136
| | | | | | | | | | This tests several API functions of the msgb by checking the invariant and by dumping resulting message buffers as hex. Sponsored-by: On-Waves ehf Conflicts: tests/Makefile.am
* bitvec: Add get/set byte sequencesJacob Erlbeck2016-01-156-2/+162
| | | | | | | | | | | | | | | The new functions bitvec_get_bytes and bitvec_set_bytes copy byte sequences from bitvecs to uint8_t arrays and vice versa. While the bytes in the bitvecs do not need to be aligned, the uint8_t arrays always are. In case the bytes in the bitvec are aligned, the implementation uses memcpy. Note that the implementation like the other existing functions assume MSB first encoding. [hfreyther: Squash the comment fix into this commit as well] Sponsored-by: On-Waves ehf
* gsm: Add APN conversion functionsJacob Erlbeck2016-01-157-3/+216
| | | | | | | | | | | | These functions are currently part of openbsc but also needed by other projects. The function have been renamed as follows: gprs_apn_to_str -> osmo_apn_to_str gprs_str_to_apn -> osmo_apn_from_str Sponsored-by: On-Waves ehf
* update TODO-RELEASE regarding the talloc change.Harald Welte2016-01-061-0/+1
| | | | | | | Shipping our own private copy of talloc was a good idea in 2008, when it was not readily available on most target platforms. Today, the situation is quite different, as it is a standard library on major Linux distributions.
* osmo_prim_op_names should be externHarald Welte2015-12-251-1/+1
|
* Fix some recently added formats on 64bitNeels Hofmeyr2015-12-241-3/+5
| | | | | 86ec311896dd5d4 adds compiler warnings on 64bit. The build is clean otherwise, so let's keep it that way.
* Add osmo_prim_op_names[] symbol and _SAP_SS7_BASE defineHarald Welte2015-12-233-1/+14
|
* msgb: Add msgb_test_invariant functionJacob Erlbeck2015-12-211-0/+40
| | | | | | This adds a function that verifies whether a mgsb is consistent. Sponsored-by: On-Waves ehf
* msgb: Let msgb_hexdump be more tolerantJacob Erlbeck2015-12-211-7/+39
| | | | | | | This patch makes msgb_hexdump accept out of range lXh pointers and shows info about them instead of aborting the dump entirely. Sponsored-by: On-Waves ehf
* msgb: Add msgb_resize_area and msgb_copyJacob Erlbeck2015-12-212-0/+94
| | | | | | | | | | | | | | | These functions originate from openbsc/src/gprs but are generic msgb helper functions. msgb_copy: This function allocates a new msgb, copies the data buffer of msg, and adjusts the pointers (incl. l1h-l4h) accordingly. msgb_resize_area: This resizes a sub area of the msgb data and adjusts the pointers (incl. l1h-l4h) accordingly. Sponsored-by: On-Waves ehf
* some comments / fixed typosNeels Hofmeyr2015-12-215-3/+7
|
* LaPDm: Refuse SUSPEND/RESUME/RECONNECT in BTS modeHarald Welte2015-12-191-0/+17
| | | | | | The primitives for SUSPEND, RESUME and RECONNECT are only permitted on the MS side of the LAPDm link, not on the BTS side. So we should check for this and reject, accordingly.
* ns: Force a defined state when sending NS RESETJacob Erlbeck2015-12-173-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | Currently the state is assumed to remain the same while the reset procedure is active. While this works correctly in general, a single unexpected BLOCK_ACK or UNBLOCK_ACK can change the state but will not stop the reset procedure. The leads to repeated RESET messages, where the corresponding RESET_ACK is ignored. This is a stable state which can only be left by manual intervention or by reception of a RESET message from the peer. This commit changes the RESET timeout handler to set the state to BLOCKED/RESET when sending the new NS RESET message. Note that this should ensure a clean restart even if the state has been screwed up. It does not fix the handling of BLOCK_ACK or UNBLOCK_ACK in abnormal cases. Addresses: gprs_ns.c:349 NSEI=8895 Tx NS RESET (NSVCI=8895, cause=O&M intervention) gprs_ns.c:878 NSVCI=8895 Rx NS RESET ACK (NSEI=8895, NSVCI=8895) gprs_ns.c:887 NS RESET ACK Discarding unexpected message for NS-VCI 8895 from SGSN NSEI=8895 Ticket: OW#1551 Sponsored-by: On-Waves ehf
* stats: Fix compiler warning about losing constHolger Hans Peter Freyther2015-12-171-1/+1
| | | | | | | stats_statsd.c: In function ‘osmo_stats_reporter_statsd_send_item’: stats_statsd.c:154:15: warning: initialization discards ‘const’ qualifier from pointer target type char *unit = desc->unit; ^
* ns/stats: Add missing osmo_stat_item_group_free to gprs_nsvc_deleteJacob Erlbeck2015-12-171-0/+1
| | | | | | | | | | | | | | | | | | | | | The stat item group is not removed by gprs_nsvc_delete which will corrupt the group list. Addresses: valgrind tests/gbproxy/gbproxy_test [...] ==4541== Invalid write of size 4 ==4541== at 0x4071ACA: __llist_add (linuxlist.h:65) ==4541== by 0x4071ACA: llist_add (linuxlist.h:81) ==4541== by 0x4071ACA: osmo_stat_item_group_alloc (stat_item.c:112) ==4541== by 0x407EDFD: gprs_nsvc_create (gprs_ns.c:244) ==4541== by 0x408109D: gprs_ns_instantiate (gprs_ns.c:1388) ==4541== by 0x804CFD3: test_gbproxy_ident_changes (gbproxy_test.c:1501) ==4541== by 0x805FBD3: main (gbproxy_test.c:5803) Sponsored-by: On-Waves ehf
* talloc: Depend on libtalloc-dev being present as wellHolger Hans Peter Freyther2015-12-141-1/+1
|
* RSL: Add enum + TLV definitions for ip.access style embedded IEsHarald Welte2015-12-134-0/+58
|
* talloc: Untested change to unbreak buildHolger Hans Peter Freyther2015-12-101-1/+1
| | | | | In case talloc is not installed in the default search path we need to place @TALLOC_CFLAGS@ into the include directory as well.
* gsm_03_41: Fix structure definitions for big-endian machinesRuben Undheim2015-12-091-0/+31
| | | | | this was detected by debian packaging, as the associated gsm_03_41 test case fails on big endian machines like ppc.
* update debian packaging from libosmocore6 to libosmocore7Harald Welte2015-12-082-2/+2
|
* utils: add TALLOC_CFLAGS to buildHarald Welte2015-12-081-1/+1
| | | | this is an attempt to fix the FreeBSD build
* stats: Add OSMO prefix to STAT_ITEM_NOVALUE_IDJacob Erlbeck2015-12-082-4/+4
| | | | | | | This symbol is globally visible and therefore should have an OSMO prefix like the other identifiers exported by stat_item.h. Sponsored-by: On-Waves ehf
* stat: Explicitly support stat_items without unitJacob Erlbeck2015-12-083-2/+16
| | | | | | | Add OSMO_STAT_ITEM_NO_UNIT for stat items without an unit. The statsd reporter uses gauges ("g") to report them. Sponsored-by: On-Waves ehf
* remove our internal copy of talloc, use system libtallocHarald Welte2015-12-0517-2089/+28
| | | | | | | Shipping our own private copy of talloc was a good idea in 2008, when it was not readily available on most target platforms. Today, the situation is quite different, as it is a standard library on major Linux distributions.
* stats: Add TODO comment to rate_ctrJacob Erlbeck2015-11-261-0/+3
| | | | | | | | | | Currently the counters are scanned twice, once for interval computation and once for reporting. This adds a reminder to move the interval computation code to a special stats reporter which just shall update the fields. Sponsored-by: On-Waves ehf
* stats/test: Add memory leak checkJacob Erlbeck2015-11-261-4/+9
| | | | | | Adds a rudimentary leak check for the counters and stat items. Sponsored-by: On-Waves ehf
* stats/test: Add test for reportingJacob Erlbeck2015-11-262-17/+369
| | | | | | | | | | | | | | This tests uses a dedicated test reported to check several aspects of the value reporting. - addition/removal of stats reporter - addition/removal of counters/items - setting of max_class - initial value flush - updating single counters/items - reporter retrieval - enable/disable Sponsored-by: On-Waves ehf
* stats: Reorder functions in stats.cJacob Erlbeck2015-11-261-59/+61
| | | | | | | Due to prior refactoring, the functions do not have an sensible order in the file. This commit tries to improve that a little bit. Sponsored-by: On-Waves ehf
* stats: Move statsd related code into a separate fileJacob Erlbeck2015-11-264-144/+180
| | | | | | | | | | | This commit moves the stats specific code parts into stats_statsd.c while keeping the generic parts in stats.c. The code in stats.c no longer contains references to statsd symbols. Note that the VTY code still needs to know about every stats reporter backend. Sponsored-by: On-Waves ehf
* configure: It should be --with-system-talloc, not --enable-system-tallocHarald Welte2015-11-211-8/+8
| | | | | | As we are making a decision whether we should use an existing system library, we call it --with-system-talloc, rather than --enable-system-talloc.
* configure.ac: Use AS_IF() instead of shell-if for PKG_CONFIGHarald Welte2015-11-211-4/+4
| | | | | | | | | | | | | https://autotools.io/pkgconfig/pkg_check_modules.html > If you have the first call to PKG_CHECK_MODULES inside a bash > conditional block, the expansion of PKG_PROG_PKG_CONFIG will also be > conditional > You can solve this problem in two ways; you can either explicitly call > PKG_PROG_PKG_CONFIG outside of any conditional, forcing checking for > pkg-config as soon as possible; or you can rewrite your conditionals > to use the proper syntax
* use system-wide libtalloc with --enable-system-tallocHarald Welte2015-11-214-3/+59
| | | | | | | | | This introduces a new configure flag by which the libosmocore-internal talloc code is not compiled, but rather a system-wide libtalloc is used. When we started openbsc/libosmocore in 2008, libtalloc was not widely present on systems yet. This has changed meanwhile, and we should simply use the system-wide library
* stat_item.c: Fix compiler warningsHarald Welte2015-11-201-2/+2
| | | | | | | | | | | CC stat_item.lo stat_item.c: In function 'osmo_stat_item_group_alloc': stat_item.c:84:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] group->items[item_idx] = (void *)items_size; ^ stat_item.c:98:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ((uint8_t *)items + (int)group->items[item_idx]); ^
* vty: Don't call exit() but rather use OSMO_ASSERT()Harald Welte2015-11-121-15/+4
| | | | | This was pointed out by Jaroslav Skarvada during fedora packaging, and he has a valid point...
* fix FSF address in sources/headersJaroslav Škarvada2015-11-129-15/+18
| | | | Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
* debian: Make a new minor releaseHolger Hans Peter Freyther2015-11-091-0/+8
|
* stats: Fix not reported stat item valuesJacob Erlbeck2015-11-091-1/+3
| | | | | | | | | | | | Currently the global stat item index is being advanced in osmo_stat_item_group_handler, so that the second and further groups in the list will skip new item values. This commit moves the call to osmo_stat_item_discard_all into osmo_stats_report to a place where all groups have been processed already. Sponsored-by: On-Waves ehf
* stats: Fix handling of multiple resportersJacob Erlbeck2015-11-091-2/+2
| | | | | | | | | | | | | Currently the reporter loop is aborted, if the event would be ignored due to an insufficient max_level. Thus the reporters that happen to be stored afterwards would be skipped even if their level were sufficient. This commit replaces the conditional 'return' statement by a considtional 'continue' statement to ensure the processing of the list tail. Sponsored-by: On-Waves ehf
* stats: Send all values on reporter updateJacob Erlbeck2015-11-092-8/+26
| | | | | | | | | | | | | | | | | | | | | Currently only counter changes and new item values are being reported. This makes it cumbersome to configure reporting clients, since there is nothing like a list of all parameters. This commit changes this behaviour such that all currently existing counters and items that would be reported eventually, are passed to the reporter when it has been reconfigured or enabled. If a counter has not been incremented, 0 is sent. If a stat item value has not been added, the last item value (or the default value if there is none) is resent again. Note that this will not catch transient counters/items that will be created later on, e.g. triggered by new peers or subscribers. To just force this kind of dump on a running reporter, it is sufficient to invoke the 'enable' command in its configuration node. Sponsored-by: On-Waves ehf
* stats: Fix name prefix handlingJacob Erlbeck2015-11-091-11/+23
| | | | | | | | | | | | | | Currently the having an unset prefix leads to an abort() in the statsd reporter due to an fprintf format string error. In addition the prefix cannot be reset to its initial state (NULL) by using 'no prefix', which just sets the prefix to the empty string, causing a single leading dot to appear in front of the name. This commit changes the implemenation to consistly use NULL for the unset name prefix ('no prefix') and to handle this case correctly in the statsd reporter. Sponsored-by: On-Waves ehf