summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* osmo_auth*: fix ordering of function argsNeels Hofmeyr2017-02-062-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* osmo-auc-gen: cmdline help: list algorithms; error messagesNeels Hofmeyr2017-02-061-1/+10
| | | | | | | | | | | | In the -h help output, list the names of available algorithms. In case of option parsing failure, also print help() (so that e.g. for a typo in the algorithm, the list of algorithms is printed along with the error message). If there are -2/-3 or -a missing, show an error message that explains this. Change-Id: I76732b28d7a553a6293d1707fe398d28b5ef4886
* osmo-auc-gen: cosmetic: clarify output upon AUTSNeels Hofmeyr2017-02-041-1/+14
| | | | | | | | | | | | | | | | | | | | | When calculating a re-sync vector using AUTS, osmo-gen-vec used to print SQN.MS + 2, the new SQN after vector generation, labeled 'SEQ.MS'. Firstly, s/SEQ/SQN. Secondly, print SQN.MS as umts.sqn - 2, which is the actual SQN recovered from the AUTS. As explained in the comment, SQN.MS + 1 is used to generate the vector, and then umts.sqn is increased a second time to indicate the next SQN. With AUTS calculated from SQN.MS == 23, the output was: AUTS success: SEQ.MS = 25 Output now: AUTS success: SQN.MS = 23, generated vector with SQN = 24, next SQN = 25 Change-Id: I881bbe8246a5e7d3a5065b4b5b533255723b1a9e
* lapd_core: Improve debug outputPhilipp Maier2017-02-031-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
* gsm48: add UMTS AKA res+sync IEIs, msg type and cause valNeels Hofmeyr2017-02-021-0/+4
| | | | | | According to 3GPP TS 24.008 9.2.3a, 9.2.3, 10.5.3.6 Change-Id: I745061ce8eb88aa23080dadcdbfe2d703c362a30
* GSUP, OAP, osmo-gen-vec: fix AUTS length to 14, not 16Neels Hofmeyr2017-02-027-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* comment: ports.h: more visibly remind to keep docs+wiki syncedNeels Hofmeyr2017-01-302-0/+2
| | | | | | | It is still too easy to forget syncing, so add another reminder at the end of the list. Change-Id: I95191906afa8e6ada31310d0e36de33e3fccf268
* vty/ports.h: reserve port 4258 for OsmoHLR VTYNeels Hofmeyr2017-01-281-0/+1
| | | | Change-Id: I08cb52d9399a27e6876e45da36f434708c4fddef
* socket: Introduce function to obtain socket nameHarald Welte2017-01-273-1/+46
| | | | | | | Using this function, one can obtain a human-readable string identifying the host and port names of the socket. Change-Id: Ib5de5c7b9effe1b0a363e4473a7be7fa38ca6ef3
* OML: add external alertsMax2017-01-252-0/+3
| | | | | | | Add special cause for alerts produced by external processes. Change-Id: Idd7ee085321f8172c72ecfdba320186049f4d988 Related: OS#1615
* sim: Link to libtalloc as symbols of it are used hereHolger Hans Peter Freyther2017-01-241-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
* ipa: Remove unneeded #include statementHarald Welte2017-01-231-1/+0
| | | | Change-Id: I69f2891a2bea6f87f079b6778aa01ee27a25001b
* utils.h: #include <stdio.h> as we use fprintf()Harald Welte2017-01-231-0/+1
| | | | Change-Id: I911c7f4bcadde414ce0b384e13a3a9a4a953e2fb
* disable various code if building for bare-iron embeddedHarald Welte2017-01-232-0/+12
| | | | | | | We don't have file-based I/O nor ethernet devices with mac addresses when building for OsmocomBB. Change-Id: I01a9e6d8dbe885dbeac2769b84931a4d44f7a3a5
* linuxlist.h: add llist_count()Neels Hofmeyr2017-01-211-0/+16
| | | | | | | | | | | | | | | After subchan_demux.c in libosmo-abis, osmo-bts/common/vty.c and openbsc's gtphub_test.c, more places would like to count the llist items (mostly unit tests). Instead of proliferating numerous local implementations, add here. NOTE: other than the previous llist_len() implementations, this one returns an *unsigned* length, which might need some adjusting of current callers. Call this llist_count() rather than llist_len() to highlight the fact that this is actively iterating. This also avoids a potential naming conflict when library versions mismatch. Change-Id: Ic49adc7a346f5722bf624d7d3b4a735e4220ae15
* Add abis_nm_fail_evt_vrep to libosmogsm.mapMax2017-01-191-0/+1
| | | | Change-Id: If56b521429af497ddd5a47170eb2c085b1fb78ba
* doc: fix doxygen 'utils' group closing braceNeels Hofmeyr2017-01-181-1/+2
| | | | | | | osmo_strlcpy() was excluded from the group because the closing brace was above it. Change-Id: I6701261f5854342ac4cd4f2da62e49eb40362938
* libosmogsm.map: fix typoMax2017-01-171-1/+1
| | | | | Change-Id: I71413fbe703e459782a235e5b1d8487265de3780 Related: OS#1615
* logging: remove code duplicationMax2017-01-161-13/+4
| | | | | | | | * make DEBUGP* macro into simple wrappers around LOGP* * deprecate unused logp() function Related: OS#71 Change-Id: Ia6c92bd4824c44fc22cc733ce7a88da86e58ed93
* tests/conv: whitespece fixVadim Yanitskiy2017-01-161-1/+1
| | | | Change-Id: I73ab4614c5c23390862d3ecaa2561a6749604a15
* tests/conv: add LTE PBCH test vectorVadim Yanitskiy2017-01-162-0/+68
| | | | Change-Id: I1a3a48bba9ee32a0bacc0b05d25358496dbcbc1b
* CTRL: add write-only helpersMax2017-01-161-0/+24
| | | | | | | | | Similar to CTRL_CMD_DEFINE_RO() add helper for control commands which are not meant to be read, only to set. Similarly, add CTRL_CMD_DEFINE_WO_NOVRF() for commands which do not perform inbound data verification. Change-Id: I66b7990db590c1f8e56326e392e6c1d2eafebd9a
* Mark deprecated function as suchMax2017-01-161-0/+1
| | | | | | | Mark abis_nm_debugp_foh() function superseded by macro with the same name as deprecated. Change-Id: I2d3ea2b56aff6b687f72f832360b8cb8a24164e9
* stats_test: fix mismatching osmo_stats_reporter->send_item signatureNeels Hofmeyr2017-01-151-2/+3
| | | | | | | | | | | | | | | The function pointer expects the last arg as int64_t, stats_test.c uses an int instead. Fix the argument type as well as the printf format for it. Fixes this compiler warning seen on our FreeBSD build slave: CC stats/stats_test.o ../../tests/stats/stats_test.c:288:18: warning: incompatible pointer types assigning to 'int (*)(struct osmo_stats_reporter *, const struct osmo_stat_item_group *, const struct osmo_stat_item_desc *, int64_t)' from 'int (struct osmo_stats_reporter *, const struct osmo_stat_item_group *, const struct osmo_stat_item_desc *, int)' [-Wincompatible-pointer-types] srep->send_item = stats_reporter_test_send_item; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. Change-Id: I91cbfd4dd25a881b803943430101dabf07dafc7c
* doc: clarify osmo_strlcpy() docNeels Hofmeyr2017-01-151-5/+5
| | | | | | | Stating that it 'truncates src' is misleading. Also clarify whether siz includes the space needed for the terminating NUL. Change-Id: I01c1a94408b471f7f54576178a60938bf9ee3261
* bitvec: Ensure bitvec.h and bitvec.c agree on function argument typeHarald Welte2017-01-151-1/+1
| | | | | | uint32_t may or may not be unsigned int. Change-Id: I21c96985fcbb72372b6df949301c21f1ebca41f2
* Always include <osmocom/core/talloc.h> and not <talloc.h>Harald Welte2017-01-152-2/+2
| | | | | | In EMBEDDED builds we don't have a system-wide talloc Change-Id: Icc526016bda45b36e584afee8669996752d6d89c
* configure.ac: Disable PCSC related code on EMBEDDEDHarald Welte2017-01-151-0/+1
| | | | | | | The EMBEDDED conditional is used for building inside 'bare iron' embedded devices like OsmocomBB phones. There's no PC/SC in them. Change-Id: I2ef7561d7fdb1ef1c060f8ac73d8588fc0f8eb3f
* configure.ac: Introduce --disable-ctrlHarald Welte2017-01-152-0/+12
| | | | | | | | Using --disable-ctrl, one can disable the building of libosmoctrl. The 'embedded' target will also automaticall disable ctrl. Change-Id: I6912396338c5b23ae860fef2a55854d6df9a579d
* Fix compilation warnings: missing includes: gsm0411_utils.c, lapd_core.c, ↵Max2017-01-133-0/+3
| | | | | | oap_test.c Change-Id: Id524327b3f44e22e3aa44c5e8e4965b084cb326a
* gprs_ns_vty: guard against duplicate VTY elementsNeels Hofmeyr2017-01-121-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
* Add abis_nm_fail_evt_vrep() functionMax2017-01-112-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
* Remove obsolete .deb patchMax2017-01-102-47/+0
| | | | | Change-Id: Icbf911540fcc840833c5012363c2ba48fd71db52 Related: OS#1694
* LAPD: improve loggingMax2017-01-101-4/+6
| | | | | | Log error cause and state names in case of SABM errors. Change-Id: I2c7fa276e03f8b14ba41cc1fb6e19d0aae77d127
* DTX: fix AMR SID-FIRST detectionJean-Francois Dionne2017-01-102-4/+4
| | | | | | | Max's note: adjusted test output. Change-Id: I46477c631bf86345cb757f31d7f2e2935b12adcc Related: OS#1801
* Add value strings for Probable Cause TypeMax2017-01-103-0/+10
| | | | | | | | Add string representation of Probable Cause Type from 3GPP TS 12.21 § 9.4.43. Change-Id: I9fe14ed3b5398f59dd06a509e4d419e074cc20a7 Related: OS#1615
* gsmtap: Add GSMTAP_TYPE_QC_DIAGHarald Welte2017-01-091-0/+1
| | | | | | | This adds a definition for wrapping Qualcomm DIAG frames into GSMTAP for transporting them over an IP network. Change-Id: I1b357b7d11a370685671c7b01e55f4f36dec2f25
* gitignore: ignore *.pyc filesVadim Yanitskiy2017-01-081-0/+1
| | | | Change-Id: I148584e1664b20741c0ade02cbda635c24268d2e
* fsm: Add VTY introspection of osmo_fsm and their instancesHarald Welte2017-01-074-4/+189
| | | | Change-Id: I89212e4f149f019099115a85bab353c04170df90
* Add osmo_fsm_find_by_name() and avoid registering FSM with same nameHarald Welte2017-01-072-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
* vty: OSMO_ASSERT() if two identical commands are installedHarald Welte2017-01-071-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
* Add OML Failure Event Report supportMax2017-01-063-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
* Add event cause string descriptionsMax2017-01-063-0/+18
| | | | | | | | Add human-readable descriptions to event causes from 3GPP TS 12.21 § 9.4.43. Change-Id: Id173c978616c98b7831fbafb5401064257f1cf73 Related: OS#1615
* Add function to get uninterrupted bit runPravin Kumarvel2017-01-064-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
* Add cause enum for OML fail reportsMinh-Quang Nguyen2017-01-061-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
* Add parsed TLV helpers from OsmoBTSMax2017-01-063-0/+64
| | | | | | Add functions to copy and merge parsed TLV structures from OsmoBTS. Change-Id: Ieaaaed19da9c069fe451faa53d24c5b84d7d5615
* Add OML definitions from OsmoBTSMax2017-01-064-0/+76
| | | | | Change-Id: I9c3bc15662949654e7bba6aad5488c69ee7d0c45 Related: OS#1615
* Remove direct loggingMax2017-01-061-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
* gitignore: ignore tests/oap/oap_testVadim Yanitskiy2017-01-061-0/+1
| | | | Change-Id: Iccb8c46a721d5389058c5cf36621820bcd861b7b
* lapd_test: avoid calling memcpy with NULL sourceHarald Welte2017-01-061-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