summaryrefslogtreecommitdiffstats
path: root/src/gsm
Commit message (Collapse)AuthorAgeFilesLines
* 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
* GSUP, OAP, osmo-gen-vec: fix AUTS length to 14, not 16Neels Hofmeyr2017-02-021-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
* OML: add external alertsMax2017-01-251-0/+1
| | | | | | | Add special cause for alerts produced by external processes. Change-Id: Idd7ee085321f8172c72ecfdba320186049f4d988 Related: OS#1615
* ipa: Remove unneeded #include statementHarald Welte2017-01-231-1/+0
| | | | Change-Id: I69f2891a2bea6f87f079b6778aa01ee27a25001b
* Add abis_nm_fail_evt_vrep to libosmogsm.mapMax2017-01-191-0/+1
| | | | Change-Id: If56b521429af497ddd5a47170eb2c085b1fb78ba
* libosmogsm.map: fix typoMax2017-01-171-1/+1
| | | | | Change-Id: I71413fbe703e459782a235e5b1d8487265de3780 Related: OS#1615
* 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
* Fix compilation warnings: missing includes: gsm0411_utils.c, lapd_core.c, ↵Max2017-01-132-0/+2
| | | | | | oap_test.c Change-Id: Id524327b3f44e22e3aa44c5e8e4965b084cb326a
* Add abis_nm_fail_evt_vrep() functionMax2017-01-111-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
* LAPD: improve loggingMax2017-01-101-4/+6
| | | | | | Log error cause and state names in case of SABM errors. Change-Id: I2c7fa276e03f8b14ba41cc1fb6e19d0aae77d127
* Add value strings for Probable Cause TypeMax2017-01-102-0/+8
| | | | | | | | Add string representation of Probable Cause Type from 3GPP TS 12.21 § 9.4.43. Change-Id: I9fe14ed3b5398f59dd06a509e4d419e074cc20a7 Related: OS#1615
* Add OML Failure Event Report supportMax2017-01-062-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
* Add event cause string descriptionsMax2017-01-062-0/+16
| | | | | | | | Add human-readable descriptions to event causes from 3GPP TS 12.21 § 9.4.43. Change-Id: Id173c978616c98b7831fbafb5401064257f1cf73 Related: OS#1615
* Add parsed TLV helpers from OsmoBTSMax2017-01-062-0/+62
| | | | | | Add functions to copy and merge parsed TLV structures from OsmoBTS. Change-Id: Ieaaaed19da9c069fe451faa53d24c5b84d7d5615
* Add OML definitions from OsmoBTSMax2017-01-062-0/+62
| | | | | Change-Id: I9c3bc15662949654e7bba6aad5488c69ee7d0c45 Related: OS#1615
* gprs_cipher_core: Use typecase to avoid sanitizer errorHarald Welte2017-01-061-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
* Fix erroneously AGPL licensed file in libosmocore.Harald Welte2016-12-221-4/+4
| | | | | | | libosmocore itself is GPLv2-or-later. Only the test cases are permitted to be AGPL licensed. Change-Id: I62f2eed6305bfa11a64c6d633e08aabeaf9f0b10
* Catch-up with git version tagsMax2016-12-211-2/+3
| | | | | | | | | | | | * 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
* gsm/oap: more robust: decode presence as clearly either 1 or 0Neels Hofmeyr2016-12-111-4/+4
| | | | | | | Prepares for the unit test, which can now simply check for encode/decode identity. Change-Id: I410ff120d868e8d55df9cb19ba6eefd99749cdf0
* import oap message parsing / encoding from openbsc.git; AGPL->GPLHarald Welte2016-12-113-1/+188
| | | | | | | | | | | | | | | | | | | In the process, also: * Change the license from AGPLv3 to GPLv2-or-later; * correct spelling of 'sysmocom' to lowercase; * add '2016' to the copyright; * rename to osmo_*; * add API docs; * add logging category DLOAP: define id and add to internal_cat; * redirect all oap.c logging to DLOAP. A unit test will follow in a subsequent patch, since it needs a minor tweak for decoding of boolean values. The related openbsc change-id is I2f06aaa6eb54eafa860cfed8e72e41d82ff1c4cf. Tweaked-by: Neels Hofmeyr Change-Id: If5099e60681a215e798b6675f21813f26769c253
* cosmetic: gsup comments: write 'Generic' for the G in GSUPNeels Hofmeyr2016-12-091-1/+1
| | | | | | | | The G used to mean GPRS, but the scope is larger now. To satisfy the curious reader, give the G a name in gsup files' header comments. BTW, logging.h and gsup_test.c already mentioned "Generic" before this. Change-Id: I6ac5cf94c215e156ceff6a58da3d9e520ca942d9
* license: gsup: libosmogsm requires GPL, not AGPL; say 'sysmocom'Neels Hofmeyr2016-12-091-5/+5
| | | | | | | | | The copyright in gsup.h differed from the one in gsup.c: gsup.c names the GNU Affero GPL, gsup.h only the GNU GPL. Change both to GPL-v2-or-later. In gsup.c/h's copyright notice, 'sysmocom' should be spelled lower case. Change-Id: Ia5748c275501889b9086aef7d20ccb5c9edb8031
* gsm0480: add gsm0480_create_ussd_notify() and *_release_complete()Neels Hofmeyr2016-12-012-0/+31
| | | | | | | | | | | Add two functions to create USSD messages. Moves and generalizes code from openbsc. Pending: use the new functions in openbsc. It looks like _release_complete() should also set trans_id and direction flag; but since this is moving code from openbsc that is apparently working, just place a fixme comment and don't change the functionality. Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0
* gsm0480: code dup: introduce and use gsm0480_l3hdr_push()Neels Hofmeyr2016-12-012-13/+16
| | | | | | | | Add function gsm0480_l3hdr_push() to push a struct gsm48_hdr to the start of a msgb. Use in gsm0480.c and gsm0411_utils.c. Further callers of the new function will follow in openbsc as well as another libosmocore patch for ussd. Change-Id: I54fce6053ab8362015686fe22dbcd38bf1366700
* osmo_gsup_encode(): Make coverity happy by invariant checkingHarald Welte2016-11-261-0/+1
| | | | | | | | | gsm48_encode_bcd_number() can theoretically return a length in excess of the size of the bcd_buf, but only in case an overly-long IMSI is passed into the function (which would be illegal in the first place). Change-Id: If3dc68ee13ff784b487bbc686b777cec9057d537 Fixes: Coverity CID 135216
* Extend IPA error loggingMax2016-11-161-2/+2
| | | | | | | | Output more information in case of IPA protocol errors to make debugging easier. Change-Id: I7632d6e679e076bfbec9abc12da4a46cc27ccea1 Related: SYS#3028
* gan: Mark gan_pdisc_vals[] as public / non-static symbolHarald Welte2016-11-111-1/+1
| | | | | | | It is actually listed in libosmogsm.map, but still used to be a static symbol. That couldn't have worked. Change-Id: I6f3f04b683d906674ee7da9bab5762bb00cea916
* gsm0408: Completing GSM 04.08 RR message typesPhilipp2016-10-272-0/+109
| | | | | | | | | | | - Add missing message types to be up to date with the latest specification release (3GPP TS 04.18) - Add value strings to translate RR message type identifiers into human readable strings. (see gsm48_rr_msg_name() in gsm48.h Change-Id: I3ceb070bf4dc8f5a071a5d43c6aa2d4e84c2dec6
* COSMETIC: moving rr_cause_name() in gsm48.cPhilipp2016-10-271-5/+5
| | | | | | | | | | rr_cause_name() is located a far of from value_string rr_cause_names[] while other value string functions are located right below their related value string definitions. This commit moves rr_cause_name() below rr_cause_names[] as it should be Change-Id: Ie6c03a6ea02c370d8733db5ba2a709610cd70ce7
* utils/conv_gen.py: add EDGE MCS 1-9 definitionsVadim Yanitskiy2016-10-231-0/+15
| | | | Change-Id: Ie1452342f524a8b60f2babc07398a1d9c9e06aa3
* utils/conv_gen.py: add RACH, SCH and TCH/AHS definitionsVadim Yanitskiy2016-10-231-0/+10
| | | | Change-Id: I0ea7151f4e8119a8798a9e129b951559e56b0d93
* utils/conv_gen.py: generate a single fileVadim Yanitskiy2016-10-231-7/+5
| | | | | | | | | | | | | | | | Instead of generating every convolutional code into a separate file (such as conv_xcch_gen.c, conv_cs3_gen.c), it is better to have a single file, containing all definitions, because as many convolutional codes we add, as many entries we will have to add into 'src/gsm/Makefile.am'. This approach increases readability of the Makefile.am, and also makes us able to share some data between some convolutional code definitions. For example: xCCH, RACH, SCH, TCH/F, both CS2 and CS3 may use the same *_state[][2] and *_output[][2] arrays within a single file. This optimization is currently WIP. Change-Id: Ib4e4ee5fdde38429e68e3b2fa50ec03a18f59daa
* gsm/Makefile.am: use proper top_builddir/top_srcdir pathsNeels Hofmeyr2016-10-121-3/+3
| | | | | | | | | | This fixes the conv*gen.c targets when building in a different directory than the source tree. Notably, building in a different dir worked when the generated sources were already present from a previous build inside the source directory. Change-Id: I5a9b780ad4ba607ea39854dcf7207ed05f5447bc
* fix USSD: SS message type mask should be 0x3f, not 0xbfNeels Hofmeyr2016-10-121-1/+1
| | | | | | | | | | | | | | See 04.80[1], section 3.4: the highest two bits are used as counter or ignored and do not contribute to the SS "Miscellaneous message group". Previous mask of 0xbf included the highest bit, fix to 0x3f. Observed a value of 0xbb that should mean 0x3b="Register" during testing of 3G USSD requests, which seem to be the first to send a nonzero highest bit to our code. The erratic mask of 0xbf lead to an unhandled message type of 0xbb. [1] 3GPP TS 24.080 version 7.2.0 Release 7 / ETSI TS 124 080 V7.2.0 (2006-09) Change-Id: I299001a9e36c16f55622a0acd5d4a55ca49d0055
* IuPS: add GMM Service Request related constants and value_strNeels Hofmeyr2016-08-292-0/+12
| | | | Change-Id: Ie023fc78099932f95cc8f1b3a04fe25dfd14bc35
* lapd_core: Fix crash in lapd_dl_flush_hist()Harald Welte2016-08-011-1/+1
| | | | | | | | When lapd_dl_flush_hist() was called before we actually had started a transmit history from lapd_dl_init(), we woul segfault before this patch. Change-Id: Ifa677c9b335dd2884b4f3e44699d901957a0500b
* egprs: Add CPS tables from TS 04.60Tom Tsou2016-07-253-1/+109
| | | | | | | | Includes EGPRS coding and puncturing scheme (CPS) tables from 3GPP TS 04.60. Currently osmo-bts-trx is the only user of CPS table values, but this may change with gprsdecode and other utilities. Change-Id: I09fe6514a0e2e51bb3206f8387633f7e0255345f
* rsl: add rsl_act_type_name()Neels Hofmeyr2016-07-232-0/+14
| | | | Change-Id: Ie90c76d8aef42d5e2c9be94f4b206d4994e305f8
* dyn TS: add definitions for dynamic TCH/F_TCH/H_PDCHNeels Hofmeyr2016-07-231-0/+1
| | | | | | | | | | | Add: * GSM_PCHAN_TCH_F_TCH_H_PDCH * NM_CHANC_OSMO_TCHFull_TCHHalf_PDCH * RSL_CHAN_OSMO_PDCH * RSL_ACT_OSMO_PDCH Related: OS#1776 Change-Id: Ib1a8b11f37af4686d00ac88beba38557aa29edc2
* fix compiler warning: gsup.c: missing bracesNeels Hofmeyr2016-07-171-1/+1
| | | | | | | osmo_auth_vector's first member is an array, so for a zero initializer, we should add a second set of array braces. Change-Id: Iace448caca8152e46244f26c3af250f2035c99eb
* Add GEA3 & GEA4 ciphersMax2016-07-113-2/+110
| | | | | | | | | | | Corresponding test code include both official test vectors from the specs and data from over-the-air tests. This obsoletes libosmo-crypt-a53 as it was last missing piece unimplemented in libosmogsm. Change-Id: I939e4f6b91b4a7c591ef3761fe2d46ed1c2fb2d3 Related: OS#1582
* Add strings with GPRS GMM messagesMax2016-07-082-0/+25
| | | | | Change-Id: I48477b733e2da72f59349c00554dd3e080c9f445 Related: OS#1582
* Add function to check GMM encryptabilityMax2016-07-072-0/+26
| | | | | | | | Check if particular GMM message can be encrypted according to 3GPP TS 24.008 § 4.7.1.2 Related: OS#1582 Change-Id: I7ad0e03c2c738d174dd6bc3453f332eeb8da1e7d
* Add missing osmo_c4 exportMax2016-07-071-0/+1
| | | | | Change-Id: Iaf53b31b4fa3860301054e970907ada061360b28 Related: OS#1741
* lapd_dl_flush_hist(): Don't flush a non-existant historyHarald Welte2016-07-031-0/+3
| | | | | | | | | | | If lapd_dl_flush_hist() is called after lapd_dl_exit(), dl->tx_hist has already been free'd and set to NULL. Check for this before attempting to de-reference a NULL pointer. This bug breaks OpenBSC with any E1 based BTSs using DAHDI. Change-Id: I117ba3445fa5e8097e21c11c5a6337de6ba46c7d Related: OS#1760
* Add function to check MS GEA capabilitiesMax2016-06-292-1/+31
| | | | | | | | Add function which parses MS network capability IE value for bits indicating support for particular version of GEA. Change-Id: I785cef37dd272a2fab9b172f6e1392f865174e9a Relates: OS#1582
* Make C4 function globally availableMax2016-06-292-4/+4
| | | | | | | | | This function perform 64 -> 128 bit key expansion which useful for converting between UMTS CK and GSM Kc, A5/3 and A5/4, GEA3 and GEA4 keys. Change-Id: I5a6c6deef6027cd6af144c9062d4c9166be26904 Related: OS#1582
* Add strings for GPRS ciphersMax2016-06-292-0/+10
| | | | | Change-Id: I050bda5fb50aad42fe2d72de39f8256b4fb12fb2 Related: OS#1582
* Add UMTS AKA related MM/GMM message type and IE definitionsHarald Welte2016-06-161-1/+9
| | | | | | | Change-Id: Id45ea2c631ee589a4df1f8213da6f7e7d1bf6616 Reviewed-on: https://gerrit.osmocom.org/305 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
* gsup.c: Fix encoding of UMTS auth vectorsHarald Welte2016-06-161-6/+22
| | | | | | | | | | Encoding auth vectors worked fine for GSM authentication, but didn't yet include the new IEs for UMTS authentication yet. Change-Id: I7fa5ba1c950292bd0a9874b3102a27f221ce390d Reviewed-on: https://gerrit.osmocom.org/302 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder