summaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm/protocol
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
* API doc tweaks (mncc.h, gsm_08_08.h)Neels Hofmeyr2019-10-041-1/+3
| | | | Change-Id: I9b4c7e737c83c65e358496e4540c14be5abc5474
* gsm_08_58: Add vendor-specific Message Type for ETWS Primary WarningHarald Welte2019-09-051-0/+2
| | | | | Change-Id: I36fc2ffc22728887d1cb8768c7fcd9739a8ec0fc Related: OS#4046, OS#4047
* Add Cell Broadcast related definitions from 3GPP TS 23.041Harald Welte2019-07-201-0/+89
| | | | Change-Id: I1e2c62cb9047648907c91b99f764f6caba8f4493
* CBSP (Cell Broadcast Service Protocol; 3GPP TS 48.049) supportHarald Welte2019-07-201-0/+128
| | | | | | | | | | This introduces definitions as well as a parser+encoder for the Cell Broadcast Service Protocol (CBSP) as specified in 3GPP TS 48.049. CBSP is used on the interface between CBC and BSC. Related: OS#3537 Change-Id: I5b7ae08f67e415967b60ac4b824db9e22ca00935
* add define for magic tmsi constantEric Wild2019-06-171-0/+1
| | | | Change-Id: I52b9f6b5f3e96d85a390ba2af21d7814df8aaeec
* protocol/gsm_04_08.h: do not check if unsigned is positiveVadim Yanitskiy2019-06-121-3/+3
| | | | Change-Id: I6b486b52a3733d5fd5e8ba18acbc9374e2e8bd7e
* rsl: Add osmocom-specific extensions to RSL channel numbers for CBCHHarald Welte2019-05-271-0/+4
| | | | | | | | | | | We don't really *need* it in libosmocore as such, but the lack of having all osmocom extensions listed here lead to using overlapping definitions: 0x18 was used for dynamic PDCH on the Abis side, but also for CBCH on the L1SAP side. Let's list them all here to increase visibility in case anyone wants to extend this further... Related: OS#4027 Change-Id: I93e557358cf1c1b622f77f906959df7ca6d5cb12
* protocol/gsm_12_21.h: fix copy-pasted struct descriptionVadim Yanitskiy2019-05-241-1/+1
| | | | Change-Id: Ic6d32c886f6f8f859e382d48f9e1b509000db9ba
* 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
* gsm_23_003: add GSM23003_MSISDN_{MIN,MAX}_DIGITSOliver Smith2019-05-151-0/+3
| | | | | | | | | | | Add the constant, so it can be used in create-subscriber-on-demand related patches. ITU-T Rec. E.164 6.1 states that maximum international number length should be 15. I did not find a source for a minimum length, but I've added the constant and set it to 1 for consistency (based on the existing osmo_msisdn_str_valid() function). Related: OS#2542 Change-Id: Idc74f4d94ad44b9fc1b6d43178f5f33d551ebfb1
* gsm0808: Introduce Osmocom extensions to announce Osmux supportPau Espin Pedrol2019-05-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | IE GSM0808_IE_OSMO_OSMUX_SUPPORT (T, 1 byte) is sent in AoIP appended to BSSMAP RESET in order to announce the peer that its MGW supports handling Osmux streams upon call set up. IE GSM0808_IE_OSMO_OSMUX_CID (TV, T 1 byte & V 1 byte) is sent in AoIP during call set up: * MSC->BSC Assignment Request * BSC->MSC Assignemnt Complete The 1 byte value contains the local Osmux CID, aka the recvCID aka CID where the peer sending the Assign Req/Compl will look for Osmux frames on that call. Hence, the peer receiving this CID value must use it to send Osmux frames for that call. As a result, a given call leg BSC<->MSC can have one different Osmux CID per direction. For example: * MS => MGW_BSC ==CID 0==> MGW_MSC * MS <= MGW_BSC <=CID 1=== MGW_MSC This allows for setups with 256 call legs per BSC on scenarios where NAT is not a problem, where MSC can have a pool of 256 CID per MGW_BSC (or remote peer). Related: OS#2551 Change-Id: I28f83e2e32b9533c99e65ccc1562900ac2aec74e
* Add MO-FALLBACK-VALUE SGsAP IEOmar Ramadan2019-05-101-0/+1
| | | | | | | In testing against a particular EPC, the SGsAP-SERVICE-REQUEST can contain a MO fallback value TLV with T 0xF1 Change-Id: Ia2460af9673818d375e28c67f1631b5f7eacdaeb
* add OSMO_IMSI_BUF_SIZENeels Hofmeyr2019-04-131-0/+3
| | | | | | | | | | | | Various places in our code base figure out how many chars they need to safely store an IMSI. An IMSI can have a checksum digit, which is not reflected by GSM23003_IMSI_MAX_DIGITS. And we usually need a terminating \0. Instead of having a magic +2 repeated every so often, rather define OSMO_IMSI_BUF_SIZE to contain both checksum digit and nul char, and have the explanatory comment with it here in libosmocore. Change-Id: Id11ada4c96b79f7f0ad58185ab7dbf24622fb770
* 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
* gsm_03_40.h: define max SM-TP-UDL (User-Data-Length) valuesVadim Yanitskiy2019-04-091-0/+5
| | | | | | | As per 3GPP TS 03.40, section 9.2.3.16 "TP-User-Data-Length (TP-UDL)" field may contain up to 140 octets (or 140 * 8 / 7 = 160 septets). Change-Id: I54f88d2908ac47228813fb8c049f4264e5145241
* 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
* gsm0808_utils: fix gsm48 multirate configuration generatorPhilipp Maier2019-03-111-0/+14
| | | | | | | | | | | | | | | | | The function gsm0808_sc_cfg_from_gsm48_mr_cfg() takes an S15 to S0 bitmask and converts that bitmask into an AMR multirate configuration struct. Unfortunately the current implementation implements 3GPP TS 28.062, Table 7.11.3.1.3-2 wrongly in some aspects. Lets fix this. - Fix wrong interpretation of the bitpatterns - 5,15K is invalid and must never be selected - Make sure that no more than 4 rates are selected in the active set - Extend unit-test Change-Id: I6fd7f4073b84093742c322752f2fd878d1071e15 Related: SYS#4470
* gsm_08_08.h: Add constants for Channel Type in signalling modeSylvain Munaut2019-02-171-0/+14
| | | | | | | | This is from TS 08.08 3.2.2.11 directly. The choices for Data mode and Speech mode were already present, but not for Signalling mode Change-Id: I9e24841ea877a9a78dc4d2bd14cbf60c4bea79a6 Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* protocol/gsm_04_14: Fix the OPEN LOOP message typeSylvain Munaut2019-02-071-1/+1
| | | | | Change-Id: Id4350dee4353ebf9de0450dd5dab6e4f2ee7c3a6 Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* gsm_08_08.h: Add IEI definitions from Release 15Harald Welte2019-02-051-0/+5
| | | | Change-Id: If3649606ba7c25121e30ed02939ca08c94665be5
* 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
* gsm_23_003.h: add GSM23003_IMEI_NUM_DIGITS_NO_CHKOliver Smith2019-01-211-0/+3
| | | | | | | Add new define for the 14 digit IMEI without the Luhn checksum, as it is used in OsmoHLR. Change-Id: I02b54cf01a674a1911c5c897fbec02240f88b521
* comments: update/fix three 3GPP spec referencesNeels Hofmeyr2019-01-143-3/+3
| | | | 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
* fix typo in enum BSS_MAP_MSG_TYPE: BSS_MAP_MSG_ASSIGMENT*Neels Hofmeyr2019-01-041-3/+7
| | | | | | Keep #defines to still support previous wrong spelling. Change-Id: Id4cf812f0bc3cd40f6bfa05166f817a07a647f71
* rename CELL_IDENT_LAI_AND_LAC to CELL_IDENT_LAIStefan Sperling2018-12-191-2/+3
| | | | | | | | | The name "LAI AND LAC" makes no sense because a LAC is part of a LAI. Keep the old name available for API backwards compatibility. Change-Id: I2749cf75b7b45de0cd43cf4c696a6b6984f5a065 Related: OS#3124
* add/clean big-endian packed structs (struct_endianess.py)Neels Hofmeyr2018-12-197-45/+541
| | | | | | | | | | | | | | 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
* gsm29118: add generator functions for GSM29118 messagesPhilipp Maier2018-12-071-0/+7
| | | | | | | | | We already have some GSM29118 related definitions and functions in libosmocore. Lets also add some functions to generate GSM29118 messages (similar to those we have for GSM0808). Change-Id: Ic87f8a771b87b52215d0a7451b67794557b80b8a Related: OS#3615
* gsm_29_118.h: Add constant for default portPhilipp Maier2018-12-071-0/+3
| | | | | | | | The specification defines a default port where the SGs interface should be reachable. Lets add a define-constant for it. Change-Id: Ia4b9f547dd980411d15b2691b7f535fa0463f0f1 Related: OS#3615
* gsm_29_118: add missing extern for struct value_string decl.Philipp Maier2018-12-051-8/+8
| | | | | | | | The value string arrays in the header file (gsm_29_118.h) are not declared as extern. Lets add it now. Change-Id: Ib6c4cbea649f790fa4db1ed2fe2b7e76a60291b4 Related: OS#3615
* gsm_44_318.h: remove #if 0 from struct gan_cch_desc_ieNeels Hofmeyr2018-11-191-17/+0
| | | | | | | These are actually parts of the struct in big endian order, which will soon be done automatically by struct_endianess.py. Change-Id: I9bc694f10fa9cef0bb7fc791bb40e7602459b16b
* Update GSM0808_LCLS enumsMax2018-11-181-0/+3
| | | | | | | | Add values indicating that LCLS control/config/status value has not been received yet. Change-Id: I52dc6a52f5ee043ed2c1625ffecfd495e3c746b1 Related: OS#2487
* Update 3GPP TS 08.08 Cause handlingMax2018-11-181-0/+12
| | | | | | | | | | | | * 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
* gsm29118: add value strings for SGSAP IEIPhilipp Maier2018-11-161-1/+4
| | | | | | | | 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
* gsm/protocol/gsm_08_58.h: Fix typoMartin Hauke2018-11-151-1/+1
| | | | | | | | | | | | | | Fix a typo that prevents building on ppc64 (Power8, Big Endian). Tested with gcc version: 8.2.1+r265487 /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -DBUILDING_LIBOSMOCORE -Wall -Wall -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -DBUILDING_LIBOSMOCORE -Wall -c -o panic.lo panic.c In file included from ../include/osmocom/gsm/rsl.h:6, from gsmtap_util.c:37: ../include/osmocom/gsm/protocol/gsm_08_58.h:60:4: error: expected specifier-qualifier-list before 'sapi' sapi:3; ^~~~ Change-Id: I4a40fc68cb6dfdfadfcc34213c4ecdabbbc356f2
* gsm_29_118: add missing include to header filePhilipp Maier2018-11-071-0/+1
| | | | | | | | | The header file gsm_29_118.h is defining variables of type struct value_string, which is declared in core/utils.h. We should add an include to utils.h to prevent confusion when the header is used. Change-Id: I9f9bb62d29cd068820ad5aa677717bd448de3f4a Related: OS#3615
* gsm23003: Add MME domain name related helper functionsHarald Welte2018-10-281-0/+6
| | | | | | | osmo_gen_mme_group_domain(), osmo_gen_mme_group_domain() and osmo_gen_home_network_domain() Change-Id: Ia882d9db05ec0037e593aeebea21bc31adb680bb
* SGsAP protocol definitions (header + C file)Harald Welte2018-10-211-0/+169
| | | | Change-Id: Idddfc9b851eb4c2fa7dd661a9ce1b03a04883109
* gsm_08_58.h: Introduce struct abis_rsl_chan_nrPau Espin Pedrol2018-10-211-3/+32
| | | | | | | | | | | | It will allow to make code handling chan_nr values more easier to read and less prone to errors. union is used to be able to get the full octet in case we need to pass it somewhere else or encode it. An extra union is used in struct abis_rsl_common_hdr and others to allow using fields directly while keeping API compatibility. Change-Id: Icd6822021207270a00106c50f8ca6b93c1250df9
* gsm_08_58.h: Introduce struct abis_rsl_link_idPau Espin Pedrol2018-10-101-1/+24
| | | | | | | | | | | | It will allow to make code handling link_id values more easier to read and less prone to errors. union is used to be able to get the full octet in case we need to pass it somewhere else or encode it. An extra union is used in struct abis_rsl_common_hdr to allow using fields directly while keeping API compatibility. Change-Id: Ibd75a493bcfdf46c028ea466867d0c0d83d46343
* gsm0808: add function to convert amr gsm0408 setings to gsm0808Philipp Maier2018-09-191-0/+14
| | | | | | | | | | | | | | | | 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
* Revert "gsm0808: add function to convert amr gsm0408 setings to gsm0808"Neels Hofmeyr2018-09-161-14/+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
* gsm0808: add function to convert amr gsm0408 setings to gsm0808Philipp Maier2018-09-141-0/+14
| | | | | | | | | 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