aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-10-25add utils/osmo-gsm-sharkneels/gsm-sharkNeels Hofmeyr3-0/+3596
Change-Id: Ifdfd261f776d9bf2bbfb0a584deac3e9a11bfe47
2023-10-23socket.c: Fix compilation with --disable-libsctpPau Espin Pedrol1-0/+2
Fixes: 64ba9edf173cc16f9d94c94a423a8b7a5904efaf Related: OS#6234 Change-Id: I988d01461822d18b7350a6e69e3b504f7fd5b84f
2023-10-23LAPDm: Correctly count expiry of T200 during estabishment/releaseAndreas Eversberg1-4/+4
After T200 expires N200+1 times, the link establishment or relase fails. The counting must be performed prior check. Related: OS#5970 Change-Id: Icf44e26420fc91312e7c8972a2f3ed475e42fc48
2023-10-20write_queue: Fix Doxygen commentarehbein1-1/+1
Change-Id: Ib2508411ae46e2456466beaae63d3f401e34d0d4
2023-10-20osmo_io_poll: Handle -EAGAIN in case of OSMO_FD_WRITEarehbein1-0/+4
Related: OS#6213 Change-Id: I59c86370d13f2bb33c289d1b177df895726975cb
2023-10-17gsm48_ie.c: change bearer cap structure in outgoing CSD callsManawyrm2-2/+2
Outgoing CSD calls were previously encoded with the Bearer Capability 1 - Octet 4 "Structure" field set to 3 - Unstructured. Many Nokia, Sony Ericsson and Huawei devices won't accept incoming CSD calls with these bits set. Set them to 0 - Service data unit integrity for now, which seems to work and make all tested devices happy. Change-Id: Ieb5bca3d3578abd28e18808752e1c312ce7c4ce0
2023-10-17gsm48_ie.c: add 3.1kHz audio bearer capability for CSD callsManawyrm1-0/+2
GSM48_BCAP_ITCAP_3k1_AUDIO should be handled just like fax or unregistricted digital CSD calls. The transfer capability just indicates that an (external) interworking function should convert the call into an analog modem call on the network edge. The CSD call is still regular V.110/RLP non-transparent data. Change-Id: I44b76be0f6a891bc1d8f55ede1ef140ea0a19e3d
2023-10-13gsmtap: Hide implementation of gsmtap_instarehbein4-16/+34
- Use forward decl. of struct gsmtap_inst in header - Remove 'static inline' attributes from gsmtap_inst_fd() declaration, move function definition to gsmtap_util.c and mark it as deprecated - Add gsmtap_inst_fd2() as replacement for gsmtap_inst_fd() Related: OS#6213 Change-Id: Ibe1a51205a6df764571b6d074e365825555609a5
2023-10-05Fix typo in libosmocore.mapPau Espin Pedrol1-1/+1
Fixes: 64ba9edf173cc16f9d94c94a423a8b7a5904efaf Change-Id: I0fb13fb4ef8160f3ac2cb1cb4dd6ea57fd04b5be
2023-10-03socket: Introduce APIs osmo_sock_multiaddr_{add,del}_local_addr()Pau Espin Pedrol4-1/+157
These APIs are used to bind or unbind an active socket adding or removing addresses from the existing set. Related: OS#6077 Change-Id: Ifc6e7d643c2a0c53f479bfd0d5c36d08c0c01953
2023-09-29osmo_io: Clean up codearehbein1-1/+1
- Remove osmo_io_init() from header, since it has no function definition - Add osmo_iofd_init() to header Change-Id: I77f7ae2b211507f420d87c484ec75ee054fceb63
2023-09-28osmo_io: Only allow reading/writing if the relevant callback is setDaniel Willmann1-1/+30
Allow the callbacks to be NULL, but then sending/receiving is disabled. There are some cases where we only care about writing to or reading from an fd. Change-Id: I11ce072510b591f7881d09888524426579bd0169
2023-09-27osmo_io: Init struct msghdr to zeroDaniel Willmann1-4/+6
Avoid uninitialized read, found with valgrind Syscall param recvmsg(msg) points to uninitialised byte(s) at 0x49FD865: __recvmsg_syscall (recvmsg.c:27) by 0x49FD865: recvmsg (recvmsg.c:41) by 0x4891FAE: iofd_poll_ofd_cb_recvmsg_sendmsg (osmo_io_poll.c:66) by 0x48921B2: iofd_poll_ofd_cb_dispatch (osmo_io_poll.c:119) by 0x48941F1: poll_disp_fds (select.c:419) by 0x4894299: _osmo_select_main (select.c:457) by 0x4894304: osmo_select_main (select.c:496) by 0x10DC3E: test_segm_ipa_stream_srv_run (stream_test.c:628) by 0x10E2A5: main (stream_test.c:879) Address 0x1ffefffa68 is on thread 1's stack in frame #1, created by iofd_poll_ofd_cb_recvmsg_sendmsg (osmo_io_poll.c:45) Change-Id: I21114ad57784126cfdeb4a932ed44dbf23946fbe
2023-09-26gsm: rename s/gsm0502_fn_compare/gsm0502_fncmp/Vadim Yanitskiy2-14/+14
Change-Id: Ie8bb9c49c6f81b8f4a1766547d6943f9880d1186 Related: OS#5500
2023-09-26sockaddr_str.h Fix OSMO_SOCKADDR_STR_FMT_ARGS_NOT_NULL syntax errorPau Espin Pedrol1-1/+1
It's fine changing the define because due to the previous error it means basically that it was never used so far, because using it triggers a compilation error. The error was introduced because I ended up not using this in the past after submitting this code, and now that I want to use it it went noticed that it fails. Change-Id: Iee361d740845257fa62c9093e30e8079fa933827
2023-09-25gsm: add gsm0502_fn_compare() for comparing TDMA FNsVadim Yanitskiy2-0/+39
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-24APDU parsing support for GlobalPlatform GET RESPONSEKarsten Ohme1-0/+1
This patch adds GET RESPONSE support for GlobalPlatform command. Android is using this to get the response data on SGP.22 eUICCs. simtrace2-cardem-pcsc is failing otherwise e.g. on an xingtera camera with Android. Change-Id: I5ae3165f172f9c949550ee4a07fe70e91f1a037c
2023-09-20gsmtap.h: Add definitions for ISDN PPP sub-typeManawyrm1-0/+1
This change adds a new sub-type for PPP in GSMTAP_TYPE_E1T1. Change-Id: I17137167b2c74b6c5e53459743b6e140fc1a4386
2023-09-19write_queue: Enable updating max_length fieldarehbein4-0/+74
Dequeue and free any excess messages, in case the new queue length is shorter than the old. Related: OS#5774 Change-Id: Ibfe51a2faf29f8ae160a9c330c9af0d09b5a9002
2023-09-18gsm/protocol/gsm_04_11.h: add SMSC-address length limit definitionsMychaela N. Falconia1-0/+10
Change-Id: Iea5c29909c5be80f81dbbc2873656ff5cf590a5d
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