aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm
AgeCommit message (Collapse)AuthorFilesLines
2015-11-02fix some typosNeels Hofmeyr1-2/+2
Sponsored-by: On-Waves ehi
2015-09-16build: have a disable-static build succeedJan Engelhardt1-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.
2015-08-18Introduce gsm48_mi_type_name() functionHarald Welte2-0/+15
2015-08-18Add G-RNTI derived TLLI types defined in 23.003Harald Welte1-1/+5
2015-06-04ipa: Add libosmogsm.map entry for ipa_ccm_idtag_parse_offJacob Erlbeck1-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
2015-06-02ipa: Properly parse LV stream of a ID_GET requestHolger Hans Peter Freyther1-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.
2015-05-25Add APN utility function to libosmogsmHarald Welte3-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.
2015-04-10msgb: Check the return value of msgb_alloc (Coverity)Jacob Erlbeck1-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
2015-03-28gsm: Add A5/3-4 cipher supportMax1-3/+68
Signed-off-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-03-18gsm0808: Remove duplicate initializationHolger Hans Peter Freyther1-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 }, ^~~~~~~~~~~~
2015-01-01Supplementary Services (de)activation, interrogation addedTobias Engel2-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.
2014-12-30fixupHarald Welte1-0/+4
2014-12-29add gsm0341_test to generate SMSCB hex stringsHarald Welte3-1/+59
Those hex strings can then be copy+pasted into the OSmoNITB VTY
2014-12-28libosmo-gsm: Add PCHAN/LCHAN types for CBCHHarald Welte1-0/+2
2014-12-22ipa: Return -errno instead of -1 in ipa_sendJacob Erlbeck1-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
2014-12-04fix libosmocore build for NuttX targetHarald Welte1-0/+5
this fixes some compilation issues with libosmocore under NuttX, particularly as some #defines are missing or some header files are slightly different.
2014-10-26Change copyright notice of ipa.c to GPLv2+Harald Welte1-4/+4
... which it should have been all along.
2014-10-26Change license of gsm0411_smc/smr to GPLv2+Harald Welte3-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.
2014-10-03build: remove unused all_includes and use AM_CPPFLAGSJan Engelhardt1-1/+2
Preprocessor flags are best placed in AM_CPPFLAGS. Remove use of the unused all_includes variable, which is never set.
2014-09-25misc: Look into the build directory for generated filesHolger Hans Peter Freyther1-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.
2014-09-11Fix copyright header in gan.cHarald Welte1-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.
2014-09-11add missing copyright statements to source code filesHarald Welte1-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.
2014-08-21prepare for 0.7.0 release0.7.0Harald Welte1-1/+1
2014-08-21gsm0808: Fix copy and paste pointed out by clangHolger Hans Peter Freyther1-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 },
2014-08-21ipa: use %z as format string whne printing sizeof() resultHarald Welte1-1/+1
thanks to Holger for reminding me
2014-08-21ipa: fix compiler warning regarding printf (%d -> %lu)Harald Welte1-1/+1
2014-08-20ipa: rename functions for consistencyHarald Welte3-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.
2014-08-20import various generic IPA related functions from libosmo-abisHarald Welte2-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.
2014-08-17abis_nm: add abis_nm_msg_disc_names[] value_stringHarald Welte2-0/+10
2014-08-17abis_nm: introduce abis_nm_{osmo,ipa}_magic[]Harald Welte2-0/+5
... used to be oml_{osmo,ipa}_magic in osmo-bts
2014-06-21update TS 08.08 header + TLV definitions to TS 48.008 / 11.7.0Harald Welte1-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.
2014-06-16gsm: Add Kasumi cipher implementationSylvain Munaut2-1/+187
Submitted-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-16include: Switch to #pragma once patternSylvain Munaut4-16/+4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-05-23gsm0411_smr: Fix the size of the arrayHolger Hans Peter Freyther1-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
2014-05-23gsm0411_smr: Make the look-up table staticHolger Hans Peter Freyther1-1/+1
2014-05-19Fix introducing osmocom speficic OML attributesHarald Welte2-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)
2014-03-31Release: Prepare the release of 0.6.60.6.6Holger Hans Peter Freyther1-1/+1
2014-03-26sms: Add missing brackets in the relative validity time calculation.Alexander Chemeris1-3/+3
2014-03-26gsm/lapdm: Prevent LAPD tx_queue from filling up in polling modeDaniel Willmann2-0/+27
If LAPDm receives an I-Frame while there already is an I-Frame in the tx_queue the code generates an additional RR (to acknowledge the received I-Frame). Instead, N(R) of the I-Frame in the tx_queue should be updated to ACK the data.
2014-03-26lapdm: Make lapdm_datalink_for_sapi publicDaniel Willmann2-3/+4
This API allows you to get the lapdm_datalink for a SAPI. It's needed in the lapdm_test, so make it public.
2014-03-16lapd: Improve log message and mention the SAPI the dl is onHolger Hans Peter Freyther1-2/+2
When debugging an issue that involves SAPI=0 and SAPI=3 the log file does not have enough context. Add the SAPI to this message so we at least understand which SAPI we are talking about.
2014-03-10ladpm: Fix msgb handling and SAPI=3 establishment delayJacob Erlbeck1-27/+14
Currently it takes 3s to establish a SAPI 3 SACCH connection with osmo-bts. This is due to the fact, that a broken SABME request is sent first and and is ignored by the MS. Then, after a T200 timeout (2s) the SABME command is sent again (this time correctly) and answered by the MS. The first SABME message is broken (it has a length field of 3 and ends with 3 bytes from the tail of the original RSL message), because of it is expected throughout lapdm.c that msg buffers containing RSL have msg->l2h == msg->data. Some abis input drivers fulfill this but IPA doesn't, thus the 3 bytes of the IPA header are still part of the msg and confuse length computation. Since internal fields of the msg are modified directly, this is difficult to see. This patch adds a new function msgb_pull_to_l3() that explicitely skips over all headers prepending L3 and therefore resets l1h and l2h. This function is then used instead of msgb_pull_l2h() which only worked correctly when msg->l2h == msg->data. In addition, code manipulating msg->tail and msg->len directly has been replaced by calls to msgb_trim(). Note that this patch does not fix all issues of this case in the LADP related code. Ticket: SYS#192 Sponsored-by: On-Waves ehf
2014-02-09lapd: Use the right struct for the talloc_zero_array callHolger Hans Peter Freyther1-2/+2
I saw this while playing with talloc pools and wondered why lapd_core is creating a log_info. Use the right struct for the array.
2014-02-08sms: The msg_ref is passed from the outside so remove the wrong fixmeHolger Hans Peter Freyther1-1/+1
2014-01-23lapdm: Fix typo in the commentHolger Hans Peter Freyther1-1/+1
2014-01-13gsm/gsm48ie: Fix range 256 W[i] decoding0.6.5Jacob Erlbeck1-4/+4
Currently w[14]/w[15] and w[18]/w[19] are swapped in range 256 format decoding in gsm48_decode_freq_list(). This patch fixes this. Sponsored-by: On-Waves ehf
2014-01-09sms: Fix gsm_7bit legacy functions return valueJacob Erlbeck1-6/+11
The legacy 7bit conversion functions (those without the '_n_' in the name) gave wrong return values on 64 bit platforms due to unproper signed/unsigned conversions and the usage of SIZE_MAX. This patch fixes this by using a smaller max size (see GSM_7BIT_LEGACY_MAX_BUFFER_SIZE, currently set to 64k) for the legacy wrappers and by using unsigned int for max_septets. In addition, there are tests now that check the return values of legacy encoding and decoding. Sponsored-by: On-Waves ehf
2014-01-02abis: Use the right return value for abis_nm_pchan4chcombHolger Hans Peter Freyther1-1/+1
abis_nm_pchan4chcomb will return a pchan for a given channel combination but returned a value of the channel combination. Fix it to return the physical channel combination. Fixes: Coverity CID 1040767
2013-12-07Refactor COMP128v23 implementation and add test suitMax2-38/+29
2013-11-03implement COMP128 version 2 and 3 A3/A8 algorithmKevin Redon3-5/+240
simple copy into C from reversed code from www.hackingprojects.net