aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm
AgeCommit message (Collapse)AuthorFilesLines
2018-11-22Update gsm0808_create_ass() doxygenMax1-2/+2
* add spec reference * remove LCLS note: CI parameter is optional but have nothing to do with LCLS It's pretty hard to decipher from the spec what CI is useful for and we have not used it anyway so let's just keep it as "Optional" for now. Change-Id: I5552732afcec48047d993ae6ffb73a3e5d7c9202
2018-11-20gsm: Deprecate buggy gsm_arfcn2band API and introduce gsm_arfcn2band_rcPau Espin Pedrol2-23/+49
ARFCNs are values in well defined ranges. Until this patch, ARFCNs not belonging to any band were blindly assigned to DCS1800 by gsm_arfcn2band, causing unnoticed bugs and misconfigurations in osmo-bsc. Previous API gsm_arfcn2band cannot accomodate this kind of check easily, so let's deprecate it to tell people to use a new API gsm_arfcn2band_rc which performs this kind of checks and allows callers to log failures, misconfigurations, etc. At the same time, modify implementation of gsm_arfcn2band to abort if an invalid ARFCN is passed, this way users of this API can notice they are passing wrong data to it that most probably will produce unexpected results. Related: OS#3063 Change-Id: I780d452dcebce385469e32ef2fd844df6033393a
2018-11-19Support cipher mode reject with extended causeMax3-0/+42
* add function to generate cipher mode reject with extended (2-byte) Cause IE * add function to get (extended) Cause value * add corresponding (extended cause) test * update existing (non-extended cause) test * use enum as a parameter for existing non-extended version to make interface more unified Change-Id: Id5509b94a18180a44f45300caaa02b843c166fa3 Related: OS#3187
2018-11-19Move msgb_push helpers to public headerMax1-39/+10
The msgb_wrap_with_TL() is generally useful so it make sense to make it public to facilitate code re-use. Other helpers can be implemented as trivial wrappers over existing tlv.h functions. Update headers and code accordingly. Change-Id: I37e91d031fba28cf1c6735b8069b0265746f55e6
2018-11-18gsm48: gsm48_decode_freq_list: Improve documentation of paramter fPau Espin Pedrol1-1/+1
Change-Id: Id8e3afff737211ded3c5689f2c83b1a544b42f9d
2018-11-18Update GSM0808_LCLS enumsMax1-0/+3
Add values indicating that LCLS control/config/status value has not been received yet. Change-Id: I52dc6a52f5ee043ed2c1625ffecfd495e3c746b1 Related: OS#2487
2018-11-18Update 3GPP TS 08.08 Cause handlingMax2-6/+25
* add Class definitions * add helper to check for extended bit * add helper to get Cause's Class * use enum in gsm0808_cause_name() and gsm0808_create_cipher_reject() to avoid confusion between class and cause * update gsm0808_create_cipher_reject() comments Change-Id: I31b31dfc22eb4b6b07089e1255246ac458125340 Related: OS#3187
2018-11-16gsm29118: add value strings for SGSAP IEIPhilipp Maier2-0/+36
The value strings for the SGSAP IEI are missing, lets add a set of value strings and a function to retrieve them. Change-Id: I2787303174f74ffba86675bce2c12f680d8ea708 Related: OS#3615
2018-11-02gsm48: correct apidoc for gsm48_generate_mid()Philipp Maier1-0/+1
The API documentation lacks the the description for the last parameter, lets add a description for it. Change-Id: Ibcd25d3a7ddd7075eb15daff6dba42236d14d945
2018-11-02Update cipher reject functionMax1-0/+1
* add note about (yet) unsupported standard feature * use enum constant instead of hex value Change-Id: I5cc5fc1ae8d5474dbc8d3385a493adf6420a3c98 Related: OS#3187
2018-10-30gsm0808: cosmetic: rename parameter "reason" to "cause"Philipp Maier1-3/+3
The function that generates the clear command takes a parameter "reason", which is the cause code. Lets give it the name "cause" to have a coherent naming scheme that matches the other functions and the 3gpp specs. Change-Id: I7b6c15e8fa8db13deef5041095944ca1c58fb99f
2018-10-30gsm0808: fix doxygen apidocPhilipp Maier1-1/+1
The api documentation names a parametery by a different name than it is listed in the parameter list of the function. Lets make the apidoc coherent. Change-Id: Id21ed1e920fb64522a734f206efbe2871ec05b06
2018-10-28gsm23003: Add MME domain name related helper functionsHarald Welte2-0/+92
osmo_gen_mme_group_domain(), osmo_gen_mme_group_domain() and osmo_gen_home_network_domain() Change-Id: Ia882d9db05ec0037e593aeebea21bc31adb680bb
2018-10-21libosmogsm/gsup.c: fix error code in osmo_gsup_encode()Vadim Yanitskiy1-1/+1
Missing (unset) type of to be encoded message is not a memory allocation failure (-ENOMEM), this is definitely a mistake. Change-Id: Ibbac18e2b68b765c17c2bc959c4c085037953a7f
2018-10-21SGsAP protocol definitions (header + C file)Harald Welte3-1/+134
Change-Id: Idddfc9b851eb4c2fa7dd661a9ce1b03a04883109
2018-10-16gsm0808: allow decoding of zero length speech codec lists.Philipp Maier1-10/+0
3GPP_TS_48.008, 3.2.2.103 Speech Codec List states the following: "The length indicator (octet 2) is a binary number indicating the absolute length of the contents after the length indicator. The length depends on the number and type of Speech Codec Elements to be included. The minimum length of one Speech Codec Element is 1 octet and the maximum length is 3 octets. The maximum number of Speech Codec Elements within the Speech Codec List is not defined." This clearly refers only to the length of a single speech codec element but not on the overall list. So speech codec lists with length 0 are indeed permitted by the spec. - Remove the assertion that checks on zero length speech codec lists. Change-Id: I1eb1f4466b98bdd26d765b0e4cc690b5e89e9dd6 Related: OS#3657
2018-09-25gsm0808: add function to convert AMR S15-S0 to gsm0408 settingsPhilipp Maier2-0/+42
Add a function to convert S0-S15 bits to struct gsm48_multi_rate_conf, which hold the codec settings for AMR. Change-Id: I973736273c236eee84decf15868190e339c3fed4 Related: OS#3548
2018-09-21gsm0808_utils: constify parameterPhilipp Maier1-1/+1
parameter cfg in gsm0808_sc_cfg_from_gsm48_mr_cfg() is used read only. Lets add a const to make this clear to the compiler. Change-Id: I31e8d273b070b0afc446a298299d4f502d6c396b
2018-09-19gsm0808: add function to convert amr gsm0408 setings to gsm0808Philipp Maier2-0/+44
Add a function to convert struct gsm48_multi_rate_conf, which holds the codec settings for AMR, to S0-S15 bit representation as defined in 3GPP TS 48.008 3.2.2.49 This resurrects change-id I4e656731b16621736c7a2f4e64d9ce63b1064e98 which was reverted in I9e0d405e303ed86d23703ca6362e958dddb2f861 due to gsm0808_test failing. The test failure is fixed by properly clearing the struct gsm48_multirate_cfg prior to running tests (add memset(0)). Change-Id: Ia782e21c206c15e840226d79b4209d13658ee916 Related: OS#3548
2018-09-16Revert "gsm0808: add function to convert amr gsm0408 setings to gsm0808"Neels Hofmeyr2-44/+0
This reverts commit 2fd4fe6aa109c8df50baac465f0393a303a64dd2. As shown in https://jenkins.osmocom.org/jenkins/view/master/job/master-libosmocore/475/a2=default,a3=default,arch=amd64,label=osmocom-master-debian9/console This commit breaks gsm0808_test with: stderr: --- expout 2018-09-16 22:37:31.382280438 +0200 +++ /n/s/dev/make/libosmocore/tests/testsuite.dir/at-groups/21/stdout 2018-09-16 22:37:31.426281372 +0200 @@ -78,9 +78,9 @@ Input: m4_75= 0 smod= 0 m5_15= 0 spare= 0 - m5_90= 0 icmi= 0 + m5_90= 0 icmi= 1 m6_70= 0 nscb= 0 - m7_40= 0 ver= 0 + m7_40= 0 ver= 6 m7_95= 0 m10_2= 0 m12_2= 0 @@ -92,9 +92,9 @@ Input: m4_75= 1 smod= 0 m5_15= 0 spare= 0 - m5_90= 0 icmi= 0 + m5_90= 0 icmi= 1 m6_70= 0 nscb= 0 - m7_40= 0 ver= 0 + m7_40= 0 ver= 6 m7_95= 0 m10_2= 0 m12_2= 0 @@ -106,9 +106,9 @@ Input: m4_75= 0 smod= 0 m5_15= 1 spare= 0 - m5_90= 0 icmi= 0 + m5_90= 0 icmi= 1 [...] Change-Id: I9e0d405e303ed86d23703ca6362e958dddb2f861
2018-09-14gsm0808: add function to convert amr gsm0408 setings to gsm0808Philipp Maier2-0/+44
Add a function to convert struct gsm48_multi_rate_conf, which holds the codec settings for AMR, to S0-S15 bit representation as defined in 3GPP TS 48.008 3.2.2.49 Change-Id: I4e656731b16621736c7a2f4e64d9ce63b1064e98 Related: OS#3548
2018-09-13gsm0808: implement BSSMAP Classmark RequestNeels Hofmeyr2-0/+14
Related: OS#3043 Change-Id: I4a2e1d3923e33912579c4180aa1ff8e8f5abb7e7
2018-09-02Add CC_CAUSE value_string arrayKeith2-0/+55
Adds a value_string array for GSM 04.08 Call Control cause values Change-Id: I296f208581ce2550805f9d96e20f7319e1199023
2018-08-29properly handle mandatory cli param of gsm0808_create_paging2Stefan Sperling1-5/+4
The cell identifier list parameter is mandatory. Document it as such, and tweak code which treated it like an optional parameter. No functional change. The existing code already asserts that a non-NULL value is passed for this parameter. Change-Id: I3716f9d5b210e0a7e6f45c9fe3fc34024e5234ad Related: OS#3021
2018-08-28gsm0808: inter-bsc HO messages: add missing BSSMAP header, x4Neels Hofmeyr1-0/+12
Change-Id: I9e128ba775227de5e4010f024338a78584f777ea
2018-08-22ipa: Document ipa_msg_recv* functionsPau Espin Pedrol1-0/+22
Change-Id: Ie81e9dd9f9936a414e7cebb2bccffa6f42a302a7
2018-08-05libosmogsm: (re)introduce gsm48_push_l3hdr()Vadim Yanitskiy4-21/+38
There was gsm0480_l3hdr_push() declared in a header file, but not exposed in 'libosmogsm.map'. Furthermore, for some reason it was a part of GSM 04.80 API, what is not actually correct. Let's rename this symbol, and properly expose it as a part of the GSM 04.08 API. Also, let's introduce an auxiliary wrapper for messages, where the transaction identifier is required (see GSM 04.07, section 11.2.3.1.2). Change-Id: I8a045efe8335d83fcbe8d43eb180972e3b1d9dda
2018-08-05gsm/gsm0480.c: use the local msgb allocatorVadim Yanitskiy1-3/+3
Change-Id: I23b4b0e1c237b9b27c1db1c9a824b5329d41a38b
2018-08-05gsm/gsm0480.c: prevent NULL-pointer dereferenceVadim Yanitskiy1-2/+10
Change-Id: I444d95941837458b46e581298f76f3a9926c8552
2018-08-04comp128v23 (minor): update original code site and authorKévin Redon1-2/+4
I was contacted by the (previously unknown) author who provided the new location of the original code. Change-Id: I2dabab20ad018ce473817986bdb250131c010bf1
2018-08-01re-introduce ipa_ccm_idtag_parse_off()Harald Welte2-3/+14
In the previous commit we deprecated ipa_ccm_idtag_parse() but also removed ipa_ccm_idtag_parse_off(), for which I couldn't find any users. However, legacy openbsc.git still uses this function, so let's re-introiduce it in its original form. Change-Id: Ibfe53b04340eb355c8bfb8453a2af1522a4b6baf
2018-08-01Deprecate ipa_ccm_idtag_parse() with ipa_ccm_id_{get,resp}_parse()Harald Welte2-9/+77
In the past, the function ipa_ccm_idtag_parse() was used to parse the payload of IPA CCM ID RESP packets. However, the function was based on a possible misunderstanding of the message encoding, and callers actually counted the first (upper) length nibble as part of the header and passed a pointer to the second (lower) length nibble of the first TLV into this function. As such, it was unfixable, and had to be replaced with a new function called ipa_ccm_id_resp_parse(). At the same time, we also add ipa_ccm_id_get_parse() to parse the slightly different format of the IPA CCM ID GET payload. We can never be 100% sure what is "correct", as our understanding of the protocol is entirely based on protocol analysis, without any official documentation available. This patch also introduces unit test coverage for both of the new functions. Revert "ipa: Add libosmogsm.map entry for ipa_ccm_idtag_parse_off" This reverts commit 7f31c90b80c08fbfe2d84d70d397402fdb38b94c. Revert "ipa: Properly parse LV stream of a ID_GET request" This reverts commit f558ed4bb9c0f00997b8f97c2b251a574c1a64c4. It introduced a function/behavior that was not originally intended: The parse of IPA CCM ID GET (8bit length followed by 1 byte tag and variable-length payload) instead of the IPA CCM ID RESP (16bit length followed by 1 byte tag and variable-length payload). Change-Id: I1834d90fbcdbfcb05f5b8cfe39bfe9543737ef8f
2018-07-30oap_client: Rename symbols with osmo_ prefixHarald Welte2-27/+27
As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: Ie36729996abd30b84d1c30a09f62ebc6a9794950
2018-07-30import oap_client into libosmogsmHarald Welte3-1/+286
This imports the code from osmo-msc 6afef893e17bce67e4d4119acd34d480ed03ba77 with minimal changes to make it compile. Symbol renaming to osmo_ prefix is done separately in a follow-up patch to have a as-clean-as-possible import first. Change-Id: I9bc38102318da02d1fe46ef516df3cfd6bf8e3da
2018-07-2904.80: New gsm0480_gen_{reject,return_error}() functionsHarald Welte2-0/+66
Add functions to generate TS 04.80 (supplementary services) Reject and ReturnError components. Change-Id: I6e5ee39c3d03364f7833ec717593d5ddb0a4c5f9
2018-07-29USSD: Introduce gsm0480_gen_ussd_resp_7bit()Harald Welte2-1/+23
Contrary to the existing gsm0480_create_ussd_resp(), the new function only generates the value part of the FACILITY IE, and not the IE Tag/Length or the 04.08 L3 header. This is needed in the context of GSUP-encapsulated USSD, as here we don't work with L3 messages, but only pass on the FACILITY IE value. Change-Id: Ide240279240322f643e142229eb7829f538c6314
2018-07-29gsm0480: Factor out msgb allocation helper functionHarald Welte2-1/+7
Change-Id: If25b467481023eadaaf3f78157eceff4b81d24d2
2018-07-27fix strncpy bugs in gsm/ipa.cNeels Hofmeyr1-7/+6
Change-Id: I423a24c55c9b9aa6fc8f501df94fe54c71ee2b2b
2018-07-27Bump version: 0.11.0.91-9d4a3-dirty → 0.12.00.12.0Pau Espin Pedrol1-1/+1
Change-Id: I7e66432f37e13fd4c31389e3d89593fa0981e58f
2018-07-12gsm0808: Add value_string for encryption algorithmsPau Espin Pedrol2-0/+13
Change-Id: Iadf6460c438d02c53c2eaa9e42d51844ad28859a
2018-07-12gsm_08_08: gsm0808_permitted_speech does not have value stringsPhilipp Maier2-0/+15
enum gsm0808_permitted_speech does not have any value strings. Lets add value strings to make debugging easier. Change-Id: I5b5612a5df2758b0137a34c17f7c8c2b3f07c806
2018-07-02Don't enforce Python 2 for utilitiesVadim Yanitskiy1-1/+1
The conv_gen.py utility was tested against both Python 2 and 3, so there is no need to enforce Python 2. Also, having: #!/usr/local/bin/python{2|3} is a bad idea, because Python may be installed in a different location. Change-Id: I6007d481047b584db13d6eda70fb99f11f9ddaa1
2018-06-28Don't call abort() directly, always use osmo_panic()Harald Welte1-1/+1
A loooong time ago, we introduced osmo_panic() as a wrapper around abort(). The advantage is, that this wrapper can be overridden, and that it will also work in embedded (bare iron) targets, where the abort simply translates to an infinite loop. Change-Id: I5a70eb65952cbc329bf96eacb428b07a9da32433
2018-06-18add and tweak inter-BSC HO APINeels Hofmeyr2-2/+87
Add: gsm0808_create_handover_detect() gsm0808_create_handover_complete() gsm0808_create_handover_failure() To existing structs gsm0808_old_bss_to_new_bss_info and gsm0808_handover_required, add a final 'more_items' flag that makes future extensions API and ABI compatible. Fix the msgb string for Handover Request Ack. Extend some API doc comments. Related: OS#2283 (inter-BSC Handover, BSC side, MT) Change-Id: I03ee7ce840ecfa0b6a33358e7385528aabd4873f
2018-06-18gsm: lapdm.c: Add missing new line char in notice log stringPau Espin Pedrol1-1/+1
Change-Id: I92c78ea01570dc1f4be11b113c07f0aa3b342c8f
2018-06-16gsm 04.80: Add value_string for component type and op codeHarald Welte2-0/+34
Change-Id: I2615a88db5224d65f37c7cc505e183ec8b196e8a
2018-06-16gsup: Add value_string for Session State IEHarald Welte2-0/+9
In Change-Id I1cee271fed0284a134ffed103c0d4bebbcfde2a8 we added support for a new session state IE, but we didn't add any value_string array for string conversion of it. Let's fix this. Change-Id: I3d9f087786dc37c42498fa9a2be07483ec93ba7b
2018-06-11gsup: Add osmo_gsup_get_err_msg_type() functionHarald Welte2-0/+24
This function can be used to resolve the error message type for a given message type. Can be used by generic error handlers that work for any incoming message type. Change-Id: Ic637bec53dd7fe3ec83da99b49b4eae34d5602b2
2018-06-11gsm/gsm0480: refactor and expose gsm0480_parse_facility_ie()Vadim Yanitskiy2-16/+31
This function can be used when there is only a part of GSM 04.80 message available - Facility IE, e.g. when a message is carried over GSUP/MAP. Let's expose it. Refactoring includes the following: - adding the 'gsm0480_' prefix; - correcting inverted return value; - cosmetic code style changes. Change-Id: I623c39ffbe6cdee65eade8435a2faa04d0da193e
2018-06-11gsm/gsm0480.c: introduce gsm0480_extract_ie_by_tag()Vadim Yanitskiy2-0/+89
In some cases, there is no need to parse the whole message, e.g. during the conversion from DTAP to GSUP/MAP. This function can be used to extract given IE from a message. Change-Id: I3989d061903352473305f80712f1a1560d05df3d