aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-11-28logging: ensure ANSI color escape is sent in same line/before newlineManawyrm2-4/+11
This fixes multi-line color clobbering in logging daemons like systemd-journald, which work with single-lines only. Change-Id: Ia7de9d88aa5ac48ec0d5c1a931a89d21c02c5433 Closes: OS#6249 (cherry picked from commit 11a416827dd9f2da6b7c1db0e1e83adb1e6e5cc8)
2023-09-12Bump version: 1.8.0.252-13c29 → 1.9.01.9.0Pau Espin Pedrol16-60/+335
Change-Id: I6f8eccbccb73c6c094f13f2d4bdee931cf5b9010
2023-09-12ASCI: Add definition for TALKER INDICATION and UPLINK RELEASEAndreas Eversberg1-0/+12
Change-Id: I5ab196d46cdee160e59ee4ecf72c79aa1b25815f
2023-09-12LAPDM: Use correct offset to short header on recevied frameAndreas Eversberg1-1/+1
The offset of the short header on main DCCH is 0, not 2. Change-Id: I8345776768fdf2a700b2ca1d117f9ef4b15777cc
2023-09-12ASCI: Add BCC call state definitionsAndreas Eversberg2-4/+4
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 Yanitskiy2-2/+2
Change-Id: I35ee30978820f2038f562b7703ca886852a4f708 Fixes: a7d7cf28 "gsm_12_21.h: add flags for NM_ATT_IPACC_SUPP_FEATURES"
2023-09-08socket: Support setsokopt SCTP_INITMSG in osmo_sock_init2_multiaddr2()Pau Espin Pedrol2-0/+66
This allows setting several socket paramets which can only be set before SCTP INIT phase (connect()). Since no release with osmo_sock_init2_multiaddr2() happened yet, we are allowed to extend struct osmo_sock_init2_multiaddr_pars without bumping the version field. Related: SYS#6558 Change-Id: Ibc55932d954279927d1e70ccce1e8bf32b180d44
2023-09-08socket: Remove OSMO_SOCK_F_SCTP_ASCONF_SUPPORTED, add ↵Pau Espin Pedrol4-13/+79
osmo_sock_init2_multiaddr2() The OSMO_SOCK_F_SCTP_ASCONF_SUPPORTED flag was added recently to enable use of ASCONF in osmo_sock_inti2_multiaddr. Since we didn't release yet, we are still in time to get rid of this flag. It turns out that we'll want to add more features which must be set before SCTP INIT (connect()) time, like setsockopt SCTP_INITMSG, which in turn contains a struct with several parameters. Hence, adding flags for all those makes no sense. Instead, add a new API which allows passing an extensible struct which allows much more fine-grained setup from the caller. The new struct "pars" parameter is non-const on purpose, in order to be able to extend the struct in the future if we wish to get/obtain some data from the socket. Related: SYS#6501 Related: SYS#6558 Change-Id: I1f6fd09a79b0a2bd794e5669d933be25bbf1eeaa
2023-09-05gsm_12_21.h: add flags for NM_ATT_IPACC_SUPP_FEATURESVadim Yanitskiy3-0/+194
Change-Id: Ia4208e10d61843dd6ae77398f6624c918dc81ea4
2023-09-04tests/{v110,gsm44021}: change naming: 'test_' -> '_test'Vadim Yanitskiy8-30/+30
Ensure that the test binaries do not show up in `git status`: tests/gsm44021/test_frame_csd tests/v110/test_frame tests/v110/test_ra1 The new naming complies to the 'tests/*/*_test' pattern in .gitignore. Change-Id: I7bbcec2ec6887a2e6c9b37e2e5b3d9ee489654ce
2023-09-04.gitignore: add include/osmocom/core/socket_compat.hVadim Yanitskiy1-0/+1
Ensure that this auto-generated file does not show up in `git status`. Change-Id: Id7c245579f5a3288a9ea62589ca802e427e54720
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-31osmo_io: Use local variable to reference msghdr->msgDaniel Willmann1-7/+8
Change-Id: I336ef7a5460dd18bf8e0f4ac5e97747f9fec5a35
2023-08-31osmo_io: Change parent of msghdr to iofd (instead of msg)Daniel Willmann1-1/+1
msg was made a parent of msghdr after discussion in change I3a279b55a3adff96948120683c844e1508d0ba94 It turns out this violates some assumptions made in osmo_io, specifically that the user read callback shall free msg, but we expect msghdr to remain valid until after that callback returns. In general I think it is cleaner to make iofd a parent of msghdr. Change-Id: I41277190e3020cd8fa625bd57a743973e2a65c4b
2023-08-31debian: fix build on ubuntu 20.04 without liburingOliver Smith2-4/+5
Ubuntu 20.04 is based on debian 11, but does not have liburing. Extend the logic to cover this distribution too, so building packages for it isn't stuck anymore on libosmocore not being able to resolve the liburing-dev dependency. I have verified that this makes libosmocore properly build with/without liburing on debian 10, 11 and ubuntu 20.04 and 22.04. Fixes: e486e012 ("debian: depend on liburing-dev for debian >= 11") Change-Id: If18d6543fae9537c8b188e90499491bda3fdfe59
2023-08-30ns2: Add VTY option to change the max write queue size for UDPDaniel Willmann4-0/+43
Ensure that existing binds are updated as well. In some cases the default max length of the osmo_io txqueue could be too small. Set it to 128 by default and add a VTY option to change it for an NSI (program-wide). Change-Id: I993b87fd6b83b3981f5e293f70b931075afec715 Related: SYS#6550
2023-08-29contrib/libosmocore.spec: centos7: disable uringOliver Smith1-1/+13
liburing is not available in CentOS 7, so disable it there. I've verified that this works as expected in our OBS with CentOS 7, 8 and openSUSE Tumbleweed. Related: OS#5751 Change-Id: Ie2399754952d460499c9355706be37f792988bac
2023-08-28socket: Avoid aborting socket creation if setsockopt for ASCONF failsPau Espin Pedrol1-2/+4
Avoid aborting the entire socket creation, since those sockopt are fairly new in the kernel (v5.4), and the feature can still be enabled in older versions system-wide with sysctl. The worst it can happen is that the ability to submit address updates (such as Peer Primary Address) doesn't work, which is not really critical. Related: SYS#6501 Change-Id: Iff261c8592b6b3c4237c90c84b4e8e921e3c4a65
2023-08-24osmo_io: Add io_uring backendDaniel Willmann8-3/+476
Change-Id: I5152129eb84b31ccc9e02bc2a5c5bdb046d331bc
2023-08-24debian: depend on liburing-dev for debian >= 11Oliver Smith2-1/+13
Prepare for the io_uring backend, by conditionally depending on liburing-dev on debian >= 11 based distributions. On debian 10 based distributions, set --disable-uring as configure flag. Closes: OS#6143 Related: https://askubuntu.com/a/761943 Change-Id: If7832baec0bddbe0bbbbfe07f77bba3deb328d5c
2023-08-24osmo_io: Avoid potential double free when sending msgbDaniel Willmann1-8/+15
Ensure that a msgb has the proper talloc parent: All msgbs inside an iofd get the iofd as parent. Received msgbs are reparented to iofd->msgb_alloc.ctx (which was set in osmo_iofd_setup()) before being passed to the receive callback. Before this change the code could fail for msgbs that are submitted via uring where the (failed) write returns after the iofd has already been osmo_iofd_free()d. free()ing the iofd is deferred until the write completes, but the (iofd) parent context could have been free()d in the meantime. Change-Id: I3a279b55a3adff96948120683c844e1508d0ba94
2023-08-24osmo_io: Add iofd_handle_recv()Daniel Willmann3-12/+18
Handle msg reception in a common function that can be called from the different backends. Change-Id: Ifc407d446805f885d37767f421ff710cb276a01f
2023-08-24lapdm: Update public lapdm_msg_ctx upon CCCH data indPau Espin Pedrol1-0/+2
This allows uses accessing the updated fields such as fn from the l3_cb when receiving a msg from CCCH, eg: "le->datalink[DL_SAPI0].mctx.fn;" Related: OS#3626 Change-Id: Icabc3759c47b0f7cfe61f1b7a96f08f36714262e
2023-08-23Revert "rsl: Introduce new osmocom extension IE RSL_IE_OSMO_ABS_FRAME_NUMBER"Pau Espin Pedrol2-2/+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 Pedrol5-55/+13
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-23select: Prevent negative index lookup on osmo_fd_lookup.tablearehbein1-1/+1
Marked as WIP because I'm not entirely sure if negative index lookups were allowed on purpose (although I doubt it) Change-Id: Iba81873cbc435229599b1a8139cf4b627f8e6924
2023-08-21lapdm: Append RSL_IE_OSMO_ABS_FRAME_NUMBER to RSLms msgs towards upper layersPau Espin Pedrol5-13/+55
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 Pedrol2-0/+2
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-21socket: Add osmo_sock_init flag to enable SCTP ASCONF featuresPau Espin Pedrol2-0/+55
The SCTP_ASCONF_SUPPORTED sockopt, which enables ASCONF features for the SCTP associations managed by the SCTP socket, gets its default value from to sysctl "net.sctp.addip_enable", which, at least up to current kernel 6.4.8 is set to "0" (disabled) by default. As a result, ASCONF related features such as setsockopt(SCTP_SET_PEER_PRIMARY_ADDR) fail with -EPERM since ASNCONF extensions where not negotiated during the SCTP init handshake. This commit adds support for setting SCTP_ASCONF_SUPPORTED=1 during socket creation, since that needs to be applied before the first bind()/connect() (before first assoc is created). Furthermore, for ASCONF features to work properly, the assoc also needs to announce/use the AUTH extension, as per RFC5061 section 4.2.7. Otherwise, the peer receiving an SCTP INIT with ExtensionFeatures=ASCONF,ASCONF_ACK but without AUTH, will reject the assoc with an ABORT since it's not complying with spec (this behavior can be tweaked through sysctl "net.sctp.addip_noauth_enable"). The AUTH extension is enabled through sockopt SCTP_AUTH_SUPPORTED, and its default value is that of sysctl "net.sctp.auth_enable", which is also disabled (0) by default. Kernel support for those is relatively new: SCTP_FUTURE_ASSOC added in: 80df2704a375bb4b3c9c5cce9c00052361b16d61 Follows: v5.0-rc4 Precedes: v5.1-rc1 SCTP_ASCONF_SUPPORTED added in: df2c71ffdfae58961981d7cbcccea93688fc4e96 Follows: v5.3-rc5 Precedes: v5.4-rc1 SCTP_AUTH_SUPPORTED added in: 56dd525abd56f7acd7b44a52935726e3ada4916c Follows: v5.3-rc5 Precedes: v5.4-rc1 Related: OS#6076 Change-Id: Iac07031927b66a9d32d2bb2faab817e4c922a359
2023-08-11gsm: Introduce functions to convert between FN and RFN (Reduced FN)Pau Espin Pedrol4-0/+75
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 Pedrol3-2/+6
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 Pedrol2-0/+11
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-08-10gprs_bssgp_rim: add decoder for RIM ROUTING ADDRESSPhilipp Maier3-13/+36
We have a decoder for RIM ROUTING INFORMATION (bssgp_parse_rim_ri), let's also have a decoder for RIM ROUTING ADDRESS (bssgp_parse_rim_ra. Related: OS#6095 Change-Id: Ibca1f08906c4ffeecdae80d4e91c6c7b05fe4f8a
2023-08-10gprs_bssgp_rim: allow sending of encoded RIM messagesPhilipp Maier3-0/+21
The API function bssgp_tx_rim() accepts decoded RIM PDU structs, encodes them and eventually sends them. However, there may be cases where the RIM PCU already exists in its encoded form. (This is in particular the case when the RIM PDU is forwarded from GTP to BSSGP) Lets add an API function bssgp_tx_rim_encoded to allow sending of already encoded RIM PDUs Related: OS#6095 Change-Id: Id4a793bbaf32d7b9d894dcc5be3faaf2f2d91d82
2023-08-10gprs_bssgp_rim: also print NSEI when sending RIM messagesPhilipp Maier1-2/+2
In bssgp_tx_rim we print source and destination address of the RIM message we send, but we do not print the NSEI, even though this is also an important address parameter. Related: OS#6095 Change-Id: I2595abff28fc1d89c1409a2ca0194fedc6f15313
2023-08-09cosmetic: lapdm: Fix typo in commentPau Espin Pedrol1-1/+1
Change-Id: I5cf9aea6ba072bd1ccb3e894c0a311844bcad8df
2023-08-08osmo_io: Use MSG_NOSIGNAL to avoid SIGPIPE on writeDaniel Willmann1-1/+1
Change-Id: I85433124a8e80fc2aa19b551bdaf2655ef1eea2c
2023-08-08osmo_io: Ensure correct ownership of msgb when sendingDaniel Willmann1-0/+2
Use talloc_steal() if a msg is passed in to osmo_io when sending. This avoids the message being free()d early in case the original parent is free()d. Change-Id: Ie36bd68a8bd63e67d76fb41996f8fdf99f51d96c
2023-08-01sockaddr_str: Introduce macro OSMO_SOCKADDR_STR_FMT_ARGS_NOT_NULLPau Espin Pedrol1-4/+9
Under certain cases, gcc version 13.1.1 20230714 catches the fact that the pointer being passed cannot be null, (eg local variable struct osmo_sockaddr_str addr_str passed as &addr_str), and errors about checking nullability of a pointer which cannot be null. """ /include/osmocom/core/sockaddr_str.h:63:10: error: the address of 'addr_str' will always evaluate as 'true' [-Werror=address] 63 | ((R) && (R)->af == AF_INET6)? "[" : "", \ | ^ """ Let's add a macro which can be used for pointers known to be there (tbh, I'd expect that to be the usual case in most code paths). Using this new macro should be more optimal in those cases, and avoid gcc erroring. Change-Id: I59c7b05450cb463d2e87ddb022f0b6ba7109d398
2023-07-28isdn: mux_timeslot_provide_bits(): remove unused 'count'Vadim Yanitskiy1-3/+1
Change-Id: Id2c6d05c56424fa79ade84a29b8b70293dc690e4
2023-07-26ASCI: Add missing check for return value of gsm0808_enc_speech_codec_list2()Andreas Eversberg1-2/+8
Fixes: CID#318987 Change-Id: I771b8ee8dfe1588d0af1c4957489f723447a7054
2023-07-26gsm48_ie: fix gsm48_encode_bearer_cap(): encode bcap->data.transpVadim Yanitskiy1-1/+3
Currently this function is hard-coding the "Connection element (octet 6c)" (see Table 10.5.101h/3GPP TS 24.008) to "Transparent" (0). This breaks non-transparent data calls. Use the value from bcap->data.transp. The decoding equivalent of this function needs no changes, it does populate this field already. Change-Id: I7339908864e8a2aef6f2b48a108650167e413c7f Related: OS#6110, OS#4394
2023-07-25exec: osmo_system_nowait2(): Improve logging and error checksPau Espin Pedrol1-2/+13
Change-Id: I9b971dda389fe958627d41fa5ba6f45ee588bf99
2023-07-25gsm_08_08: define GSM0808_SCT_EXT (separately)Vadim Yanitskiy3-3/+10
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-18osmo_io: Fix length calculation in iofd_handle_segmentation()Daniel Willmann1-1/+1
We need to account for the fact that segmentation_cb() could have changed the length by calling msgb_pull(). Calculate the new len according to the new tail/data pointers. Change-Id: I5486ddc0d3345e92b20cbc6e5bcf2cefea3958c8
2023-07-18Revert "gsm/ipa: Add segmentation callback"arehbein3-33/+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-18osmo_io(cosmetic): End in a dot for doxygen AUTO_BRIEFDaniel Willmann1-24/+24
Change-Id: I397304eed524db12e60a6534d21ea268f304cfdc