aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-02-07gsm0480: parse registerSS and eraseSSSergey.Kostanbaev1-0/+2
2017-02-07ss wipSergey.Kostanbaev2-51/+96
2017-02-07store actual length of messageSergey Kostanbaev1-4/+4
2017-02-07gsm0480: RELEASE COMPLETE can be without any payloadSergey Kostanbaev1-6/+0
2017-02-07modify USSD structures to support external handlingSergey Kostanbaev1-1/+126
2017-02-07lapd_core: Fix MDL-ERROR ind after RELEASE indPhilipp Maier1-4/+4
in lapd_t200_cb() The RELEASE INDICATION is transmitted before the MDL ERROR INIDCATION, this prevents the MDL ERROR INDICATION from being sent because the RELASE INDICATION close to connection eraly. This commit puts the messages into the correct order. Change-Id: Iae74777138fc27828f511e3aa321d1981861f4a5
2017-02-07lapd_core: fix program flowPhilipp Maier1-5/+5
when the lapd core is in state LAPD_STATE_SABM_SENT, and the retransmission counter exceeds (link down) lapd_t200_cb() will send an RELASE_INDICATION and an MDL_ERROR_INDICATION to L3. This action is done before the state is processed. This seems to be no problem with standard retransmission counts (n200), but may cause timing problems that lead to deadlock states when custom timer configurations are in use. (Ericsson RBS). This commit moves the functions calls for sending the indications mentioned above to the very end of the if branch to relax the timing again. (See lapd_t200_cb()) Change-Id: I1c1beb3701b19744a3ce9946abca7767d20a0b6a
2017-02-07select: add functionality to check socket statePhilipp Maier1-6/+24
osmo_fd_register() is used to register socket file descriptors, after registering a socket, there is no way to test if the socket is still registered or actually registered at all. This commit adds a new function osmo_fd_register_check() that can be used to check in advance, if the socket fd is registered, before performing further operations. Change-Id: I48ec7098d6bba586c81bf0d5c9088108e2c081c6
2017-02-06osmo_auth*: fix ordering of function argsNeels Hofmeyr1-3/+3
milenage_gen_vec() has parameter ordering of (..., auts, rand_auts, rand). osmo_auth_gen_vec_auts() has (..., rand_auts, auts, rand), but actually feeds args in the same order, so that its rand_auts becomes auts, and its auts becomes rand_auts. Interestingly enough, API user osmo-gen-vec.c also adheres to this misordering and in turn passes auts for osmo_auth_gen_vec_auts()'s rand_auts and vice versa, so that it matches milenage_gen_vec(). So both the implementation (milenage_*) and the API user use the same ordering, just osmo_auth_gen_vec_auts() and osmo_auth_impl{ .gen_vec_auts() } in-between have the argument names swapped. Any current user of this API would need to adhere to this swapping or will not get successful AUTS resolution to a SQN. So the least impact fix is to rename the args without any actual functional change. So swap the names rand_auts and auts for osmo_auth_gen_vec_auts() and osmo_auth_impl{ .gen_vec_auts() }. (Also adjust API doc ordering) Change-Id: I0dcbd49759fc32d3b8974102dbd1d6703364ebf4
2017-02-03lapd_core: Improve debug outputPhilipp Maier1-144/+190
The debug output of lapd core has no references to the dl objects, since we have multiple links, seeing which action is for which object is impossible. This commit adds pointer references (dl=%p) to each log line. Change-Id: I3024d1cbd58631e2abac4ce5822528e2e6e15fda
2017-02-02GSUP, OAP, osmo-gen-vec: fix AUTS length to 14, not 16Neels Hofmeyr1-1/+1
GSUP transmits AUTS for UMTS authentication procedures, and OAP uses the same procedures to authenticate. osmo-gen-vec is a utility program that passes AUTS to our osmo_auth_gen_vec_auts() API. According to 3GPP 33.102 6.3.3, AUTS = SQN^AK || MAC-S, which are 6 || 8 == 14 bytes. This is confirmed by 24.008 9.2.3a where the TLV has 16 bytes, TL = 2 and AUTS being the V = 14. It is not harmful for milenage_gen_vec_auts() to pass two more AUTS bytes. But writing 16 bytes to a GSUP struct is a potential problem when passing in a 14 byte long AUTS buffer to the GSUP API, which then reads past the AUTS buffer. The API implies the length, so far to be 16, so passing in a 14 byte buffer to GSUP would require copying to a larger buffer first. Fix this by using a length of 14 for AUTS everywhere instead. This constitues an ABI breakage, we may handle it as a "fix before an official release", otherwise we need a version bump. The OAP protocol document has also been updated, needs an update in the osmo-gsm-manuals as well. Change-Id: If25b173d9ec57ea4c504d860954912b7d82af455
2017-01-27socket: Introduce function to obtain socket nameHarald Welte1-1/+43
Using this function, one can obtain a human-readable string identifying the host and port names of the socket. Change-Id: Ib5de5c7b9effe1b0a363e4473a7be7fa38ca6ef3
2017-01-25OML: add external alertsMax1-0/+1
Add special cause for alerts produced by external processes. Change-Id: Idd7ee085321f8172c72ecfdba320186049f4d988 Related: OS#1615
2017-01-24sim: Link to libtalloc as symbols of it are used hereHolger Hans Peter Freyther1-0/+1
A DSO should link to the libraries that it is using. Linking to libtalloc will resolve these warnings: Change-Id: I4c8d5e80e194b9d9b4fa2424c4a22377ecee9c7a dpkg-shlibdeps: warning: symbol _talloc_zero used by debian/libosmosim0/usr/lib/i386-linux-gnu/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol _talloc_free used by debian/libosmosim0/usr/lib/i386-linux-gnu/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol talloc_strndup used by debian/libosmosim0/usr/lib/i386-linux-gnu/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol talloc_strdup used by debian/libosmosim0/usr/lib/i386-linux-gnu/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol _talloc_memdup used by debian/libosmosim0/usr/lib/i386-linux-gnu/libosmosim.so.0.0.0 found in none of the libraries
2017-01-23ipa: Remove unneeded #include statementHarald Welte1-1/+0
Change-Id: I69f2891a2bea6f87f079b6778aa01ee27a25001b
2017-01-23disable various code if building for bare-iron embeddedHarald Welte2-0/+12
We don't have file-based I/O nor ethernet devices with mac addresses when building for OsmocomBB. Change-Id: I01a9e6d8dbe885dbeac2769b84931a4d44f7a3a5
2017-01-19Add abis_nm_fail_evt_vrep to libosmogsm.mapMax1-0/+1
Change-Id: If56b521429af497ddd5a47170eb2c085b1fb78ba
2017-01-18doc: fix doxygen 'utils' group closing braceNeels Hofmeyr1-1/+2
osmo_strlcpy() was excluded from the group because the closing brace was above it. Change-Id: I6701261f5854342ac4cd4f2da62e49eb40362938
2017-01-17libosmogsm.map: fix typoMax1-1/+1
Change-Id: I71413fbe703e459782a235e5b1d8487265de3780 Related: OS#1615
2017-01-16Mark deprecated function as suchMax1-0/+1
Mark abis_nm_debugp_foh() function superseded by macro with the same name as deprecated. Change-Id: I2d3ea2b56aff6b687f72f832360b8cb8a24164e9
2017-01-15doc: clarify osmo_strlcpy() docNeels Hofmeyr1-5/+5
Stating that it 'truncates src' is misleading. Also clarify whether siz includes the space needed for the terminating NUL. Change-Id: I01c1a94408b471f7f54576178a60938bf9ee3261
2017-01-15Always include <osmocom/core/talloc.h> and not <talloc.h>Harald Welte1-1/+1
In EMBEDDED builds we don't have a system-wide talloc Change-Id: Icc526016bda45b36e584afee8669996752d6d89c
2017-01-15configure.ac: Introduce --disable-ctrlHarald Welte1-0/+3
Using --disable-ctrl, one can disable the building of libosmoctrl. The 'embedded' target will also automaticall disable ctrl. Change-Id: I6912396338c5b23ae860fef2a55854d6df9a579d
2017-01-13Fix compilation warnings: missing includes: gsm0411_utils.c, lapd_core.c, ↵Max2-0/+2
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() functionMax1-4/+17
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-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 Dionne1-2/+2
Max's note: adjusted test output. Change-Id: I46477c631bf86345cb757f31d7f2e2935b12adcc Related: OS#1801
2017-01-10Add value strings for Probable Cause TypeMax2-0/+8
Add string representation of Probable Cause Type from 3GPP TS 12.21 § 9.4.43. Change-Id: I9fe14ed3b5398f59dd06a509e4d419e074cc20a7 Related: OS#1615
2017-01-07fsm: Add VTY introspection of osmo_fsm and their instancesHarald Welte3-4/+181
Change-Id: I89212e4f149f019099115a85bab353c04170df90
2017-01-07Add osmo_fsm_find_by_name() and avoid registering FSM with same nameHarald Welte1-1/+13
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 supportMax2-0/+39
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 descriptionsMax2-0/+16
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 Kumarvel1-0/+45
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 parsed TLV helpers from OsmoBTSMax2-0/+62
Add functions to copy and merge parsed TLV structures from OsmoBTS. Change-Id: Ieaaaed19da9c069fe451faa53d24c5b84d7d5615
2017-01-06Add OML definitions from OsmoBTSMax2-0/+62
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-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-24fsm: factor out osmo_fsm_inst_term_children() from osmo_fsm_inst_term()Neels Hofmeyr1-20/+42
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 Hofmeyr1-13/+0
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-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 Welte1-0/+42
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