AgeCommit message (Collapse)AuthorFilesLines
2 daysipaccess: Fix wrong assertion in ipaccess_drop() when used by BTS codeHEADmasterPau Espin Pedrol1-7/+17
The code wrongly assumed that ipaccess_drop was only called by BSC code, which is wrong. ipaccess_drop is called by BTS run code path in __handle_ts1_write(), if send() syscall fails (for instance because BSC becomes unreachable). In that case, we need to account for the BTS role case which doesn't store the line pointer into the ofd->data. In BTS case, it's a pointer to the struct ipa_client_conn, which we leave up to sign_link_down() cb to do whatever they please with. Fixes: OS#4864 Change-Id: If763e5f7736921a4360ad9027ba075ef8e118934
3 daysipaccess: Fix log error printed on wrong conditional branchPau Espin Pedrol1-2/+4
The signal link is set if fd is established (see osmo_fd_setup in ipaccess.c). This log message was introduced in 466c5467e2e95c04260cb6b933181a38d1d97bd5, where the lifecycle worked a bit different than nowadays: line->ops->sign_link_down() was called before the log line, so the code expected by that time that the socket should have been freed by sign_link_down(). That's no longer the case. In ipaccess_drop, we force dropping so we release lower layers and then signal upper layers. Hence, the log lines are misleading nowadays. Change-Id: Ibc6554e6cacc9c71232238b4e6a17d749dfdd30a
4 daysipaccess: Use LOGPITS macro in __handle_ts1_writePau Espin Pedrol1-2/+3
Change-Id: Idce3bb3daf8ab16b84968a61502c826df8b773ed
2020-10-29cosmetic: fix spelling in logging messages: existAnt -> existEntVadim Yanitskiy2-2/+2
Change-Id: Ifb22b5544cf06012fa529828dfdf3f0d73b07e7d
2020-10-18Use OSMO_FD_* instead of deprecated BSC_FD_*Harald Welte9-73/+73
Change-Id: Ib676eda521f0e89a1f4d8f9eac810598a3c813b9
2020-10-12contrib/jenkins: Enable parallel make in make distcheckPau Espin Pedrol1-2/+2
Related: OS#4421 Change-Id: I54b084de6080ab8c438c2c85663abe01c54b07fe
2020-10-08vty: add attributes to VTY commands indicating when they applyPhilipp Maier1-47/+59
Change-Id: Ie0182351bd8a10085563c403dfab04c4d1b4305c Depends: libosmocore I0efc57f2cb54798ba207ae6fef9af4771d96bfa9 Related: SYS#4937, OS#1601
2020-10-04vty: use install_lib_element() and install_lib_element_ve()Vadim Yanitskiy2-26/+26
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html. Change-Id: I22a8075852ba97edf819b368e3af4eddbf1dbae0 Depends: I8baf31ace93c536421893c2aa4e3d9d298dcbcc6 Related: SYS#4937
2020-09-09tests: Disable stderr log color in trau_sync_testPau Espin Pedrol2-14/+14
Change-Id: Ibe8e2d580848a41dd25e0ae2d95f83233be6ed9a
2020-08-29Revert "debian: Build libosmo-abis with osmo-e1d support"Harald Welte2-7/+0
This reverts commit f62da4798c271ff56a8f2a2aebefdf5281231dde. It introduced lots of fall-uot in osmo-remsim, smo-hlr, simtrace2 OBS builds: [ 432s] libtool: link: ranlib .libs/libifd_remsim_client.a [ 432s] /bin/sed: can't read /usr/lib/i386-linux-gnu/libosmo-e1d.la: No such file or directory [ 432s] libtool: error: '/usr/lib/i386-linux-gnu/libosmo-e1d.la' is not a valid libtool archive [ 327s] libtool: link: ranlib .libs/libosmo-gsup-client.a [ 327s] /bin/sed: can't read /usr/lib/i386-linux-gnu/libosmo-e1d.la: No such file or directory [ 327s] libtool: error: '/usr/lib/i386-linux-gnu/libosmo-e1d.la' is not a valid libtool archive [ 327s] Makefile:456: recipe for target 'libosmo-gsup-client.la' failed Change-Id: I63596664ae709e0059312c65b79d4bd8e53d56e2
2020-08-24debian: Build libosmo-abis with osmo-e1d supportHarald Welte2-0/+7
We've supported building with osmo-e1d support for quite some time, but our Debian packages have not been upgraded to include that support. Let's change that. Related: OS#2547 Change-Id: I2f365c3fbd44457033e922257cf040408d0c7058
2020-08-14Fix RPM spec file (.so.6 -> .so.9)Harald Welte1-1/+1
Change-Id: I987757d8b8fa3908b5b9d690ce7a5a67e2254546
2020-08-13debian/control: change maintainer to the Osmocom team / mailing listVadim Yanitskiy1-1/+1
Change-Id: I8bd677d2028677efbd6913adefa92066af67d5c6
2020-08-13Merge branch '1.0.0' into masterHarald Welte7-26/+94
We tagged 1.0.0 off a non-master version in the commit history in order to keep the new TRAU frame handling out of the 1.0.0 release, but to have all of the other fixes in a tagged release. This merge brings master in sync with those changes. Change-Id: If8fc996f385f4127204ad773b991c49d853dfc5b
2020-08-13Bump version: → Welte7-25/+93
Change-Id: Iffbb96739f53c7e005f440bc1615f158f7c661eb
2020-08-07trau_sync: make sync pattern configurablePhilipp Maier2-1/+9
When a trau sync fsm is allocated, the user must set the sync pattern, which can not be changed during the whole fsm lifecycle. However on codec changes it might be necessary to change the sync pattern on the fly. - Add function to change the sync pattern Change-Id: I1caff93b4c8eace8ba8cd6e32e996a9e1503232b Related: OS#2659
2020-08-06trau_frame: Add missing break statement in osmo_trau_frame_encode()Harald Welte1-0/+1
Change-Id: I986781218a844e043b6206124696452b3afec7fd Closes: CID#211592
2020-08-06trau_sync: Check return value of osmo_fsm_register()Harald Welte1-1/+1
Change-Id: Ieaf524423033864a8b79ea1b04b62568d10ffbd3 Closes: CID#211593
2020-08-06trau_frame: Fix computation of odd parity while encoding HR framesHarald Welte1-1/+1
division modulo 1 is always 0, and hence we always returned '1' as parity bit. Instead, we need to check if the LSB is set in order to know if the number of bits is odd or even. Change-Id: I37af702ba020a90a820bae84cb603e187ebbacb5 Closes: CID#211594
2020-08-04Add missing build dependency to libosmocodec-devHarald Welte3-2/+4
Since I0190872dd282bcfe0f97bb4f8ab8d09023f9f06b we are using a header file provided by libosmocodec, which means we need to add it to our dependencies (and include path). Linking against the library is not required, as we don't use any symbols at this point. Change-Id: Ie4524165d8873f6c801e07d9f03c94f43c66110d
2020-08-03Add 'trau2rtp' demo program illustrating the use of new TRAU codeHarald Welte8-0/+442
This is just for development and hence in 'contrib', and not built by default. For details, see the included README Change-Id: I0190872dd282bcfe0f97bb4f8ab8d09023f9f06b
2020-08-03TRAU frame RTP conversionHarald Welte4-2/+694
This adds code that converts codec frames between (decoded) TRAU format and RTP payload format. The FR + EFR functions have been lifted from OsmoNITB and exended slightly. The HR functions have been written from scratch. There is also incomplete code for AMR that needs to be completed + tested. Change-Id: I7f6993cce2b95318203043e2e14952e581941b79
2020-08-03trau_sync: prevent false positive synchronization on startupPhilipp Maier1-0/+6
The history buffer is filled with zeros on startup. Together with incoming bits those may appear as a valid signal. (each trau frame begins with 16 zeros). In order to prevent this lets set the history buffer to all ones, so that it looks like the data in the history buffer is from an unused timeslot. Change-Id: Ie5cc7b9a1ab3d8940ef9d2147f5999e8d09ee40e Related: OS#2547
2020-08-03Add new TRAU frame sync codeHarald Welte10-4/+712
This code is able to detect and sync against a variety of TRAU frame sync patterns. Focus is so far on those patterns present on 16k sub-slots, but 8k sub-slots are expected to be supported soon, too. A new codebase for this is required as the old OsmoNITB code had conflated a 16k sub-slot multiplexer with TRAU frame synchronization, so there was no way to separate those two parts and hence no way to support 8k sub-slots. Change-Id: Ia6fe6228b0b8b9a27999f37ce1115ed5558881ea
2020-08-03osmo_trau_frame_encode(): Check for sufficiently sized output bufferHarald Welte1-0/+37
Change-Id: Ie14399b2271aba9ff81f62d593a0ddd9d3e83d98
2020-08-03trau_frame: Introduce support for Downlink Time AlignmentHarald Welte2-40/+134
In the uplink direction, we provide osmo_trau_frame_dl_ta_us() to determine the time alignment as requested by the CCU in the BTS. In the downlink direction, the TRAU frame encoder will perform time alignment as requested by the user in osmo_trau_frame.dl_ta_usec. Change-Id: I3981becafc56c9a50119b9ba6bf67aa0391cc76e
2020-08-03trau_frame: New APIHarald Welte4-2/+1514
The old TRAU frame code in src/trau_frame.c (which is for some strange reason part of libosmo-abis, and not libosmo-trau!) was introduced more than a decade ago for the needs of bs11_abis AKA OpenBSC aka OsmoNITB. It is too constrained to implement TRAU frame parsing in a generic way, including: * no way to add support for 8k sub-slots * no way to handle CRC bits or UFI (i.e. no AMR) * no real API design, it was just ripped out from OsmoNITB and moved into a library (even the wrong one) For those reasons, let's introduce a new API for TRAU frame encoding/decoding - one that supports all the relevant use cases. Change-Id: I5cf42e6c445d9224be18503cebc7584b3beba08c
2020-08-02e1_input_vty: Fix VTY help stringsHarald Welte1-1/+1
* HSL was never fully supported, not sure why it's in the help * E1D was neglected to add to the help string Change-Id: I4a5e503676618171e59550774892816b61adecae
2020-08-02input/e1d: Add missing "RAW" timeslot supportHarald Welte1-0/+72
Change-Id: Ia4ef5fd40ce15f824a3cbfec533dde2169464c3b
2020-08-02input/e1d: Fix support for TRAU slotsHarald Welte1-0/+75
Change-Id: I2d7f85523089f4e1f2496d9836bced577eda4671
2020-08-02dahdi: Use osmo_revbytebits_buf() instead of local flip tableHarald Welte1-41/+8
We've had osmo_revbytebits_buf() in libosmocore for ages. As it recently turned out, the flip_bits[] lookup table approach implemented here is faster at least on x86 systems of the last decade or so. As of Change-Id I25029fe7e54c92979fb0119992fb8dc167e1536e in libosmocore, it has been migrated to the lookup table approach. This means there's no performance penalty of migrating to using it, and hence no reason whatsoever to have a private implementation here. Change-Id: I285a87a9fc6abae7d8b47923a46cd082f46829f8
2020-08-02contrib/jenkins.sh: Test builds with --enable-e1dHarald Welte1-1/+4
We so far didn't include the osmo-e1d e1_input driver during compile testing, let's change that. Change-Id: I8bb876f9f3aebbad80a328b5ebff6e156c3db8da
2020-08-02e1d: Fix compilation after I4a088f91f23aaad05c5ab84a4783c1915d85aca6Harald Welte3-4/+8
This slipped through the cracks as jenkins so far doesn't build with --enable-e1d support (fixed in a separate patch). Change-Id: I505331a4a9430001b049e9f5cc36abf4ce4ca19e
2020-07-31ipaccess: Fix use-after-free in ipaccess_drop()Pau Espin Pedrol1-0/+2
Recent commit b8ea0ff521a3e01c22a9dd1948b9a853521f575e introduced a heap-use-after-free while getting rid of memleaks and clearing up the reference counting lifecycle of the line object. In that commit, e1inp_line_put2() was added in ipaccess_drop() which may potentially free the line object (and its children e1inp_ts objects) under specific conditions/scenarions. However, the function still used the child object e1i_ts which in those scenarios would access already freed memory. Let's keep a local reference during the life of the function to make sure the object is non-freed during e1inp_line_put2(), so that we can notify upper layers that the link is down. Detected by enabling ASan and running BSC_Tests.TC_chopped_ipa_ping TTCN3 test. Related: OS#4688 Change-Id: I4f56af28ad8297846bcdc8ba7afe51fff0f9a00f
2020-07-22e1d: Add new osmo_e1dp_client_ts_open() argumentHarald Welte1-3/+3
An additional argument was added to specify the timeslot read buffer size. Change-Id: I4a088f91f23aaad05c5ab84a4783c1915d85aca6 Depends: osmo-e1d I6d603778cce14c5d72fe5f54904905ea7e66d7ff
2020-07-15tests: Use API e1inp_line_put2 instead of deprecated e1inp_line_putPau Espin Pedrol2-2/+2
Change-Id: If3fb68fda1c109f6aa15aa68c5bce285054efda7
2020-07-15lapd: Use lapd_dl_init2 instead of deprecated lapd_dl_initPau Espin Pedrol2-2/+2
Change-Id: If25957d10bf9e32d2fe601111a9c1311aee21094
2020-07-15cosmetic: lapd: Fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: I7a6af2f417f6f924a3f27cfa12462158f2c2a1c6
2020-07-15ipaccess_recvmsg: Untangle code updating linePau Espin Pedrol1-8/+13
This patch untangles the code a bit by changing the order where actions are taken and variables are assigned. The only real changes in behavour are the introduced assert, and that bfd->data is set to NULL before releasing the related line. Related: OS#4624 Change-Id: I947f64f8fa20f87fdc84538402623a6bcf35fdf9
2020-07-15ipaccess_recvmsg: Assert the new bfd from new line differs from the old onePau Espin Pedrol1-0/+1
Related: OS#4624 Change-Id: I45818e04af0da7b1109d909642a1ea378a85a636
2020-07-15ipaccess_recvmsg: Clean up release steps upon error conditionPau Espin Pedrol1-2/+5
Related: OS#4624 Change-Id: I47a3e477d6861620a741193d3d3d3e286836fd44
2020-07-15ipaccess: Set bfd->data to NULL before releasing its referencePau Espin Pedrol1-0/+2
Since the reference is dropped, make sure no one accesses it through that pointer anymore. It must be done before calling the put() method, otherwise it may already be released when put() returns. Change-Id: Ic3f261b2a995efcbc8eece9669ee3ae63af7b5c0
2020-07-15ipacces: Fix e1inp_line reference put in ipaccess_closePau Espin Pedrol3-23/+15
Drop the function e1inp_close_socket since it's only used by the caller at hand, and it's only exported through "internal.h", so no app is using it. Remove it because there's only a caller, and furthermore because keeping it (and putting bfd->data==line) would introduce a layer violation because the bfd->data==line is only used for ipaccess so far. Triggering path: handle_ts1_read ret=0 "Sign link vanished" ipaccess_drop line->ops->sign_link_down (osmo-bsc) ipaccess_drop_oml e1inp_sign_link_destroy link->ts->line->driver->close ipaccess_close Related: OS#4624 Change-Id: If23cc722106a9f70c998e591369a4acafa52c519
2020-07-15ipaccess: Drop e1inp_line reference in ipacess_drop()Pau Espin Pedrol1-0/+7
the bfd->data handles a reference to the e1np_line (obtained through e1inp_line_get() during bfd setup), so remember to drop it under this condition. Related: OS#4624 Change-Id: I418064df04872befe2e936e21768b6ea01263120
2020-07-15e1_input: Use osmo_use_count in e1inp_linePau Espin Pedrol7-54/+85
osmo_use_count is available since libosmocore 1.1.0 release, so bump required libosmocore version in autotools and packages. struct e1inp_line field refcnt is kept in order to keep ABI compatibility accessing struct fields. The new use_count is added at the end. Size of struct changing is fine since it is allocated through an API and a pointer should be used by clients. e1inp_line_clone API is changed but it's not used by anyone outside libosmo-abis, so it's fine. Related: OS#4624 Change-Id: I0658b2e9c452598025cc0f1d0b060076171767cc
2020-07-15cosmetic: e1_input.h: Fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: Ie323a28409a44aeeef6646b247f244d278758f66
2020-07-14ipaccess: Fix log formatting of RESP_ID IPA attributesPau Espin Pedrol1-2/+2
Change-Id: Id5b4c39737a43c9ba68f3aacc889c10eba697920
2020-07-14ipaccess.c: Drop repeated ipaccess_keepalive_fsm_cleanup in write error pathPau Espin Pedrol1-1/+0
The function is already being called by ipaccess_drop(). Change-Id: I00d0557fe81861d4b913a4c76e4b56f93e656103
2020-07-04subchan_demux: Fix out-of-bounds writeHarald Welte1-23/+25
We cannot blindly append two ubits to the 320-ubit sized buffer. In the end, we may already fill the buffer after the first ubit, causing a buffer overflow with the second ubit. Lets check if the buffer is full after every bit. Avoid copy+pasting but move the code repeated per bit to a new function. Change-Id: I58d946265372278051e4f29301d4f201ab98c0fc Closes: OS#4648
2020-07-03input/dahdi.c: Don't simply read beyond end of msgbHarald Welte1-2/+20
Let's first add two bytes to the msgb before writing. This way we would assert in case there was no tailroom. As we just added tailroom in the previous patch of this series, we are fine Change-Id: If84b31ea9a3fc7a6c8768918efed2822d1d58427 Closes: OS#4644