summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-01-15define 'fprintf(stderr,' as a wrapper around printf(laforge/lib-updateHarald Welte1-0/+1
This is in preparation to work with a more recent version of libosmocore, which wants to print to stderr in some cases.
2017-01-15Add an endian.h file as one step to build against later libosmocoreHarald Welte1-0/+12
2017-01-15Add libosmocore/build-target/include to include pathHarald Welte1-1/+1
Some header files are auto-generated and are thus in the build directory, not in the source directory. A cleaner way to handle this is most likely to install libosmocore to some directory, but I don't want to change the entire build process now.
2017-01-15Merge commit '2f0b0c955b4031a9dd95829322455cf883d40f53' into lib-updateHarald Welte362-4679/+36607
2017-01-15fix various other compiler warningsHarald Welte3-5/+6
2017-01-15cfi_flash.c: Fix various format string compiler warningsHarald Welte1-6/+6
2017-01-15trf6151: Fix setting of uplink ARFCNHarald Welte1-1/+1
Somebody (me?) wrote exclamation marks instead of pipe symbols. Found by a modern gcc: rf/trf6151.c: In function 'trf6151_set_arfcn': rf/trf6151.c:439:8: warning: comparison is always true due to limited range of data type [-Wtype-limits] arfcn != ~ARFCN_UPLINK; ^ rf/trf6151.c:439:2: warning: statement with no effect [-Wunused-value] arfcn != ~ARFCN_UPLINK; ^
2017-01-15Avoid redefining __{packed,aligned,unused,section}Harald Welte1-0/+10
It seems modern version of newlib define those themselves, so we should avoid re-defining them. Removes tons of compiler warnings when compiling against libnewlib 2.4.0
2017-01-15WIP: Attempt to make linker scripts compatible with binutils 2.27Harald Welte2-4/+4
In binutils-2.27, one can no longer have linker sections with overlapping VMA addresses. Let's try to work around this. See https://osmocom.org/issues/1917 for more details.
2017-01-13Fix compilation warnings: missing includes: gsm0411_utils.c, lapd_core.c, ↵Max3-0/+3
oap_test.c Change-Id: Id524327b3f44e22e3aa44c5e8e4965b084cb326a
2017-01-12gprs_ns_vty: guard against duplicate VTY elementsNeels Hofmeyr1-0/+8
The TbfTest in osmo-pcu calls gprs_ns_vty_init() repeatedly, which aborts because of duplicate VTY elements. Fix this by skipping the VTY init if it already happened. Change-Id: I05c7f25a4e873ae76b206819180b8b043b60103e
2017-01-11Add abis_nm_fail_evt_vrep() functionMax2-4/+22
It accept fixed number of arguments including va_list instead of variable number of arguments in abis_nm_fail_evt_rep() - similar to vprintff() vs printf(). Related: OS#1615 Change-Id: Ib293dec1c2de9b664584a8456c782ea7b6dd8555
2017-01-10Remove obsolete .deb patchMax2-47/+0
Change-Id: Icbf911540fcc840833c5012363c2ba48fd71db52 Related: OS#1694
2017-01-10LAPD: improve loggingMax1-4/+6
Log error cause and state names in case of SABM errors. Change-Id: I2c7fa276e03f8b14ba41cc1fb6e19d0aae77d127
2017-01-10DTX: fix AMR SID-FIRST detectionJean-Francois Dionne2-4/+4
Max's note: adjusted test output. Change-Id: I46477c631bf86345cb757f31d7f2e2935b12adcc Related: OS#1801
2017-01-10Add value strings for Probable Cause TypeMax3-0/+10
Add string representation of Probable Cause Type from 3GPP TS 12.21 § 9.4.43. Change-Id: I9fe14ed3b5398f59dd06a509e4d419e074cc20a7 Related: OS#1615
2017-01-09gsmtap: Add GSMTAP_TYPE_QC_DIAGHarald Welte1-0/+1
This adds a definition for wrapping Qualcomm DIAG frames into GSMTAP for transporting them over an IP network. Change-Id: I1b357b7d11a370685671c7b01e55f4f36dec2f25
2017-01-08gitignore: ignore *.pyc filesVadim Yanitskiy1-0/+1
Change-Id: I148584e1664b20741c0ade02cbda635c24268d2e
2017-01-07fsm: Add VTY introspection of osmo_fsm and their instancesHarald Welte4-4/+189
Change-Id: I89212e4f149f019099115a85bab353c04170df90
2017-01-07Add osmo_fsm_find_by_name() and avoid registering FSM with same nameHarald Welte2-1/+14
This addresses a FIXME in the fsm.c code: osmo_fsm_register() should fail in case a FSM with the given name already exists. Change-Id: I5fd882939859c79581eba70c14cbafd64560b583
2017-01-07vty: OSMO_ASSERT() if two identical commands are installedHarald Welte1-0/+19
When the caller installs two identical commands at a given VTY node, the result is that neither of the two commands can ever be executed: The VTY would always complain about "Ambiguous command.". Let's fail fast at program start when two identical commands are intalled. Change-Id: I85ff4640ebb3d8b75a6a9ab5d2f668edb5b7189e
2017-01-06Add OML Failure Event Report supportMax3-0/+46
Add 3GPP TS 12.21 § 8.8.2 Failure Event Report function which pack given vararg string and parameters into msgb. Change-Id: I58c198d8ea588432c62520928b08f0b2a7035e93 Related: OS#1615
2017-01-06Add event cause string descriptionsMax3-0/+18
Add human-readable descriptions to event causes from 3GPP TS 12.21 § 9.4.43. Change-Id: Id173c978616c98b7831fbafb5401064257f1cf73 Related: OS#1615
2017-01-06Add function to get uninterrupted bit runPravin Kumarvel4-1/+89
Function bitvec_rl_curbit added to get number of uninterrupted bits run in vector starting from the current bit till max number of bits. Test case is added to check bitvec_rl_curbit. Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26
2017-01-06Add cause enum for OML fail reportsMinh-Quang Nguyen1-0/+18
Add 3GPP TS 12.21 §9.4.43 Probable Cause values of type 03 (Manufacturer specific values). Max's note: renamed to make it clear that values are vendor-specific. Related: OS#1615 Change-Id: Ie9ba4b53fb19a151447aec9ea309284e20613585
2017-01-06Add parsed TLV helpers from OsmoBTSMax3-0/+64
Add functions to copy and merge parsed TLV structures from OsmoBTS. Change-Id: Ieaaaed19da9c069fe451faa53d24c5b84d7d5615
2017-01-06Add OML definitions from OsmoBTSMax4-0/+76
Change-Id: I9c3bc15662949654e7bba6aad5488c69ee7d0c45 Related: OS#1615
2017-01-06Remove direct loggingMax1-3/+0
Drop perror() calls from GSMTAP code: it's application job to do the proper logging - library code should not write to stdout/stderr directly. Change-Id: Ifa149e65d76c6e64fda2946725c16672233aff2e
2017-01-06gitignore: ignore tests/oap/oap_testVadim Yanitskiy1-0/+1
Change-Id: Iccb8c46a721d5389058c5cf36621820bcd861b7b
2017-01-06lapd_test: avoid calling memcpy with NULL sourceHarald Welte1-1/+2
fixes lapd/lapd_test.c:54:2: runtime error: null pointer passed as argument 2, which is declared to never be null Change-Id: I7030729f4f4c867adecc7afc15bb5ca9beff0030
2017-01-06gprs_cipher_core: Use typecase to avoid sanitizer errorHarald Welte1-1/+1
This resolves gprs_cipher_core.c:118:37: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Change-Id: Ib1866595030ad9d11c886621ce69632462befa3a
2016-12-24fsm: term: get parent pointer as late as possibleNeels Hofmeyr1-1/+4
During FSM instance termination, fetch the parent pointer every time just before using it, in case the child termination or cleanup callback wish to change anything about the parent, e.g. to prevent event dispatch. This patch was created to try and fix a problem that was in the end solved differently. There is no actual need or use case for this at the moment, but it generally makes sense to get the parent pointer as late as possible. Change-Id: I999d7f29ba10281d4005c5163130bb2d80148362
2016-12-24utils/conv_gen.py: separate code definitionsVadim Yanitskiy2-714/+728
This change separates the convolutional code definitions from the code generator logic, allowing us to make further changes in more specific way. For example, adding some new codes, you change the conv_codes.py only because such change isn't related to the generator. Change-Id: I3428561251b7d7a180d1e9b6fcaad50bdbbc37fa
2016-12-24utils/conv_gen.py: use shared tables if possibleVadim Yanitskiy1-37/+61
This change introduces the memory usage optimization, mentioned in d2d9760c08f35a231d32f0ebeb73b2927e5573b3. The aim is to make code generator able to detect, whether the same tables are used by several convolutional code definitions, and prevent one from writing these tables multiple times. For now, the detection process isn't fully automatic, so all shared polynomials should be placed inside the 'shared_polys' dictionary, for example: shared_polys = { "xcch" : [ ( G0, 1 ), ( G1, 1 ), ], "mcs" : [ ( G4, 1 ), ( G7, 1 ), ( G5, 1 ), ], } Change-Id: I84760f5cdfdaece376b801d2e6cb2954ee875a3b
2016-12-24fsm: factor out osmo_fsm_inst_term_children() from osmo_fsm_inst_term()Neels Hofmeyr2-20/+55
osmo_fsm_inst_term() has code for safe child removal, publish that part as osmo_fsm_inst_term_children(); also use from osmo_fsm_inst_term(). As with osmo_fsm_inst_term(), add osmo_fsm_inst_term_children() macro to pass the caller's source file and line to new _osmo_fsm_inst_term_children(). Rationale: in openbsc's VLR, I want to discard child FSMs when certain events are handled. I could keep a pointer to each one, or simply iterate all children, making the code a lot simpler in some places. (Unfortunately, the patch may be displayed subobtimally. This really only moves the children-loop to a new function, replaces it with a call to _osmo_fsm_inst_term_children(fi, OSMO_FSM_TERM_PARENT, NULL, file, line) and drops two local iterator variables. No other code changes are made, even though the diff may show large removal + addition chunks) Change-Id: I8dac1206259cbd251660f793ad023aaa1dc705a2
2016-12-24fsm: move LOGPFSMSRC and LOGPFSMLSRC to .hNeels Hofmeyr2-13/+13
LOGPFSM and LOGPFSML are in the header file, put the *SRC variants also there so users of the osmo_fsm_inst API may conveniently create own functions that log the caller's source file and line. Very useful if many action functions call the same event dispatching function, like foo_fsm_done(), and one needs to know which of the callers to debug. Change-Id: I39447b1d15237b28f88d8c5f08d82c764679dc80
2016-12-24fsm: log calling file+line for error "event for NULL fi"Neels Hofmeyr1-2/+3
Change-Id: I1970773440865f1415004bcf0164603468acf90b
2016-12-24fsm: doc: add missing file, line args; fix ws + tweak on one lineNeels Hofmeyr1-1/+7
Change-Id: I6af0d43ab0082e45df676c1d69b26310b59a8031
2016-12-24fsm_test.c: fix compiler warning: timer cb return typeNeels Hofmeyr1-1/+1
Change-Id: Ifd7e85cd69b5e7e473000abc1ef7a56748aafc0e
2016-12-24serial.c: file descriptor '0' is a valid valueHarald Welte1-2/+2
if stdin/stdout/stderr are all closed by our environment, it may very well be that opening a serial port returns fd == 0. Change-Id: Ifd9670260883a35da0629369e0d49e467d5b4d72
2016-12-24serial.c: Fix fd leak in case of fcntl() error pathsHarald Welte1-2/+4
Change-Id: I14f934957e1086b803f3a7b9b5e6d602380f0be2 Fixes: Coverity CID 158987
2016-12-23serial.c: Some ports don't support TIOCMBIS for RTS/CTS controlHarald Welte1-2/+2
So let's ignore the error we might get from this opreration. Change-Id: I69dad90403355b6512c3bf4c7fd10dd1dd985f01
2016-12-23serial: Open devie in non-blocking mode and then switch to blockingHarald Welte1-3/+17
There are some serial ports that apparently block during the open in some circumstances. We don't want that. We want to either open it immediately, or fail fast. Change-Id: I626b138574bc50f4f4b09c4d609f3623ff512dff
2016-12-23add CRC16-CCITT to libosmocoreHarald Welte2-0/+54
Use the implementation from Linux lib/crc-ccitt.c (GPLv2) Change-Id: I26bb54038f5ab36bbb34da7f5fb8ae6c0c0386a4
2016-12-22Fix erroneously AGPL licensed file in libosmocore.Harald Welte1-4/+4
libosmocore itself is GPLv2-or-later. Only the test cases are permitted to be AGPL licensed. Change-Id: I62f2eed6305bfa11a64c6d633e08aabeaf9f0b10
2016-12-22Integrate Debian packaging changesMax14-77/+462
debian/control: * restructure to make it easier to incorporate further changes * update package descriptions * move build-depends to a proper place * update project URL debian/rules: * use proper hardening syntax * strip linker option without explicit shell invocation * remove useless comment * add extra cleanup debian/: package documentation separately debian/docs: remove empty file debian/coryright: update to match Debian format Change-Id: Ia7654d34730e9f269831612bfba70a1338ce29d3 Related: OS#1694
2016-12-21fsm: log tweak: upon free, say 'Freeing instance'Neels Hofmeyr1-1/+1
Logging 'Release' is a bit ambiguous. At first I tought a subscriber connection was being released, IMHO 'Freeing instance' better describes that we are freeing an osmo_fsm_inst. Change-Id: I5cf99707d2ba5620b2988f777fa39cc806ec0212
2016-12-21doc: fix typo for osmo_hexparseNeels Hofmeyr1-1/+1
Change-Id: Ifc2b499792fda378c807c678b8e06630cb64d273
2016-12-21utils.h: add OSMO_STRINGIFY and OSMO_VALUE_STRING macrosNeels Hofmeyr2-7/+9
OSMO_STRINGIFY particularly allows putting port numbers from a #define into VTY doc strings, like: #define FOO_PORT 2342 DEFUN(..., "Foo UDP port (default: " OSMO_STRINGIFY(FOO_PORT) ")\n") OSMO_VALUE_STRING creates value_string items with the string being exactly the enum value's name. Replaces a similar macro def in fsm.c Change-Id: I857af45ae602bb9a647ba26cf8b0d1b23403b54c
2016-12-21Catch-up with git version tagsMax11-17/+51
* update debian/changelog * update TODO-RELEASE * add comments to Makefile.am and TODO-RELEASE to simplify the process in future * add link to libtool docs to Makefile.am to simplify LIBVERSION maintenance Related: OS#1861 Change-Id: I22c257e357f597519120232d742d6a61289db021