AgeCommit message (Collapse)AuthorFilesLines
2017-02-24Revert "Revert "gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and ↵pmaier/rbs2000Philipp Maier1-0/+2
CHREQ_T_PDCH_TWO_PHASE"" This reverts commit 909cbecbb9d3223b3b372849564600bb9be7fbda.
2017-02-23libosmoctrl: Fix typo in ctrl_interface_connect()Harald Welte1-1/+1
it's osmo_sock_init_ofd(), not osmo_sock_init_ifd() Change-Id: Ia6a82031a691403f641815862613d99b31a3a159
2017-02-23Expand and expose ctrl connection allocationMax2-6/+52
Add function for allocating CTRL connection to public headers and replace call to previous static function with it. Add doxygen docs for this function. It's useful if we need to allocate ctrl connection but don't need to bind to any interfaces: when we act as ctrl client. Related: OS#1615 Change-Id: I522ed809cbebfd3d7dd08b4ed9137b39ff192e32
2017-02-23logging.h: fixup: shorter names for LOGGING_FILTER_* and LOGGING_CTX_*Neels Hofmeyr8-59/+61
My recent logging patch was merged to master a bit too soon. Accomodate the request for naming that matches the general "LOG" prefix instead of "LOGGING". libosmocore will not be backwards-compatible with the few commits from change-id I5c343630020f4b108099696fd96c2111614c8067 up to this one. This and following commits are backwards compatible with those before that short window. See also: * openbsc change-id Ib2ec5e4884aa90f48051ee2f832af557aa525991 * osmo-pcu change-id I4db4a668f2be07f3d55f848d38d1b490d8a7a685 Change-Id: I424fe3f12ea620338902b2bb8230544bde3f1a93
2017-02-23logging.h: fixup: add API doc for logging enums recently addedNeels Hofmeyr1-0/+5
Change-Id: Ic459b04219abe70171c8f80ed09df53d412dcfb2
2017-02-23logging.h: fix backwards compat broken by recent commitNeels Hofmeyr1-0/+7
Commit 812ba6dc63a75c39678dd3fe652768e76bf63183 "logging: centrally define ctx and filter indexes" Removed definitions, which causes older e.g. openbsc and osmo-pcu code trees to fail to build against a newer libosmocore. Re-introduce the legacy definitions to redirect to the new ones and re-establish backwards compatibility. The GPRS_* constants used to be defined in gprs_msgb.h, but since that header also includes logging.h, rather place the legacy shims in logging.h next to the other ones. Change-Id: I455bb1bb474d758af0fd5b6397f7e57260ad739d
2017-02-23gsm_04_08.h: add R99 MSCR and CBQ3 to SI3 Ctrl Chan DescrNeels Hofmeyr1-3/+5
MSCR and CBQ3 are Release 1999 additions to the Control Channel Description IE of SI3. Assuming that no-one is using the spare bits, this will not cause any code conflicts. In the R99 struct, spare1 and spare2 are in different places, so rather rename them to spare_1 and spare_2 to make sure we get a compiler barf *if* anyone tries to use them with the wrong structure. Adjust the spec reference to TS 44.018; TS 04.08 Figure 10.5.33 is replaced by TS 44.018 Figure which is right there in the named Section, so drop the explicit reference. Motivation: the R99 Control Channel Description defines MSCR to indicate whether the MSC is R99+ or not. To use UMTS AKA on GSM networks, we want to indicate that our libmsc is capable of R99, like OsmoSGSN already does. CBQ3 is merely added for completeness, no particular use case in mind. Related: OS#1593 Change-Id: If87e07b5d04e1617155383e14c98d2125fdd0608
2017-02-22logging: centrally define ctx and filter indexesNeels Hofmeyr10-54/+66
It is too easy for calling code to use the same filter and context indexes for different filters and structs. For example, openbsc's IMSI filter and libgb's GPRS_BVC filter both fall on index 1 even though there are plenty more indexes to choose from. To alleviate this, have one central definition here, sort of like ports.h does for VTY and CTRL port numbers. Add static asserts to make sure the indexes fit in the available array and bit mask space. Calling code like openbsc.git and osmo-pcu need adjustments and/or should move to using these enum values instead of their local definitions. Taking this opportunity to also prepare for a split of struct gsm_subscriber in openbsc into bsc_subsciber and vlr_subscriber with appropriate separate filter index constants for both subscriber types. Include previous LOG_FILTER_ALL in the LOGGING_FILTER_* enum, and replace its use by (1 << LOGGING_FILTER_ALL). Change-Id: I5c343630020f4b108099696fd96c2111614c8067
2017-02-22gsup_test: also check stderrNeels Hofmeyr4-8/+89
Configure logging to be deterministic and add stderr checking to testuite.at. However, exclude the thousands of message modification log lines from the log to not have a huge test expectation file. Change-Id: I0dd7112967a64a168556b62e5ec15107b7608ffb
2017-02-22gsup test: add decoding test for UMTS IEsNeels Hofmeyr2-1/+61
This would have caught the wrong expectation of AUTS' length fixed recently (3a5ca647c531b7761dc6c555e5e0cabc972bd3ac). Besides AUTS, add AUTN, RES, CK, IK which were also not tested yet. Change-Id: I6fddf8d7ce97137b0a585d365807bcaf90a319d0 Related: OS#1593
2017-02-22fix osmo_auth_gen_vec_auts: copy rand to auth vectorNeels Hofmeyr1-1/+8
Related: OS#1593 Change-Id: If943731a78089f0aac3d55245de80596d01314a4
2017-02-21gsup decode: fix expectation of AUTS length, should be 14Neels Hofmeyr1-2/+2
The wrong expectation caused OsmoHLR to fail on Auth Sync. Change-Id: I277fb3d407396dffa5c07a9c5454d87a415d393f
2017-02-19Document ctrl_interface_setup_dynip() functionMax1-0/+8
Change-Id: Ie1d5881dda7a9b797d15e9e1eead8281a994d91e
2017-02-17fix: gprs_bssgp_vty: logging filter: wrong constantNeels Hofmeyr1-1/+1
Setting the BVC log filter to NULL worked only if the NSVC filter was set, use the proper constant instead. Change-Id: Ic1cc268ed20700698c93d3ff8bf85cc0f01d3b1b
2017-02-15gsup: add osmo_gsup_message_type_name()Neels Hofmeyr3-0/+35
Change-Id: Ic29b588b72893821d73fe90ecc16c6bf78d5a360
2017-02-15 OAP:remove design doc. osmocom-authn-protocol.txtikostov2-251/+1
Osmocom Authentication Protocol design document is removed from libosmocore project as this information has been included in the User Manual. It is present in SGSN User Manual. relates to OS#1874 Change-Id: I2d4dc608622a7484e67b15f930efc76e28285045
2017-02-14osmo_hexparse: allow whitespace in parsed string, add ws testNeels Hofmeyr3-9/+51
This is particularly useful for hex dumps containing spaces found in a log (e.g. osmo-nitb authentication rand token), which can now be passed in quotes to osmo-auc-gen without having to edit the spaces away. Change-Id: Ib7af07f674a2d26c8569acdee98835fb3e626c45
2017-02-14utils: add hexparse testNeels Hofmeyr2-0/+117
Change-Id: Ic95ab00b57d54905a235109561c00419161cf4bc
2017-02-14Add CTRL port for OsmoHLRMax1-0/+1
Change-Id: I1328c89ec8e908bf4b4d2c0a398690278369e0f5 Related: OS#1645
2017-02-09cosmetic: replace fprintf with LOGPPhilipp Maier2-9/+28
socket.c still uses fprintf to output error messages. This commit replaces the fprintf with proper LOGP messages. Change-Id: Ia2993415d5f5c33ccd719af239ff59252d11b764
2017-02-09utils/conv_gen.py: improve application flexibilityVadim Yanitskiy2-9/+39
This change makes the conv_gen application more interactive and flexible, allowing to generate not only code definitions but also the test vectors and header files in the future. Moreover, it becomes possible to select exact code family, such as GSM, GMR etc. Change-Id: I0b476b00234c17f78b41d695cf3bfd13edb64c28
2017-02-08Add minimal testing of socket.c helper functionsHarald Welte6-2/+97
Change-Id: I2773b3859a206f96fb8fa095d50a653d9eeb8d79
2017-02-08fix various compiler warnings (on FreeBSD-11.0)Harald Welte4-5/+6
FreeBSD 11.0 uses clang version 3.8.0 which spits various warnings during libosmocore compilation. Let's clean this up a bit. Change-Id: Ic14572e6970bd0b8916604fabf807f1608fa07e5
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 Maier2-6/+26
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-07bssgp_fc_test: do not use real timeNeels Hofmeyr1-1/+8
Employ osmo_gettimeofday_override_* to take bssgp_fc_test off real time. The jenkins build slave often failed the test based on sporadic time delays due to server load and randomly rejected good patches. This patch ends that. Change-Id: Ie5029b85c2a154554d75d7f9af49a3b93425fdd9 Related: OS#1809
2017-02-06osmo_auth*: fix ordering of function argsNeels Hofmeyr2-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
2017-02-06osmo-auc-gen: cmdline help: list algorithms; error messagesNeels Hofmeyr1-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
2017-02-04osmo-auc-gen: cosmetic: clarify output upon AUTSNeels Hofmeyr1-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
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-02gsm48: add UMTS AKA res+sync IEIs, msg type and cause valNeels Hofmeyr1-0/+4
According to 3GPP TS 24.008 9.2.3a, 9.2.3, Change-Id: I745061ce8eb88aa23080dadcdbfe2d703c362a30
2017-02-02GSUP, OAP, osmo-gen-vec: fix AUTS length to 14, not 16Neels Hofmeyr7-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
2017-01-30comment: ports.h: more visibly remind to keep docs+wiki syncedNeels Hofmeyr2-0/+2
It is still too easy to forget syncing, so add another reminder at the end of the list. Change-Id: I95191906afa8e6ada31310d0e36de33e3fccf268
2017-01-28vty/ports.h: reserve port 4258 for OsmoHLR VTYNeels Hofmeyr1-0/+1
Change-Id: I08cb52d9399a27e6876e45da36f434708c4fddef
2017-01-27socket: Introduce function to obtain socket nameHarald Welte3-1/+46
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 alertsMax2-0/+3
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-23utils.h: #include <stdio.h> as we use fprintf()Harald Welte1-0/+1
Change-Id: I911c7f4bcadde414ce0b384e13a3a9a4a953e2fb
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-21linuxlist.h: add llist_count()Neels Hofmeyr1-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
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-16logging: remove code duplicationMax1-13/+4
* make DEBUGP* macro into simple wrappers around LOGP* * deprecate unused logp() function Related: OS#71 Change-Id: Ia6c92bd4824c44fc22cc733ce7a88da86e58ed93
2017-01-16tests/conv: whitespece fixVadim Yanitskiy1-1/+1
Change-Id: I73ab4614c5c23390862d3ecaa2561a6749604a15
2017-01-16tests/conv: add LTE PBCH test vectorVadim Yanitskiy2-0/+68
Change-Id: I1a3a48bba9ee32a0bacc0b05d25358496dbcbc1b
2017-01-16CTRL: add write-only helpersMax1-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
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