summaryrefslogtreecommitdiffstats
path: root/src/gsm
Commit message (Collapse)AuthorAgeFilesLines
* Rename struct to better match libosmocore conventionsMax2016-03-171-3/+3
|
* Revert "gsm48: move to hex TMSI representation"Harald Welte2016-03-171-1/+1
| | | | This reverts commit f451ce66eb8206bad1078849723edcb209632834.
* gsm48: move to hex TMSI representationVadim Yanitskiy2016-03-171-1/+1
| | | | Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
* Add basic EARFCN supportMax2016-03-172-0/+54
| | | | | | Add structure representing group of EARFCNs with common priority, threshold etc. Add functions to populate this structure.
* gsm48: factor out MCC+MNC BCD parsing for re-use in UMTSNeels Hofmeyr2016-03-152-21/+36
| | | | | | | | | | For 3G, I need a BCD composer/parser similar to gsm48_generate_lai()/ gsm48_decode_lai(). Those functions also handle a trivial extra member (lac) which I don't need in this way for 3G. So create new functions to take on the MCC+MNC BCD handling and call those from gsm48_generate_lai() and gsm48_decode_lai(). In this way, the 3G code in openbsc can use only the BCD functionality without code duplication.
* 04.08: add inline funcs for pdisc + msg type bitmasksNeels Hofmeyr2016-03-151-2/+2
| | | | | | | | | | | | | | | | Add inline functions for both release <= 98 and release >= 99 as well as a default define. Use the release 98 by default since the current code base uses the r98 bitmasks. These inline functions relieve callers of the decision on masking bits of the protocol discriminator and message type octets. Also add a define for the protocol discriminator extension to one octet length (GSM48_PDISC_EXTEND). Apply new pdisc function in gsm0480.c. [hfreyther: Make the hdr param const]
* comment typoNeels Hofmeyr2016-02-291-1/+1
|
* ipa: recv is declared in different headers on BSDHolger Hans Peter Freyther2015-11-091-0/+2
| | | | | | | | Include the headers mentioned by the manpage ipa.c:346:9: warning: implicit declaration of function 'recv' is invalid in C99 [-Wimplicit-function-declaration] ret = recv(fd, msg->tail, needed, 0);
* Fix sporadic out-of-bounds errorMax2016-01-221-13/+21
| | | | | | | | This code dealing with bit shifting sometimes gets 1 byte beyond array boundary while calculating index. This is now explicitly checked and prevented. Ticket: OW#1198 Sponsored-by: On-Waves ehf
* gsm: Add APN conversion functionsJacob Erlbeck2016-01-152-0/+77
| | | | | | | | | | | | These functions are currently part of openbsc but also needed by other projects. The function have been renamed as follows: gprs_apn_to_str -> osmo_apn_to_str gprs_str_to_apn -> osmo_apn_from_str Sponsored-by: On-Waves ehf
* some comments / fixed typosNeels Hofmeyr2015-12-211-1/+1
|
* LaPDm: Refuse SUSPEND/RESUME/RECONNECT in BTS modeHarald Welte2015-12-191-0/+17
| | | | | | The primitives for SUSPEND, RESUME and RECONNECT are only permitted on the MS side of the LAPDm link, not on the BTS side. So we should check for this and reject, accordingly.
* RSL: Add enum + TLV definitions for ip.access style embedded IEsHarald Welte2015-12-132-0/+27
|
* remove our internal copy of talloc, use system libtallocHarald Welte2015-12-051-2/+2
| | | | | | | Shipping our own private copy of talloc was a good idea in 2008, when it was not readily available on most target platforms. Today, the situation is quite different, as it is a standard library on major Linux distributions.
* fix some typosNeels Hofmeyr2015-11-021-2/+2
| | | | Sponsored-by: On-Waves ehi
* build: have a disable-static build succeedJan Engelhardt2015-09-161-2/+6
| | | | | | | | | | | | | When using configure --disable-static, no libosmogsm.a will be created, and the tests fail to link because symbols like _a5_3 and _a5_4 are not exported through the only remaining libosmogsm.so. A method to overcome this is an intermediate private non-distributed library, examples of which are present in e.g. libabc, kmod and systemd. With this, disable-static can now be the default and practical compile time be halved.
* Introduce gsm48_mi_type_name() functionHarald Welte2015-08-182-0/+15
|
* Add G-RNTI derived TLLI types defined in 23.003Harald Welte2015-08-181-1/+5
|
* ipa: Add libosmogsm.map entry for ipa_ccm_idtag_parse_offJacob Erlbeck2015-06-041-0/+1
| | | | | | | | | Addresses: CCLD utils/utils_test utils_test.o: In function `test_idtag_parsing': git/libosmocore/tests/utils/utils_test.c:64: undefined reference to `ipa_ccm_idtag_parse_off' Sponsored-by: On-Waves ehf
* ipa: Properly parse LV stream of a ID_GET requestHolger Hans Peter Freyther2015-06-021-3/+13
| | | | | | | | For some reason the structure is closer to be a LV (length and value). The value is actually a tag but it is counted inside the length. Introduce an overload of the parse function to provide an offset for the length. This will be taken from the returned length.
* Add APN utility function to libosmogsmHarald Welte2015-05-253-1/+42
| | | | | | The current functions are used to 'qualify' an APN from the user-supplied APN name (name identifier) towards the fully-qualified APN name which is used in the .grps DNS zone.
* msgb: Check the return value of msgb_alloc (Coverity)Jacob Erlbeck2015-04-101-0/+3
| | | | | | | | | | | In some places, the return value of msgb_alloc/msgb_alloc_headroom is not checked before it is dereferenced. This commit adds NULL checks to return with -ENOMEM from the calling functions if the alloc function has failed. Fixes: Coverity CID 1249692, 1293376 Sponsored-by: On-Waves ehf
* gsm: Add A5/3-4 cipher supportMax2015-03-281-3/+68
| | | | | Signed-off-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* gsm0808: Remove duplicate initializationHolger Hans Peter Freyther2015-03-181-1/+0
| | | | | | | | | | | | | | | These types were compatible so simply remove one. Fixes: gsm0808.c:323:37: warning: initializer overrides prior initialization CC gsm0480.lo of this subobject CC abis_nm.lo [-Winitializer-overrides] [GSM0808_IE_LSA_INFORMATION] = { TLV_TYPE_TLV }, ^~~~~~~~~~~~ gsm0808.c:316:36: note: previous initialization is here [GSM0808_IE_LSA_INFORMATION] = { TLV_TYPE_TLV }, ^~~~~~~~~~~~
* Supplementary Services (de)activation, interrogation addedTobias Engel2015-01-012-25/+102
| | | | | | | | | | | | | These patches enhance the Supplementary Service (SS) processing from only being able to handle USSD to other SS, specifically activation, deactivation and interrogation of those SS. Registration is not yet implemented. include/osmocom/gsm/protocol/gsm_09_02.h has been added with needed values for SS. Modified by Harald Welte to keep the old ussd-only functiosn for API/ABI stability.
* fixupHarald Welte2014-12-301-0/+4
|
* add gsm0341_test to generate SMSCB hex stringsHarald Welte2014-12-293-1/+59
| | | | Those hex strings can then be copy+pasted into the OSmoNITB VTY
* libosmo-gsm: Add PCHAN/LCHAN types for CBCHHarald Welte2014-12-281-0/+2
|
* ipa: Return -errno instead of -1 in ipa_sendJacob Erlbeck2014-12-221-1/+1
| | | | | | | | | | | | | Currently, the ipa_send function returns -1 in one execution branch to indicate an error and -EIO in another. This is not consistent and can lead to a misinterpretation of the error code, since -1 is -EPERM and in general, EPERM is not returned by write(2). This patch changes the return code to -errno instead of -1 for the case that write(2) fails for same reason. So -rc is always a sensible error value if there is a failure. Sponsored-by: On-Waves ehf
* fix libosmocore build for NuttX targetHarald Welte2014-12-041-0/+5
| | | | | | this fixes some compilation issues with libosmocore under NuttX, particularly as some #defines are missing or some header files are slightly different.
* Change copyright notice of ipa.c to GPLv2+Harald Welte2014-10-261-4/+4
| | | | ... which it should have been all along.
* Change license of gsm0411_smc/smr to GPLv2+Harald Welte2014-10-263-12/+12
| | | | | | libosmocore.{so,a} should always have been GPLv2+. However, when migrating some code from OpenBSC or OsmocomBB, we sometimes introduced it with a wrong license header.
* build: remove unused all_includes and use AM_CPPFLAGSJan Engelhardt2014-10-031-1/+2
| | | | | Preprocessor flags are best placed in AM_CPPFLAGS. Remove use of the unused all_includes variable, which is never set.
* misc: Look into the build directory for generated filesHolger Hans Peter Freyther2014-09-251-1/+1
| | | | | | the bits/crc files are not inside the sourcedirectory but will end in the build directory. Go and look there as well. This somehow doesn't fail with make distcheck but when building for Yocto Dizzy.
* Fix copyright header in gan.cHarald Welte2014-09-111-4/+4
| | | | | When I wrote the gan.c, I used the wrong copyright/license header (AGPLv3+ intead of GPLv2+). This was a mistake and is fixed hereby.
* add missing copyright statements to source code filesHarald Welte2014-09-111-0/+19
| | | | | | Some source code files didn't have the usual copyright and licence statement at their top. I'm adding them baesed on information in the commitlog.
* prepare for 0.7.0 releaseHarald Welte2014-08-211-1/+1
|
* gsm0808: Fix copy and paste pointed out by clangHolger Hans Peter Freyther2014-08-211-1/+1
| | | | | | | | | | | | | | | The element following the identifier list was the GSM0808_IE_LSA_INFORMATION. It is a TLV type as well and the issue got introduced in 92107dfd3b99ab0dbb0f4770286454ad94a36de2. Fixes: gsm0808.c:316:40: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] [GSM0808_IE_LSA_IDENTIFIER_LIST] = { TLV_TYPE_TLV }, ^~~~~~~~~~~~ gsm0808.c:315:40: note: previous initialization is here [GSM0808_IE_LSA_IDENTIFIER_LIST] = { TLV_TYPE_TLV },
* ipa: use %z as format string whne printing sizeof() resultHarald Welte2014-08-211-1/+1
| | | | thanks to Holger for reminding me
* ipa: fix compiler warning regarding printf (%d -> %lu)Harald Welte2014-08-211-1/+1
|
* ipa: rename functions for consistencyHarald Welte2014-08-203-24/+39
| | | | | | | | As we are breaking builds by moving functions from libosmo-abis to libosmocore anyway, we might as well give functions more appropriate names. ipaccess is a company, while IPA is the multiplex protocol, and CCM is the protocol used for establishing identities on the IPA multiplex.
* import various generic IPA related functions from libosmo-abisHarald Welte2014-08-202-1/+448
| | | | | | | | | libosmo-abis is about forming A-bis interfaces/lines by means of E1 or the IPA multiplex (or possibly other link layers). The IPA multiplex is used in other contexts, such as the Control interface, or the A interface. In that context, it makes sense to have generic IPA related functions in libosmocore.
* abis_nm: add abis_nm_msg_disc_names[] value_stringHarald Welte2014-08-172-0/+10
|
* abis_nm: introduce abis_nm_{osmo,ipa}_magic[]Harald Welte2014-08-172-0/+5
| | | | ... used to be oml_{osmo,ipa}_magic in osmo-bts
* update TS 08.08 header + TLV definitions to TS 48.008 / 11.7.0Harald Welte2014-06-211-16/+149
| | | | | | | | | | This adds support for A-over-IP and LCLS related message/IEI definitions. Old definitions are in decimal, which is very hard (at least for me) to compare with the binary tables in the spec. Hex is much easier to manually compare for completeness/correctness. I didn't touch the existing definitions, but think they should move to hex, too.
* gsm: Add Kasumi cipher implementationSylvain Munaut2014-06-162-1/+187
| | | | | Submitted-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* include: Switch to #pragma once patternSylvain Munaut2014-06-164-16/+4
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* gsm0411_smr: Fix the size of the arrayHolger Hans Peter Freyther2014-05-231-1/+1
| | | | | | | The code is lacking a "," at the end of a string and we ended up doing string concatination instead of having an invalid state. Fixes Coverity CID 1206564
* gsm0411_smr: Make the look-up table staticHolger Hans Peter Freyther2014-05-231-1/+1
|
* Fix introducing osmocom speficic OML attributesHarald Welte2014-05-192-0/+8
| | | | | | | | | | | | | | | | | | | Rename NM_ATT_O_REDUCEPOWER to NM_ATT_OSMO_REDUCEPOWER, which makes it more clear that this is an osmcoom specific attribute. Also, we cannot simply overload 0x01 as an already defined OML attribute. The problem is quite simple: When we use abis_nm_att_tlvdef during the TLV parse, 0x01 will match to NM_ATT_ABIS_CHANNEL, which is defined as { TLV_TYPE_FIXED, 3 }. So instead, we need to introduce a new abis_nm_osmo_att_tlvdef[], which has to be patched into abis_nm_att_tlvdef[] by the means of tlv_def_patch(), exactly how we do it for bs-11 and nanobts specific attributes. I'm using 0xfe for the attribute, as 0xfe doesn't overlap with the IPA specific attribues (and we might want to combine/merge the 12.21 plus IPA plus osmocom spefici attributes)