summaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm/protocol/gsm_04_08.h
Commit message (Collapse)AuthorAgeFilesLines
* gsm: gsm_04_08.h: Allow accessing classmark2 as struct instead of uint32_tPau Espin Pedrol2019-11-041-5/+28
| | | | | | | New fields are put inside a union to keep backward compatibility with potential older users of the struct. Change-Id: I235635800c0de47b1e2b9ec9c7191418f6003554
* gsm: Fix compilation error under some compilersPau Espin Pedrol2019-11-041-1/+2
| | | | | | | | | | | | | | Some compilers don't like declaration of enums in header files like we do sometimes for structs: enum gsm_band; void foobar(enum gsm_band band); triggers: error: use of enum 'gsm_band' without previous declaration Fixes: b99f4ca2d8517d99cdf8aa183dbfda7b233bb781 Related: OS#4244 Change-Id: I6c2102c763f565bbe3c8dd7e5b4e04c4a45fff67
* gsm_04_08.h: Introduce API osmo_gsm48_rfpowercap2powerclass()Pau Espin Pedrol2019-11-031-1/+2
| | | | | Related: OS#4244 Change-Id: I32e9cc1c2397b44f0d48db2acdf782a821365b63
* cosmetic: gsm_04_08.h: Fix trailing whitespacePau Espin Pedrol2019-11-011-3/+3
| | | | Change-Id: I4b34dbd5f0176d1d8aa8cc96f642ed35d4214b7e
* protocol/gsm_04_08.h: do not check if unsigned is positiveVadim Yanitskiy2019-06-121-3/+3
| | | | Change-Id: I6b486b52a3733d5fd5e8ba18acbc9374e2e8bd7e
* Revert "Change GSM48_PDISC_* to enum type"Harald Welte2019-05-181-20/+18
| | | | | | | This reverts commit ece1d8509d5c5af7a60ab5e1a5dddade1b181dc9 which causes build failures due to compile warnings everywhere. Change-Id: Ic131439ea206a0b0f57968ef701667da73711b51
* Change GSM48_PDISC_* to enum typeMax2019-05-171-18/+20
| | | | | | | | An enum is more clear than an int and #defines for passing around, also in case you have a switch () statement, the compiler will issue warnings for unhandled cases. Change-Id: Icbbe8786a776081d7643193f154e6270224399e6
* Add _c versions of functions that otherwise return static buffersHarald Welte2019-04-101-0/+2
| | | | | | | | | | | | | | We have a habit of returning static buffers from some functions, particularly when generating some kind of string values. This is convenient in terms of memory management, but it comes at the expense of not being thread-safe, and not allowing for two calls of the related function within one printf() statement. Let's introduce _c suffix versions of those functions where the caller passes in a talloc context from which the output buffer shall be allocated. Change-Id: I8481c19b68ff67cfa22abb93c405ebcfcb0ab19b
* Add _buf() functions to bypass static string buffersHarald Welte2019-04-031-0/+2
| | | | | | | | | | | | | | | We have a number of static buffers in use in libosmo*. This means the related functions are not usable in a thread-safe way. While we so far don't have many multi-threaded programs in the osmocom universe, the static buffers also prevent us from calling the same e.g. string-ify function twice within a single printf() call. Let's make sure there's an alternative function in all those cases, where the user can pass in a caller-allocated buffer + size, and make the 'classic' function with the static buffer a wrapper around that _buf() variant. Change-Id: Ibf85f79e93244f53b2684ff6f1095c5b41203e05
* Extend gsm_04_08.h with CSFB related definitiosn form 44.018 Rel 15Harald Welte2019-02-051-0/+2
| | | | | | These are some IEI definitions that we'll need for CSFB Fast Return Change-Id: I0e101af316438b56d63d43fc2cb16d7caf563d07
* add osmo_classmark_* APINeels Hofmeyr2019-01-291-0/+16
| | | | | | | | | osmo-bsc and osmo-msc implement identical Classmark structures. It makes sense to define once near the gsm48 protocol definitions. Also move along some generic Classmark API from osmo-msc. Change-Id: Ifd27bab0380f7ad0c44c719aa6c8bd62cf7b034c
* comments: update/fix three 3GPP spec referencesNeels Hofmeyr2019-01-141-1/+1
| | | | Change-Id: I3ab94f362866d752099000afe62922288b3dd118
* change GSM48_CMSERV_* to enum type, add namesNeels Hofmeyr2019-01-141-7/+14
| | | | | | | Prepare handling multiple CM Service Requests in osmo-msc: an enum is more clear than an int and #defines for passing around and count CM Service types. Change-Id: I9c2a7adc45ab7a1a7519168e965e7d805e1481ff
* add osmo_lu_type_names[], osmo_lu_type_name()Neels Hofmeyr2019-01-081-0/+4
| | | | | | Move lupd_names[] from osmo-msc to libosmo-gsm. Change-Id: Ica25919758ef6cba8348da199b0ae7e0ba628798
* add/clean big-endian packed structs (struct_endianess.py)Neels Hofmeyr2018-12-191-0/+389
| | | | | | | | | | | | | | This is 1:1 the result of doing cd libosmocore ./contrib/struct_endianess.py git commit -a Running struct_endianess.py again should result in no changes. That means we could include such a check in the gerrit verification job now. Change-Id: Ia0b99d76932aeb03e93bd0c62d3bf025dec5f9d2
* Add CC_CAUSE value_string arrayKeith2018-09-021-0/+4
| | | | | | | Adds a value_string array for GSM 04.08 Call Control cause values Change-Id: I296f208581ce2550805f9d96e20f7319e1199023
* gsm_04_08: add function to get value stringPhilipp Maier2018-07-121-0/+2
| | | | | | | The value string table gsm48_chan_mode_names[] lacks a function to get the value string by a value. Lets add one. Change-Id: I0757bcc278c140e18249e35864338e19cdaa3cf7
* Add enum gsm48_progress_descKeith2018-05-281-0/+12
| | | | | | | From GSM 04.08 Section 10.5.4.21 / Table 10.5.127 Change-Id: I6574e8808aaf39fad8026290aa2cc657734e18b5
* Add enum gsm48_cause_coding from GSM 04.08 Section 10.5.4.11Keith2018-05-261-0/+8
| | | | Change-Id: I3d9c8e117ad19f70a3273650d7c0f8280d7bdb9a
* protocol/gsm_04_08.h: drop incorrect GSM48_PDISC_USSDVadim Yanitskiy2018-04-171-1/+0
| | | | | | | | | | | | According to the GSM TS 04.07, section 11.2.3.1.1 "Protocol discriminator", bits 1 to 4 of the first octet of a standard L3 message contain the protocol discriminator IE. Meanwhile, the GSM48_PDISC_USSD represents value 0x11, i.e. 0b10001, that requires 5 bits, and moreover it is not documented anywhere. Let's drop it. Change-Id: Ic4eb8a6db4ff1dfd535bd0c84e7acf1908422f64
* add gsm48_reject_value_namesNeels Hofmeyr2018-04-091-0/+4
| | | | | | | | | | | | | | There seems to be quite some confusion / overlap between enum gsm48_reject_value, gsm48_gsm_cause and gsm48_gmm_cause. I tried to go with gsm48_gsm_cause_names[], but e.g. GSM48_REJECT_CONGESTION is not represented. Instead of attempting to mix/merge those enums, provide a separate value string array for enum gsm48_reject_value. This will be used by osmo-msc's libvlr (refactoring of FSM result handling), I27bf8d68737ff1f8dc6d11fb1eac3d391aab0cb1. Change-Id: I6661f139e68a498fb1bef10c266c2f064b72774a
* Add helper functions for ACC bit flags in rach control IE.Stefan Sperling2018-02-131-2/+43
| | | | | | | | | | Add inline functions to manipulate and query ACC flag bits in the rach_control.t2 and rach_control.t3 octets. These function definitions also serve as documentation of the purpose of rach_control.t2/t3. Change-Id: I8f0a65c2980f86eb5c43f3bebe727f4d4d973163 Related: OS#2591
* Add GSM 04.08 type-of-number / numbering-plan-id definitionsHarald Welte2018-02-091-0/+22
| | | | Change-Id: Idd8d8a7a1c7f0b6cb9318e4f19ebadb415df2ed1
* gsm48_hdr_msg_type(): SS is in the same group as MM/CCHarald Welte2018-02-031-1/+1
| | | | Change-Id: I1ddadeacced9650885f454b81f3f0df531ea1e5d
* gsm48_hdr_msg_type[_r99]: Fix bit-masksHarald Welte2018-02-031-2/+2
| | | | | | | | | | TS 24.007 is quite clear: The upper two bits of the message type octet are *not* part of the message type in any of the L3 protocols which implement sequence numbers. it doesn't matter if it's R98 or R99, or whether the sequence number is 1bit or 2bits wide. Related: OS#2908 Change-Id: Iec875a77f5458322dfbef174f5abfc0e8c09d464
* gsm_04_08.h: Reduce T310 default to 30s.Harald Welte2018-01-271-1/+1
| | | | | | | | | 3GPP doesn't specify a network-side T310 default, but waiting for 180s (3 minutes!) for the next message after CALL CONFIRMED is clearly way too long and will just use radio resources for no good reason. Change-Id: Ia52f9358bc86b23c72af9c80e2fff5cb0004b57a Related: OS#2884
* gsm_04_08.h: Clearly annotate timers that don't have a 3GPP Default valueHarald Welte2018-01-271-7/+7
| | | | Change-Id: I44fffaec1f7c0d819aa2ebc85e97f19581fc689c
* Fix incorrect spec referenceMax2018-01-041-1/+1
| | | | | | RAI is defined in 3GPP TS 24.008 § 10.5.5.15 Change-Id: I484485d8c4c56b58dfecc1193bcdd48e61957422
* gsm_04_08.h: Add struct for 9.1.13b GPRS suspension requestHarald Welte2017-07-101-0/+8
| | | | Change-Id: I90113044460a6c511ced14f588876c4280d1cac7
* doxygen: unify use of \file across the boardNeels Hofmeyr2017-06-231-1/+3
| | | | | | | | | | | | | | | | | Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
* doxygen: enable AUTOBRIEF, drop \briefNeels Hofmeyr2017-06-231-2/+2
| | | | | | | | | | Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
* gsm0408: update bearer capability speech versionPhilipp Maier2017-06-211-1/+6
| | | | | | | | 3GPP TS 24.008 specifies two new speech versions for half rate and two new speech modes for full rate. This patch adds the relevant constants to enum gsm48_bcap_speech_ver in gsm_04_08.h Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549
* cosmetic: Add codec references to Speech Version IndicationPhilipp Maier2017-06-211-6/+6
| | | | | | | Add the information which GSM Speech codec version coresponds to which bearer capability speech version. Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967
* Update L3 protocol discriminator definitionsHarald Welte2017-06-091-3/+5
| | | | Change-Id: Ia699d3494b93b7f88c36338e4960b35c42a29b9c
* add gsm48_pdisc_msgtype_name()Neels Hofmeyr2017-03-161-0/+5
| | | | | | | | | | | | | | | Composing the message type string requires knowing the protocol discriminator. To ease printing the message type, add this function to switch between the defined value_string[]s depending on pdisc. Also publish the message type value_string[]s -- without inline functions to access them because it is anyway more convenient to use gsm48_pdisc_msgtype_name() instead. Since gsm48_pdisc_msgtype_name() is nontrivial, do not add as inline function -- in case the message type is not known, it needs a static string buffer. Change-Id: I0fca8e95ed5c2148b1a7440eff3fc9c7583898df
* add gsm48_pdisc_names and gsm48_pdisc_name()Neels Hofmeyr2017-03-161-0/+4
| | | | | | | I often want to log the protocol discriminator in the openbsc debug log. It's more useful to get the name directly instead of looking it up every time. Change-Id: I0f053e2a4360b27ffccda7cf82469fb1b1cbb3ae
* gsm_04_08: add _NUM_CHREQ_T to enumAlexander Couzens2017-03-141-0/+1
| | | | | | _NUM_CHREQ_T defines the last element of the enum Change-Id: Id67ba8de89dd6288e449197438e9e1c5d7f5a134
* gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and CHREQ_T_PDCH_TWO_PHASEAlexander Couzens2017-03-141-0/+2
| | | | | | | | | | The previous version of this commit got reverted to avoid a breakage in openbsc. The problem is openbsc use an array of chreq_type with a manual defined size. This array is using enums as index which breaks if any elements got added into the middle, because the size of the array can't hold elements greater or equal than the size. Change-Id: I6676105507fe4e5627f740dfe4c2770f766ad068
* gsm_04_08.h: add R99 MSCR and CBQ3 to SI3 Ctrl Chan DescrNeels Hofmeyr2017-02-231-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 10.5.2.11.1 which is right there in the named Section 10.5.2.11, 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
* gsm48: add UMTS AKA res+sync IEIs, msg type and cause valNeels Hofmeyr2017-02-021-0/+4
| | | | | | According to 3GPP TS 24.008 9.2.3a, 9.2.3, 10.5.3.6 Change-Id: I745061ce8eb88aa23080dadcdbfe2d703c362a30
* Revert "gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and ↵Neels Hofmeyr2016-12-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | CHREQ_T_PDCH_TWO_PHASE" This reverts commit c3c28528de78fd5d50c3a141c2176c0da5dd7075. The reason is that this breaks a static assert in openbsc. See https://lists.osmocom.org/pipermail/openbsc/2016-December/009906.html Enlarging the ctype_by_chreq struct and breaks the static assert for gsm_network->ctype_by_chreq's size: ../../../src/libbsc/gsm_04_08_utils.c:138:1: error: size of array ‘dummyassert_size’ is negative osmo_static_assert(sizeof(ctype_by_chreq) == ^ What this patch lacks is, in openbsc.git: * adjustment of ctype_by_chreq[] according to the new additions in libbsc/gsm_04_08_utils.c * same for reason_by_chreq[], also in libbsc/gsm_04_08_utils.c * enlarge ctype_by_chreq[] in gsm_network to 18, in openbsc/gsm_data.h. Leaving it up to the original authors to follow up and commit a complete patch series in one go.
* gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and CHREQ_T_PDCH_TWO_PHASEAlexander Couzens2016-12-011-0/+2
| | | | | | For BSC-located pcu the BSC must understand the PDCH chan request. Change-Id: Ice44dcaaf798f93af3652a96c567f8e16a6cf784
* gsm0408: Completing GSM 04.08 RR message typesPhilipp2016-10-271-2/+13
| | | | | | | | | | | - 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
* gsm0408: Adding 3g spcific RR message typesPhilipp2016-10-121-0/+5
| | | | | | | | | | GSM 04.18, which is the successor of GSM 04.08, describes additional RR 3g specific message types. This commit adds four new message types related to paging and notifiction See also 3GPP TS 04.18, section 10.4, table 10.4.1 Change-Id: I071cc9ecac342b5221fa0ec0b782b04b51b40e93
* Add define for invalid TAMax2016-07-231-0/+2
| | | | | | | | Add GSM48_TA_INVALID which is invalid Timing Advance value according to 3GPP TS 44.018 § 10.5.2.40. Change-Id: I061760ccac656f39164562a7883f8ab522cd0911 Related: OS#1526
* Add function to check TA validityMax2016-07-161-0/+10
| | | | | | | | Check if given Timing Advance is valid according to 3GPP TS 44.018 § 10.5.2.40. Change-Id: I5cb6149d6e36fda8cb3f557e4d6d3a724da805a5 Related: OS#1545
* Add function to check GMM encryptabilityMax2016-07-071-1/+2
| | | | | | | | 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 UMTS AKA related MM/GMM message type and IE definitionsHarald Welte2016-06-161-0/+1
| | | | | | | Change-Id: Id45ea2c631ee589a4df1f8213da6f7e7d1bf6616 Reviewed-on: https://gerrit.osmocom.org/305 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
* Patched structs for big-endian architecturesRuben Undheim2016-05-311-0/+160
| | | | | | | | Change-Id: I29eafe481e112d18c624b1c83add0d53c354dbe4 Reviewed-on: https://gerrit.osmocom.org/124 Tested-by: Jenkins Builder Reviewed-by: Neels Hofmeyr <nhofmeyr@sysmocom.de> Reviewed-by: Harald Welte <laforge@gnumonks.org>
* Set DTX in Cell OptionsMax2016-05-121-1/+14
| | | | | | | | | | | | * rename field of struct gsm48_cell_options to better match the spec * add comments with spec references * add function for setting DTX in cell options struct * add necessary enum type Change-Id: I5a8924f57669c951b2e51b663d95f1d360062a54 Reviewed-on: https://gerrit.osmocom.org/39 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder