aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm
AgeCommit message (Collapse)AuthorFilesLines
2024-03-02cbsp: Add osmo_cbsp_segmentation_cb for message segmentationlaforge/cbspHarald Welte1-0/+1
This call-back can for example be used as segmentation call-back for libosmo-netif stream_cli/stream_srv or directly for osmo_io. Related: OS#5755 Change-Id: I5e922c54b3431d759b38e81e55076125c5a34008
2024-02-27gsup.h: define newly added PCO IEAlexander Couzens1-0/+8
PCO - Protocol Configuration Options 3GPP TS 24.008 / 10.5.6.3. The PCO will be used by the osmo-epdg to pass PCO internally. The PCO will be passed towards to the PGW in the Session Request. Related: OS#6369 Related: osmo-gsm-manuals.git Change-Id Id912ead4e1205f84a40af6505a5ddf050d1e086d Change-Id: I0f9de90c7c67fe194b441a9d118eba70f09afb5e
2024-02-06comment: gsm_04_08.h: add a spec hintNeels Hofmeyr1-1/+2
Change-Id: I2a606047db88ea47317397a790611048dead6403
2024-01-25gsm: add more definitions from Table 10.5.112/3GPP TS 24.008Vadim Yanitskiy1-0/+22
Change-Id: I25e40853ace09fa98b614f3893eeba600be8fcdc Related: OS#4396
2024-01-20gsup: Convert PDP-Type IE to PDP-Address IEPau Espin Pedrol1-3/+6
The previous PDP-Type IE should have been a PDP-Address from the start, since having only PDP-Type with no address is only a specific case (dynamic addressing). This becomes clear by looking at other similar protocols like: * MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs * Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains Served-Party-IP-Address AVPs * Diameter SWx, 3GPP TS 29.273 APN-Configuration. * GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address. Since PDP-Type on its own really makes no sense, being it a special case of PDP-Address, let's keep the IE by renaming it (keeping old name too for API backward compat) and extend it to support lengths > 2 bytes. Old implementation of libosmogsm gsup actually ignored lengths > 2 bytes, so we are safe acting against older implementations here, both on the sending and receiving side on the wire. The big drawback of this commit is that it breaks ABI compatibility due to adding "struct osmo_sockaddr pdp_address[2];" to struct osmo_gsup_pdp_info, which in turn affects shift of fields in struct osmo_gsup_message. Unfortunately, there's not much that can be done to improve the situation when adding the missing field, due to existing API having the same struct for all messages. Ideally we'd have 1 union with structs per message type inside, this way the ABI break would be far less pronounced. The GSUP test output change is becaue we now accept some of the len>2 cases for PDP-Type/Address IE which were being rejected since a couple commits ago. libosmogsm gsup code is now disabled in EMBEDDED mode, since it nows depends on core/socket.h (struct osmo_sockaddr) which is not available in EMBEDDED, and hence fails during build: """ In file included from /build/include/osmocom/gsm/gsup.h:45, from /build/src/gsm/gsup_sms.c:28: /build/include/osmocom/core/socket.h:15:10: fatal error: arpa/inet.h: No such file or directory 15 | #include <arpa/inet.h> | ^~~~~~~~~~~~~ """ Related: OS#6091 Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
2024-01-20gsup: Deprecate field pdp_type in favour of pdp_type_nr and pdp_type_orgPau Espin Pedrol1-2/+15
Having both fields in an uin16_t integer makes it difficult and confusing for users for no good reason. Let's have separate fields for each of them. The new fields are defined so that they are ABI compatible with previous uin16 field. Change-Id: Ie31c6080c90e468c01186259f2c42621e39b5cc6
2024-01-20gsm_04_08_gprs.h: Introduce packed struct gsm48_pdp_addressPau Espin Pedrol1-1/+35
This can be used in several protocols, such as GTP, GSUP, etc. Related: OS#6091 Change-Id: I453ced42dd36df3a6ddb5db67093df5a22cad18c
2024-01-18cosmetic: gsup.h: fix whitespace formattingPau Espin Pedrol1-1/+1
Change-Id: Icd5e38db1b99889ad15a2a4cbb83393292a54180
2023-11-29Add a GSM RLP decoder and encoderHarald Welte2-0/+82
This code implements a decoder and encoder for the RLP (Radio Link Protocol) as used in the bearer channel of GSM CSD (Circuit Switched Data). Change-Id: I2d9bd8eb4f0cd0f72c436996767b199429596917
2023-11-29Add flag to enable RTS based pollingAndreas Eversberg1-0/+1
RTS based polling in LAPDm code is disabled by default. Make libosmogsm stay compatible with existing applications that do not use RTS based polling. This patch fixes the issue that LAPDM_ENT_F_POLLING_ONLY did enable RTS based polling too, which breaks existing applications like older versions of osmo-bts. Change-Id: I2a75c192bbc24e85bfc1656b2be21cea7a92814a
2023-11-29Fix union abis_rsl_chan_nr and abis_rsl_link_idAndreas Eversberg1-2/+6
All bit fields in a union will overlap in memory, as all elements in a union do. To prevent the bit fields from overlapping, wrap them into a packed structure. Change-Id: I5ef5aa62be8310da4ebe9ea73ebbedcbcc2ba49c
2023-11-28gsup: add message type for osmo-epdg CEAI interfaceAlexander Couzens1-0/+5
The CEIA interface is an interface between osmo-epdg and strongswan. It is used by the osmo-epdg to synchronize state. Related: OS#6091 Change-Id: I6f7c20340c99f94b1326a8a7dc99c86cf6a0dbc3
2023-11-27LAPDm: Add a flag to enable suppression of subsequent REJ frameAndreas Eversberg1-0/+1
This behaviour was default in earlier versions of LAPDm/LAPD. Because it is only required for osmocom-bb, a flag is added to enable it there. Related: OS#5969 Change-Id: I93994dbbd1fc2c9edb8f3015c6b18ecd0fce0565
2023-11-27LAPDm: Add an extra queue for UI framesAndreas Eversberg1-0/+1
The extra queue is used to transmit the UI frame only when there is no frame in the regular TX queue. This allows to give LAPD frames prioity over UI frame. Related: OS#4074 Change-Id: I00c8ee73be8b7c564a4dee3fca3e893484f567da
2023-11-27LAPDm: Add support for RTS based pollingAndreas Eversberg1-0/+8
The lower layer must set the 'POLLING_ONLY' flag and provide frame number when polling a frame. If T200 is pending, it is started with a timeout frame number in advance to given frame number. The lower layer must call lapdm_t200_fn() after a frame has been received or if a frame has not been received. Also it must be called after a TCH frame has been received. LAPDm uses this to check the T200 timeout condition. A new function is used to set the frame number based timeout values. Related: OS#4074 Change-Id: I6ebe83f829d7751ea9de1d90eb478c7a628db64c
2023-10-24ASCI: Add primitive to L1-SAP to switch uplink access detection on or offAndreas Eversberg1-0/+8
Related: OS#4851 Change-Id: Ibd6a1d468a70126a8f67e944fcb916969cc3c36b
2023-09-26gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/Vadim Yanitskiy1-1/+1
Change-Id: Ie8bb9c49c6f81b8f4a1766547d6943f9880d1186 Related: OS#5500
2023-09-25gsm: add gsm0502_fn_compare() for comparing TDMA FNsVadim Yanitskiy1-0/+19
We need this function in: * osmocom-bb.git for trxcon and l1gprs, * osmo-pcu.git replacing fn_cmp(). Change-Id: I9590f2e836fc48650decf1564b6ab46306c4fe2d Related: OS#5500
2023-09-18gsm/protocol/gsm_04_11.h: add SMSC-address length limit definitionsMychaela N. Falconia1-0/+10
Change-Id: Iea5c29909c5be80f81dbbc2873656ff5cf590a5d
2023-09-12ASCI: Add definition for TALKER INDICATION and UPLINK RELEASEAndreas Eversberg1-0/+12
Change-Id: I5ab196d46cdee160e59ee4ecf72c79aa1b25815f
2023-09-12ASCI: Add BCC call state definitionsAndreas Eversberg1-2/+2
BCC and GCC share same call states, except for two states that have same value, but different state names and conditions. Related: OS#5364 Change-Id: I2180b43b940542565188f52c554c960858fe2a95
2023-09-12gsm_12_21.h: fix typo: NM_IPAC_F_CHANT_P{C->D}CHFVadim Yanitskiy1-1/+1
Change-Id: I35ee30978820f2038f562b7703ca886852a4f708 Fixes: a7d7cf28 "gsm_12_21.h: add flags for NM_ATT_IPACC_SUPP_FEATURES"
2023-09-05gsm_12_21.h: add flags for NM_ATT_IPACC_SUPP_FEATURESVadim Yanitskiy1-0/+92
Change-Id: Ia4208e10d61843dd6ae77398f6624c918dc81ea4
2023-09-02gsm_12_21.h: Introduce packed structs for NM_ATT_IPACC_NS_CFG valuesPau Espin Pedrol1-0/+11
Change-Id: Ie477b0e6d79e6d408e0004fd60307afc5feaa3b6
2023-09-02gsm_12_21.h: Introduce packed structs for NM_ATT_IPACC_BSSGP_CFG valuesPau Espin Pedrol1-0/+15
Change-Id: Ibfd759cb8a252f801bb3a758ea7960072c96f254
2023-09-02gsm_12_21.h: Introduce packed structs for NM_ATT_IPACC_RLC_CFG{,_2,_3} valuesPau Espin Pedrol1-0/+30
Change-Id: I60e17dedd1fadce0f705616e3ed96cabb318bcec
2023-08-23Revert "rsl: Introduce new osmocom extension IE RSL_IE_OSMO_ABS_FRAME_NUMBER"Pau Espin Pedrol1-1/+0
This reverts commit 54b1b3be37ae863ddbdd2b9408ebdd98ac8470d8. osmo-bts is forwarding the msgbs as they come from lapdm to the RSL on the wire, which means we end up sending the osmocom-specific IEs on the wire, something which was not envisioned when adding this IE. Change-Id: Id9029ef378970322063478e9ce888daf335d6103 Related: OS#6142
2023-08-23Revert "lapdm: Append RSL_IE_OSMO_ABS_FRAME_NUMBER to RSLms msgs towards ↵Pau Espin Pedrol1-2/+0
upper layers" This reverts commit d981794113efef3cc1195cde82043c5c66937b11. osmo-bts is forwarding the msgbs as they come from lapdm to the RSL on the wire, which means we end up sending the osmocom-specific IEs on the wire, something which was not envisioned when adding this IE. Change-Id: I0ab0d5b545b4862e72eb1842edd07ca2e4955311 Related: OS#6142
2023-08-21lapdm: Append RSL_IE_OSMO_ABS_FRAME_NUMBER to RSLms msgs towards upper layersPau Espin Pedrol1-0/+2
This makes it possible to track GSM time in the upper layers. The existing RSL_IE_FRAME_NUMBER and RSL_IE_STARTNG_TIME cannot be used there, since those are 16bit fields containing Relative FN values. The IE needs to be added before the L3_INFO one, because user code usually assumes the msgb->l3 pointing to L3_INFO value extends until the end of the message, using msgb3_len(msg). Regarding having an extra IE at the middle, it's not a big problem since the libosmocore version submitting this commit to the upper layers is the same which will also be parsing it through rsl_tlv_parse() later on by the app. Related: OS#3626 Change-Id: Id62c18f49f270449067b25b7104eb8b47f1955ec
2023-08-21rsl: Introduce new osmocom extension IE RSL_IE_OSMO_ABS_FRAME_NUMBERPau Espin Pedrol1-0/+1
This will be used in RSLms to provide Absolute Frame Number information of the primitive indications being sent to upper layers, so that it's possible to track GSM time in the upper layers. The existing RSL_IE_FRAME_NUMBER and RSL_IE_STARTNG_TIME cannot be used there, since those are 16bit fields containing Relative FN values. Related: OS#3626 Change-Id: Ia28caa24dd141b1162b6e11500d753353fe6500d
2023-08-11gsm: Introduce functions to convert between FN and RFN (Reduced FN)Pau Espin Pedrol1-0/+8
Implementation ported from osmo-pcu.git e98b315d12fb009359410809f4169f9380f3d933, function bts_rfn_to_fn(). This functionality can be used by osmo-pcu, libosmo-gprs or any other related code which needs to handle RFNs. Change-Id: Ib71e8da976f6cc84c3a4ab17b0a8c2101492e243
2023-08-11lapdm: Track fn of primitives in struct lapdm_msg_ctxPau Espin Pedrol1-0/+1
This field will be used in follow-up commits to provide FN information in RSLms primitives towars upper layers. This is needed for instance on the MS side when a CCCH_DATA.ind is received containing a TBF ImmAss with a relative FN indicating the Starting Time. Without tracking FN advance, the uppers layers are not capable of figuring out the absolute FN of the TBF Starting time. The struct lapdm_msg_ctx is not really used outside of libosmocore, so we are safe extending it. Related: OS#3626 Change-Id: Icf986f4202703eb452bedc1b749bb8ce0c73706f
2023-08-11tlv: Introduce API msgb_tv32_push()Pau Espin Pedrol1-0/+10
msgb_tv32_put() already exists, but msgb_tv32_push doesn't. The tv16 counterparts are already present, and having to pass 32bit integers is also quite common, so let's add an API for it. Change-Id: I68d5693a18d55ce8d0647359044157d7e5bfae50
2023-07-25gsm_08_08: define GSM0808_SCT_EXT (separately)Vadim Yanitskiy1-0/+6
As per 3GPP TS 48.008, section 3.2.2.103, the "Codec Type" field may contain either a certain 3GPP Speech Codec Type directly (4 bit value), or the so called "Codec Extension" = 0xFh, in which case the real Codec Type follows in the next octet as "Extended Codec Type". CSD is such an example, the encoding is defined as follows: 8 7 6 5 4 3 2 1 +----+----+----+----+-------------------+ | -- | PI | PT | -- | 0xFh | +----+----+----+----+-------------------+ | Extended Codec Type (CSData) | +----+----+-----------------------------+ | R2 | R3 | | +----+----+-----------------------------+ CSData is coded with 0xFDh or '1111 1101' (0xfd). Let's have the "Codec Extension" value clearly defined in the header file, but intentionally separate from the other GSM0808_SCT_* values. Change-Id: Iafaa25070684d2ba400c75fa33e803651a5ce857 Related: OS#6110, OS#4393, OS#4394
2023-07-18gsm: Add missing IE definition for GMM Receive N-PDU Number listPau Espin Pedrol1-0/+1
Change-Id: Ifac09653141758af345efe2eb9cef25ebf4dcff9
2023-07-18Revert "gsm/ipa: Add segmentation callback"arehbein1-3/+0
It has been decided that the segmentation callback be changed and moved to libosmo-netif, so we remove it here. This reverts commit 2c59d1285e8f4c47122e1749ff1ac60e99a1874e. Related: OS#5753 Change-Id: I9b380326c63587fc79d6a5d8cd458188074fc55d
2023-07-17gsm0502.h: Document spec numberPau Espin Pedrol1-1/+6
Change-Id: I3a3fdde39a4f3927516b9c160c04144764800fda
2023-06-25gsm: add gsm0502_fn2ccch_block()Vadim Yanitskiy1-0/+2
This API is useful for checking whether a Downlink CCCH block belongs to PCH or AGCH. We need this API in osmo-bts.git and osmocom-bb.git. Change-Id: I8cbd31226754e95887358ed83a928e2f567f4cf3 Related: OS#5500
2023-06-21Add VGCS UPLINK GRANT message structure to gsm_04_08.hAndreas Eversberg1-0/+7
Change-Id: I8a16ce4ddc7a36e0db2936227a910b4d53cddfca
2023-06-19gsm/ipa: Add segmentation callbackarehbein1-0/+3
Add segmentation callback to be used by the streaming backend of libosmo-netif Related: OS#5753, OS#5751 Change-Id: I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f
2023-06-09ASCI: Add Notification/NCH message to gsm_04_08.hAndreas Eversberg1-0/+8
This message is (the only message) used on the NCH to notify the MS about all currently ongoing voice group/broadcast calls. Change-Id: Iff1555a2914ce0a1ead6ab883498adb2c33b135e
2023-06-09Fix short L3 header of SI 10 at gsm_04_08.hAndreas Eversberg1-3/+3
Change-Id: I1c3002716b08e31016cc6e623f8f8a413ef7916f
2023-06-09Add short L3 header to gsm_04_08.hAndreas Eversberg1-0/+17
Change-Id: I0eceb380e401e1f842edbaa92f4b4738703a031c
2023-06-09ASCI: Add message definition and encoding according to 3GPP TS 48.008Andreas Eversberg2-2/+242
Change-Id: Ib94c64136c31ce4af67c314a8550d93946cc844f
2023-06-08improve API for osmo_routing_area_idNeels Hofmeyr1-1/+6
Code review for [1] has asked for providing proper API for struct osmo_routing_area_id. For historical reasons, we have struct gprs_ra_id and struct osmo_routing_area_id serving the exact same purpose: represent a decoded 3GPP TS 24.008 § 10.5.5.15 Routing area identification. The "better" one is struct osmo_routing_area_id: it allows using API like osmo_plmn_cmp(), because it is made up of meaningful sub-structs. Implement de/coding using the functions already available for the sub-struct osmo_location_area_id, and simply add the RAC. Add a test in gsm0408_test.c. Note that other utility functions are already available for struct osmo_routing_area_id: osmo_rai_name2(), osmo_rai_cmp(). There is no real need to deprecate struct gprs_ra_id, because there is not really anything wrong with it. It just isn't as well integrated with other utility API as struct osmo_routing_area_id is. Just add comments. [1] osmo-hnbgw.git: cnpool: extract Mobile Identity from RANAP payload https://gerrit.osmocom.org/c/osmo-hnbgw/+/33133 I373d665c9684b607207f68094188eab63209db51 Change-Id: Ic5e0406d9e20b0d4e1372fa30ba11a1e69f5cc94
2023-06-02ASCI: Add IE transcoding according to 3GPP TS 48.008Andreas Eversberg1-0/+179
Change-Id: Ic1fc714bb04228a7f32e9925811e21c8efc610bd
2023-06-02ASCI: Add 3GPP TS 44.068 and 44.069 protocol definitionsAndreas Eversberg2-0/+137
Change-Id: I3554cea47e714c8fca18c3e9c0e6e80695915a90
2023-05-22gsm_04_08_gprs: add IEI "GMM TMSI Based NRI Container"Neels Hofmeyr1-0/+1
OsmoHNBGW will need to obtain the NRI from GMM Attach Request and GMM RAU Request to implement CN pooling. Related: SYS#6412 Change-Id: Id661abfdb2c81a92c9046542bbc08d6ccd39f073
2023-05-22gsm_08_58.h: Add 'struct rsl_ie_nch_drx_info'Harald Welte1-0/+17
This adds the definition of 'struct rsl_ie_nch_drx_info' representing the bit-field of the 'NCH DRX Information IE' of A-bis RSL. Change-Id: I9586b5cb8514010d9358fcfc97c3d34741294522 Related: OS#5781
2023-05-22cosmetic: Fix spec reference in RSL header fileHarald Welte1-1/+1
Change-Id: I671ee927b49099f7c8cc1fbd5f8b19f94ba1af81