aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm/gsm0808.h
AgeCommit message (Collapse)AuthorFilesLines
2023-06-09ASCI: Add message definition and encoding according to 3GPP TS 48.008Andreas Eversberg1-2/+239
Change-Id: Ib94c64136c31ce4af67c314a8550d93946cc844f
2022-11-03Support building with -Werror=strict-prototypes / -Werror=old-style-definitionHarald Welte1-3/+3
Unfortunately "-std=c99" is not sufficient to make gcc ignore code that uses constructs of earlier C standards, which were abandoned in C99. See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for some related discussion. Change-Id: I84fd99442d0cc400fa562fa33623c142649230e2
2022-02-28BSSAP: HO Request Ack: add missing Codec List (BSS Supported)Neels Hofmeyr1-1/+5
Related: SYS#5839 Related: I3c0576505a3ceb3cd5cc31dc69c5bc4a86a4ea08 (osmo-bsc) Change-Id: Iab0a7b4d81592157fc111d1adb9e9f4cb53a94e9
2021-12-14treewide: remove FSF addressOliver Smith1-4/+0
Remove the paragraph about writing to the Free Software Foundation's mailing address. The FSF has changed addresses in the past, and may do so again. In 2021 this is not useful, let's rather have a bit less boilerplate at the start of source files. Change-Id: I5050285e75cf120407a1d883e99b3c4bcae8ffd7
2021-06-25gsm0808: add Kc128 to Handover RequestNeels Hofmeyr1-1/+6
Change-Id: Ieb6e43eef9e57281d54d4b7c63664668df5aef3e
2021-06-21add Kc128 to gsm0808 Create Ciphering CommandNeels Hofmeyr1-0/+20
Prepare for A5/4 support in osmo-msc. Add new function gsm0808_create_cipher2() which takes a struct as argument instead of individual fields. This is akin to e.g. gsm0808_create_handover_request() below in the file, and allows backwards compatibly extending the argument list without needing a new function signature every time. Add struct gsm0808_cipher_mode_command, as argument list for gsm0808_create_cipher2(), with kc128 included. Encode the Kc128 IE in gsm0808_create_cipher2(). Implement gsm0808_create_cipher() by calling gsm0808_create_cipher2(). Change-Id: Ib3906085e0c6e5a496a9f755f0f786238a86ca34
2021-04-21gsm0808: Introduce gsm0808_old_bss_to_new_bss_info_att_tlvdefPau Espin Pedrol1-0/+1
Introduce TLV attribute definition for "Old BSS to New BSS Information" container. Related: SYS#5337 Change-Id: I0e55e947b6fef6dad0cf1a6c16b781bef4cc76c5
2021-04-19gsm: Support Sending Last EUTRAN PLMN Id in Handover RequiredPau Espin Pedrol1-0/+3
Related: SYS#5337 Change-Id: I6280ce1abc283f1491bc6f391b2dd952df33a16b
2021-04-14cosmetic: Fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: Ib79b0e0c728a7f4de0b3884785c73ab2d0d44f4e
2020-08-26gsm0808: add gsm0808_create_sapi_reject_cause()Vadim Yanitskiy1-1/+3
This is basically a successor of gsm0808_create_sapi_reject(), but instead of hard-coding GSM0808_CAUSE_BSS_NOT_EQUIPPED, it allows the caller to specify a cause value to be used. The old function is now deprecated and should not be used. Change-Id: Iefe5484d0fa02d5722b628b1dc237d51d3fb1a9b Related: OS#4728
2020-06-21gsm0808: Add gsm0808_create_common_id()Harald Welte1-0/+3
This function encodes a GSM 08.08 / 48.008 "Common ID" message. Change-Id: I353adc1aa72377f7d4b3336d2ff47791fb73d62c Related: OS#2969
2020-05-17gsm0808: Implement helper functions for CONFUSION BSSMAP message decoding.Alexander Chemeris1-0/+3
Also add a test for an actual CONFUSION message parsing. Change-Id: If8afd2d096fb66c6c2f255a08fc1129de3d09cec
2020-05-13gsm0808: Make a function to extract Cause IE publicly available.Alexander Chemeris1-0/+4
Function gsm0808_get_cipher_reject_cause() was previously available in private gsm0808_utils.h. In practice, the exact same code is useful to extract Cause IE value from any of the many other BSSMAP messages which use it. So let's rename it to gsm0808_get_cause() and make it avilable to everyone to use. Change-Id: Idf2b99e9ef014eba26e3d4f0f38c2714d3a0520a
2019-05-06Re-introduce declaration of gsm0808_create_handover_request_ack()Harald Welte1-0/+4
In Change-Id Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576, the old declaration of gsm0808_create_handover_request_ack() was accidentially removed from the gsm0808.h header file. The actual function itself (and the exported symbol) remained for backwards compatibility at runtime, but removing the declaration from the header file resulted in build failures across the board of all automatic tests. Let's re-introduce the old declaration. Change-Id: I9e96fa675fccca9ee9631caad7559dea3794d490
2019-05-05add gsm0808_create_handover_request_ack2 to add AoIP RTP addrNeels Hofmeyr1-3/+23
osmo-bsc so far omits the AoIP Transport Layer Address from its Handover Request Acknowledge message, which breaks inter-BSC Handover for AoIP. Allow fixing that. One quirk I really don't like about this: I would prefer to directly use struct sockaddr_storage as a member of the struct gsm0808_handover_request_ack. Even though struct sockaddr_storage appears in various function signatures, the gsm0808.c actually also gets built on embedded systems that lack arpa/inet.h (for me indicated by the ARM build job on jenkins). Compiling gsm0808.c works only because the actual coding of struct sockaddr_storage is implemented in gsm0808_util.c, which (apparently) does not get built on embedded and hence, even though there are undefined references to e.g. gsm0808_enc_aoip_trasp_addr() it works. Related: I4a5acdb2d4a0b947cc0c62067a67be88a3d467ff (osmo-bsc) Change-Id: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576
2019-05-03add osmo_bssap_tlv_parse2() for multiple identical TNeels Hofmeyr1-0/+3
In BSSMAP messages, at least the Cell Identifier IE can appear more than once. We have tlv_parse2() which allows decoding into an array of tlv_parsed to cleanly handle multiple occurences. Hence add osmo_bssap_tlv_parse2() which supports multiple occurences. An alternative would be to directly call tlv_parse2() with gsm0808_att_tlvdef() when multiple T occurences are needed, and I'm not really sure why osmo_bssap_tlv_parse() exists in the first place. But because it does, add a similar definition that is capable of handling multiple IEs with identical Tag discriminator. Change-Id: Ib9a2095f7498dc2cda2a57154b2dbe4621df72f8
2019-05-03BSSMAP: add messages for inter-BSC and inter-MSC HandoverNeels Hofmeyr1-0/+66
Change-Id: I9dac375331f6bea744769e973725d58e35f87226
2019-04-26BSSMAP: tweaksNeels Hofmeyr1-2/+2
Change two instances of Speech Version values to enum gsm0808_permitted_speech. It is often not trivial to find the right values for a uint8_t member, giving the enum name makes it a lot easier/safer to use. In gsm0808_create_handover_required(), use msgb_tv_put() so that the enum's storage size doesn't matter. (Already used for handover_performed) Fix typo in doc of gsm0808_create_handover_required(). Change-Id: I6387836bab76e1fa42daa0f42ab94fc14b70b112
2019-02-26enlarge gsm0808 msgb headroomNeels Hofmeyr1-2/+2
It should be large enough to prepend a struct osmo_scu_prim to pass down an SCCP stack (see libosmo-sccp). 264 should suffice, but pick the next larger power-of-two instead. In osmo-msc, I would like to prepend an osmo_prim to the msgb created by gsm0808 API, but turns out the headroom is too small: msgb(0x61700001b660): Not enough headroom msgb_push (126 < 264) Instead of always copying a msgb that has just that instant been created, it makes more sense to allocate sufficient headroom in the first place. Change-Id: I95729991eb49555f8bba60c5dc916131b03b6cf2
2019-02-05gsm0808: Add CSFB indication IE to BSSMAP CLEAR COMMANDPhilipp Maier1-0/+1
When a call that was established in a CSFB context ends the CLEAR COMMAND that is send from the BSC to the MSC should contain a CSFB indication IE, which consists of just the IE byte itsslef. This additional IE tells the BSC to include other CSFB related IEs into the RR Release message. Change-Id: Id8a75e1da2d5f520064666e4ee413d1c91da6ae3 Related: OS#3778
2019-01-19LCLS: add status parameter to Assignment Completed messageMax1-0/+6
* add gsm0808_create_ass_compl2() with additional gsm0808_lcls_status parameter and make gsm0808_create_ass_compl() into trivial wrapper around it * update tests accordingly Change-Id: I547c6b8707123aa8c1ef636db88908df112d90a4 Related: OS#2487
2019-01-09LCLS: use proper types for value_string wrappersMax1-3/+3
Change-Id: I0f47a610e06ac99bd60a5aad6f50f3658480165e
2019-01-07LCLS: fix LCLS-CONNECT-CONTROL encoderMax1-2/+2
Previously it could encode both incorrect values as well as incorrect message. Let's fix this by explicitly checking for invalid values and ensuring that at least one of the parameters is valid. This function have no external or internal users so it's better to fix type signature as well to match the rest of gsm0808_create_lcls_*(). Change-Id: I7b33a771acbd391c5f9a494d6450edb18511433f
2018-12-14LCLS: add gsm0808_create_ass2()Max1-0/+6
It allows setting additional assignment parameters explicitly. Change-Id: Id89765df3f8c12f55f73f1d7a9d90c8883eb3bba Related: OS#2487
2018-12-03gsm0808: add message generator for BSSMAP HANDOVER PERFORMEDPhilipp Maier1-0/+24
We currently have no generator function that can generate BSSMAP HANDOVER PERFORMED messages. Lets add function for this. Change-Id: I825106858bd89afc9837811b8fed2e8accc82441 Related: OS#3645
2018-11-30Move BSSMAP_MSG_* defines to header fileMax1-0/+3
This will be reused be several tests related to TS 48.008 and TS 29.205 in follow-up commits. Change-Id: I4d8cc05b8df8e70c1f6257e53ae3acec7901681f
2018-11-19Support cipher mode reject with extended causeMax1-0/+1
* 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-18Update 3GPP TS 08.08 Cause handlingMax1-2/+3
* 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-18Add helper wrapper for BSSAP TLV parsingMax1-0/+3
Change-Id: Ib228368901ce90a02a5664f2510593371c7d29cd
2018-10-30gsm0808: cosmetic: rename parameter "reason" to "cause"Philipp Maier1-1/+1
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-09-13gsm0808: implement BSSMAP Classmark RequestNeels Hofmeyr1-0/+1
Related: OS#3043 Change-Id: I4a2e1d3923e33912579c4180aa1ff8e8f5abb7e7
2018-06-18add and tweak inter-BSC HO APINeels Hofmeyr1-0/+40
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-02gsm0808: Add value_string for LCLS related IEsHarald Welte1-0/+15
Change-Id: I18d7a29496929c761aeaba9c0aee847befc13108
2018-05-30gsm0808: Add encoding functions for LCLS BSSMAP messagesHarald Welte1-0/+5
Change-Id: Ib83143e467df068b7d462a8e51d94b9d961ce18f
2018-05-27add gsm0808_create_handover_request_ack()Neels Hofmeyr1-0/+4
Related: OS#2283 (inter-BSC Handover, BSC side, MT) Change-Id: I692292a06c7d66004404560dc4ed933ca9107f9b
2018-05-27add support for gsm0808 HANDOVER REQUIRED messageNeels Hofmeyr1-0/+37
Related: OS#2283 (inter-BSC Handover, BSC side, MO) Change-Id: Idb6dc3eab0282158a17091d97ed77c1e2e3eb3c2
2018-04-10deprecate PLMN de-/coding functions incapable of 3-digit MNC with leading zerosNeels Hofmeyr1-3/+4
All our projects have seen patches to move to 3-digit MNC handling. Furthermore, since our builds no longer break from deprecation warnings, I shall no longer refrain from deprecating old API. Change-Id: I55dfaf7ce74870de44120b26c42d45bb7b184341
2018-03-29gsm0808: Add value strings for BSSMAP cause codesPhilipp Maier1-0/+1
libosmocore has no value strings for BSSMAP cause codes yet. - Add value strings for BSSMAP cause codes and a function to retrieve them Change-Id: I313dd8d7b06374e1e35ddc18b7a42562d9e25d45 Related: OS#1609
2018-03-13support for more cell ID list types in libosmocoreStefan Sperling1-1/+6
Introduce gsm0808_dec_cell_id_list2() with supports additional types of cell identifier lists. The new parsing routines are based on similar routines used by the paging code in osmo-bsc's osmo_bsc_bssap.c. Likewise, introduce gsm0808_enc_cell_id_list2() with support for the same additional types of cell identifier lists. The old API using struct gsm0808_cell_id_list is deprecated. The previous definition was insufficient because it assumed that all decoded cell ID types could be represented with a single uint16_t. It was declared in a GSM protocol header (gsm/protocol/gsm_08_08.h) despite being a host-side representation of data in an IE. The only user I am aware of is in osmo-msc, where this struct is used for one local variable. osmo-msc releases >= 1.1.0 make use of this API. While here, fix a small bug in a test: test_gsm0808_enc_dec_cell_id_list_bss() set the cell ID type to 'LAC' but obviously wants to use type 'BSS'. Change-Id: Ib7e754f538df0c83298a3c958b4e15a32fcb8abb Related: OS#2847
2018-02-28implement support for 3-digit MNC with leading zerosNeels Hofmeyr1-0/+4
Enable representing three-digit MNC with leading zeros. The MNCs 23 and 023 are actually different; so far we treated both as 23. Re-encode an incoming BCD or string of 023 as it were, i.e. not dropping the leading zero as 23. Break ABI compatibility by changing the size and ordering of structs gprs_ra_id, osmo_plmn_id, osmo_cell_global_id, ... by adding an mnc_3_digits flag. Change ordering in gprs_ra_id because the canonical oder is {Mobile Country Code, Mobile Network Code}, so have the mcc member first. ABI compatibility cannot be maintained for struct gprs_ra_id, since it is a direct member of structs bssgp_bvc_ctx and bssgp_paging_info, and even just adding a flag to the end would cause ABI changes of those structs. Similarly, osmo_plmn_id is a direct member of osmo_location_area_id, and so forth. Add new API to set and read this additional flag to preserve leading zeros: - osmo_plmn_to_bcd(), osmo_plmn_from_bcd() after gsm48_mcc_mnc_to_bcd() and gsm48_mcc_mnc_from_bcd(). - gsm48_decode_lai2(), gsm48_generate_lai2() after gsm48_decode_lai(), gsm48_generate_lai(). - gsm0808_create_layer3_2() after gsm0808_create_layer3() and gsm0808_create_layer3_aoip(). - various osmo_*_name() functions in gsm23003.h (osmo_rai_name() still in gsm48.h close to struct gprs_ra_id definition). The amount and duplication of these may seem a bit overboard, but IMO they do make sense in this way. Though most code will soon see patches unifying the data structures used, in some cases (vty, ctrl) they are required singled out. Without these functions, the formatting ("%0*u", mnc_3_digits ? 3 : 2, mnc) would be duplicated all over our diverse repositories. In various log output, include the leading MNC zeros. Mark one TODO in card_fs_sim.c, I am not sure how to communicate a leading zero to/from a SIM card FS. The focus here is on the core network / BSS. To indicate ABI incompatibility, bump libosmogsm and libosmogb LIBVERSIONs; adjust debian files accordingly. Implementation choices: - The default behavior upon zero-initialization will be the mnc_3_digits flag set to false, which yields exactly the previous behavior. - I decided against packing the mnc with the mnc_3_digits field into a sub-struct because it would immediately break all builds of dependent projects: it would require immediate merging of numerous patches in other repositories, and it would make compiling older code against a newer libosmocore unneccessarily hard. Change-Id: Id2240f7f518494c9df6c8bda52c0d5092f90f221
2017-10-17[doc] Properly define gsm0800 group and move all related files into itHarald Welte1-1/+5
Change-Id: I91920c69c86d6a1932172becacb76faff2d3eb1e
2017-06-23doxygen: unify use of \file across the boardNeels Hofmeyr1-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
2017-05-15gsm0808 + ipa: fix compilation on systems without sys/socket.hHarald Welte1-1/+1
Change-Id: I60f5d4982cd96ab29f9924ec11b46bf56fbfc346
2017-04-08gsm0808: Add create functions for BSS_MAP_MSG_ASSIGMENT_RQSTPhilipp Maier1-0/+5
gsm0808.h/c lacks functionality to generate BSS_MAP_MSG_ASSIGMENT_RQST messages. These messages are required if the code is used in an MSC implementation. This commit adds a gsm0808_create_assignment() function, that generates an A/AoiP BSS_MAP_MSG_PAGING message. Change-Id: I4d1d455a1e1cf95407e23ded7b7defbcf2dd6ff0
2017-04-08gsm0808: Add create functions for BSS_MAP_MSG_PAGINGPhilipp Maier1-0/+3
gsm0808.h/c lacks functionality to generate BSS_MAP_MSG_PAGING messages. These messages are required if the code is used in an MSC implementation. This commit adds a gsm0808_create_paging() function, that generates an A/AoiP BSS_MAP_MSG_PAGING message. Change-Id: I9afecf0109305ca5153bf081bb29cd94071dd2b7
2017-04-08gsm0808: Add create functions for CIPHER MODE COMMANDPhilipp Maier1-0/+2
gsm0808.h/c lacks functionality to generate CIPHER MODE COMMAND messages. These messages are required if the code is used in an MSC implementation. This commit adds a gsm0808_create_cipher() function, that generates an A/AoiP CIPHER MODE COMMAND message. Change-Id: I8eb1c357860c3e740b0f5d17e1c256bc87920958
2017-04-08gsm0808: Add AoIP specific elements to gsm0808_create_... functionsPhilipp Maier1-2/+19
the classic A implementation in libosmocore lacks support for AoIP message elements. This patch adds support for AoIP by adding a set of new gsm0808_create_..., which support the missing AoIP message elements Change-Id: I77f866abec1822d19871052f3c647ad782785b34
2014-06-16include: Switch to #pragma once patternSylvain Munaut1-4/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-06-29introduce gsm0808_create_reset_ack()Harald Welte1-0/+1
2012-01-26GSM 08.08: change gsm0808_create_classmark_update() prototypeHarald Welte1-1/+2
The caller explicitly specifies CM2 and CM3, rather than one blob containing both.