aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-08-28stream: Add and use IPA send functionarehbein/stream_tests_timestamp_behaviorarehbein5-14/+57
Related OS#5753, OS#5751 Change-Id: I61e1fe59166c46595efe8c1f32b8f2607cb6c529
2023-08-28stream: Add client-side (segmentation) support for IPAarehbein6-11/+317
With this commit, IPA segmentation is taken care of by setting the segmentation callback provided by libosmo-netif. The ipa-stream-server example needs to prepend IPA headers now because those are stripped by the segm. cb on both sides. Depends: libosmocore.git I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f Related: OS#5753, OS#5751 Change-Id: I822abf52c6ae396c90b5c50228a0a39c848d3de6
2023-08-28stream: Add server-side (segmentation) support for IPAarehbein5-10/+363
With this commit, IPA segmentation can be taken care of by setting the segmentation callback osmo_ipa_segmentation_cb(). Depends: libosmocore.git I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f Related: OS#5753, OS#5751 Change-Id: I6c91ff385cb5f36ab6b6c96d0e44997995d0d24c
2023-08-07ipa: Add segmentation callbackarehbein2-0/+76
Related: OS#5753 Change-Id: I87ef4c7023126b783dd79e7ed47be31e1b76f975
2023-08-07examples: Add extension header octet to examplearehbein3-2/+10
Mainly to make data/packets look (pseudo-)correct in Wireshark. Also: Add helper for allocating message buffers with extended headroom for IPA. Change-Id: I962b9edcba65cdc98da00d2f8753dc5acd481502
2023-08-04stream: Split cli/srv specific code out of stream.cPau Espin Pedrol6-1786/+1938
The dev/user in general is only interested about one side of the stream when looking at the code. Since the stream.c file is tarting to be quite large/bloated, this patch splits its content into stream_cli.c and stream_srv.c to make it easier to improve/extend and review. Keep common code between cli and srv in stream.c, and add a private header to contain references to it. Change-Id: I22af01bba2040eb320ba48fd1b46c090c98be159
2023-07-25stream: Fix osmo_panic log fmtsarehbein1-4/+5
Change-Id: Id082a9473b788f8de20cdc2ba4430b3289f4ce5a
2023-06-30stream: Notify stream_cli on connect()Daniel Willmann1-0/+1
Change-Id: I29621ca53cdbdf8b5b2d128307fcb6432db669d3 Depends: Ieed10bc94c8aad821c0a8f7764db0e05c054c1e3 (libosmocore.git)
2023-06-27stream: Rename static function to have correct prefixPau Espin Pedrol1-2/+2
That function is used by the srv_link object, not the srv object. Rename it to avoid confusion. Change-Id: I1a3870b3a269b84ac2a9285ee6fe3389c5c96a94
2023-06-20stream: srv cb: Use osmo_sockaddr and improve logging when cli connectsPau Espin Pedrol1-18/+9
Specially important is the change where we now print the remote port which connected to us, not our local port (which is already printed as part of LOGSLNK). Change-Id: I6e556f8263496ded41bb221ccc8e193c5361697f
2023-06-20stream: Drop name param from recently added API osmo_stream_srv_create2()Pau Espin Pedrol4-9/+7
It was later decided that since setting a name is not really required, it is best to leave it out of the create() function and let the user use the osmo_stream_srv_set_name() API if needed (otherwise a dynamic name based on socket is selected) Change-Id: I5d677ef57b7db0aedd8c43282568c845097cb12b
2023-06-20stream: Drop recently added API osmo_stream_cli_create2Pau Espin Pedrol4-35/+23
It was later decided that since setting a name is not really required, it is best to leave it out of the create() function and let the user use the osmo_stream_cli_set_name() API if needed (otherwise a dynamic name based on socket is selected). Change-Id: I2a2fad318ef22c2ac117f95588a078ca3beccea5
2023-06-20stream: Print socket info as part of the logging contextPau Espin Pedrol3-10/+29
Since the local port is logged now in stream_test, it must be set to a specific value in order to have deterministic log output being validated. Change-Id: I17ef699dab72c1b613708070d22e9f040b0fe069
2023-06-20stream: Allow setting name printed during loggingPau Espin Pedrol5-32/+87
Depends: libosmocore.git Change-Id If2772a3ccaa98616e0189862a49ab0243435e343 Change-Id: I539a0d29d11348efe702f971965a55cf56db5c59
2023-06-17stream: Set state to closed before calling disconnect_cb()Daniel Willmann1-3/+5
Fixes recent crashes in ttcn-cbc-test Change-Id: I40ceb17c32d1f58f8d0eeda8d1d794cf3f478e83 Related: OS#6063
2023-06-16stream: Assert that fd is valid in stream_cli_handle_connecting()Daniel Willmann1-0/+1
This function should never be called if we don't have a valid fd. Change-Id: If0bed2bae556e0a8233e9e66e82c70a5c677fc3c Fixes: Coverity CID#321045
2023-06-16examples: Set logging level to DEBUG in {,ipa-}stream-{client,server}Daniel Willmann4-6/+4
Change-Id: I8c37bbe3db9823a399773d6790000ba508e79377
2023-06-15stream: Remove duplicated code in osmo_stream_cli_create()Daniel Willmann1-17/+1
Simply call osmo_stream_cli_create2() with name "" Change-Id: I0652361a6bdf194545f36edc5e12e5d26798163a
2023-06-15stream: Document osmo_stream_cli_create2()Daniel Willmann1-1/+7
Change-Id: I0c2f46e02d94c3459e4043a9db7fccd906521dd2
2023-06-15stream: Setup ofd in osmo_stream_cli_openDaniel Willmann1-6/+2
Don't reset the osmo_fd data in osmo_stream_cli_set_read_cb(). osmo_ss7_asp_restart() in libosmo-sccp calls osmo_stream_cli_set_read_cb() which causes the fd to be set to -1. osmo_stream_cli_open() which is called after that then doesn't close the old fd and opening the new one fails. osmo_fd priv_nr, callback and data are never modified in osmo_stream_cli so simply use these values in osmo_stream_cli_open() Change-Id: Id9b4db06d5ea1f29cbd1817cab3c71765ab30a53
2023-06-14examples: Use new stream API in {ipa-,}stream-{client,server}Daniel Willmann4-75/+20
Change-Id: I97a9979199c816686b32080534627f6f033e009e
2023-06-14Add osmo_io support to osmo_stream_cli and osmo_stream_srvDaniel Willmann2-29/+325
Change-Id: I2f52c7107c392b6f4b0bf2a84f8c873c084a200c
2023-06-14stream: Correctly close osmo_stream_cli when in state WAIT_RECONNECTDaniel Willmann1-0/+6
If cli is in STREAM_CLI_STATE_WAIT_RECONNECT cli->timer is scheduled. Delete the timer if osmo_steam_cli_close() called so we don't end up reconnecting. Also fixes the recent test failures in master-libosmo-sccp Jenkins jobs. Change-Id: Ic5227432192c4007f861f171ae961a8f4dea6522
2023-06-12stream: Use cli->state to check if cli is already closedDaniel Willmann1-1/+1
Change-Id: I92231528da08f8891e20c1226b61989a65e00ccd
2023-06-12stream: Factor out reconnection handlingDaniel Willmann1-31/+43
Change-Id: I418377eabd465ee4ffce9b4440e96287c7734924
2023-06-08stream: Update log messagesDaniel Willmann2-10/+8
Change-Id: Ife20b9d18e6ca86a06991d68165694e31052c58a
2023-06-08cosmetic: Change name of osmo_stream_src_fd_cb()Daniel Willmann1-2/+2
Change-Id: I8a9d27856ebdd5405b1977d12e91f8dcbdcd1d6b
2023-06-08stream: Properly name osmo_stream_srv read callbackDaniel Willmann2-6/+6
Change-Id: I12d74e9b407f1ea7af83fb3ec4d03ad7228a27cf
2023-05-31ipa-stream-server: Return -EBADF in read_cb after osmo_stream_srv_destroy()Daniel Willmann1-1/+2
This fixes a potential heap-use-after-free error. When there is still data to be written the osmo_stream_srv_cb() will call osmo_stream_srv_write() which will try to dereference conn even though it has already been freed. Change-Id: I5ac1920b8d4ce3b0205f00d253e7ed878fb745e3
2023-05-17stream: (typo) Change callback param name of struct osmo_stream_cli from srv ↵Daniel Willmann1-4/+4
to cli Change-Id: I742db401165477f85e66bb428f156ecbbd5d6665
2023-05-17stream: Introduce and use osmo_stream_cli_fd() to get the fdDaniel Willmann2-7/+14
This will become useful once osmo_io can be used as a backend. Change-Id: I7e964dea0adee8edbb9b75d2d17e7d0c5d8917d5
2023-04-25debian: set compat level to 10Oliver Smith2-2/+2
Related: OS#5958 Change-Id: Icfdbea7cbe4681cd3b286471032fd6dd7226888f
2023-03-13src/Makefile.am: do not overwrite AM_LDFLAGSVadim Yanitskiy1-1/+1
Change-Id: I7b656c167cceb0657c0362b1237f846b7f3e9770
2023-03-13tests/Makefile.am: clean up AM_* variablesVadim Yanitskiy1-2/+3
* -I is a preprocessor flag, so it should be in AM_CPPFLAGS * $(LIBOSMOCORE_LDFLAGS) is not defined here, remove it Change-Id: Ice892f848e06b601e67b06a4e1e25c11fb7c4128
2023-03-13{utils,tests}/Makefile.am: reorder libraries in LDADDVadim Yanitskiy2-17/+8
Otherwise the linker may pick system-installed libs instead. Change-Id: Ia639b1c5460ad9391d2c311b4978ca9374789f7a
2023-02-27rtp.h: add RTP_PT_CSDATAOliver Smith1-0/+2
Related: OS#4393 Change-Id: I2ea378ba4d17e977da25ef9e6e86b3de2ccd0ad7
2023-02-20fix msgb leak on OSMO_STREAM_SRV_F_FLUSH_DESTROYNeels Hofmeyr1-0/+1
In osmo_stream_srv_send(), call msgb_free() if the msgb is not enqueued. Before this, osmo_stream_srv_send() enqueues a msgb, assuming the queue will free it. But if OSMO_STREAM_SRV_F_FLUSH_DESTROY is set, it just returns and drops the msgb. There is no rc, so the caller cannot know. Change-Id: I994c5e06a9030cfbf4fca8ab42588c61f7121cee
2023-02-20Run struct_endianness.pyOliver Smith3-5/+5
Ensure there is no diff to prepare to run this in CI. Related: OS#5884 Change-Id: Ib3459ebb2414dd1798dfda6d3c585232ceff741b
2023-02-10Add osmo_stream_srv_link_is_opened()Max2-4/+15
We use file descriptor of -1 as an indicator for unopened link internally. However, since all the structs of libosmo-netif are opaque, using it from external applications looks like a leaky abstraction. Let's remedy this by adding function which properly check this for the library user. Related: OS#5568 Change-Id: I91aa7da5f09ec4e8e2d21c827b45ed92e6b0e3d9
2023-02-10osmo_stream_srv_link_close(): properly handle NULL inputMax1-0/+3
Related: OS#5568 Change-Id: Ie15bb3dc99bfe18065e03fde68d517b0d389b7ad
2023-02-07Bump version: 1.2.0.114-3804-dirty → 1.3.01.3.0Pau Espin Pedrol8-25/+147
Change-Id: Id67541378193f22f924409f02301f0063aab639e
2023-01-03osmo-amr-inspect: Improve robustness reading from stdinPau Espin Pedrol1-5/+11
Fixes printing hexbuf which might not have been null-terminated. Related: SYS#6161 Fixes: Coverity CID#302068 Change-Id: I460f1deb7455b3b6a85a090bdcad8e21a883db68
2022-12-22Introduce utils/osmo-amr-inspect program2023q1Pau Espin Pedrol5-1/+342
This program allows inspecting a list of AMR PDUs in hexstring format present in a text file. This allows easily finding out the properties of the PDU as well as finding potential errors on the data. It also allows forcing decode in different formats (octet-aligned, bandwidth-efficient) in order to detect which may be the correct one. Related: SYS#6161 Change-Id: Iffa6cc2e5391b77e3097d4c3b8d3f5211427dbe2
2022-12-21amr: osmo_amr_bwe_to_oa(): validate input data is long enoughPau Espin Pedrol1-0/+2
Change-Id: I2d11ce71c29ae046c2feab1e59045d97dc3e5099
2022-12-21amr: use OSMO_BYTES_FOR_BITS()Pau Espin Pedrol1-3/+3
Change-Id: Ib92856ede3f493615c24d883954989e952c51157
2022-12-21amr: Clarify size of AMR BWE header and ToCPau Espin Pedrol2-4/+8
Change-Id: I34c76b18ee45e12dba92864715e8ef91e6de3b01
2022-12-21amr: use struct bwe_hdr in osmo_amr_bwe_to_oa()Pau Espin Pedrol1-8/+15
The header conversion is now much clearer. Take the chance to delay the memset(buf) after the checks. Change-Id: I5042dc628ac70eca62b4980f4acae991dd976528
2022-12-21amr: constify input buffer in osmo_amr_is_oa()Pau Espin Pedrol2-2/+2
Change-Id: I72ef6fc700f628ea158ea888a5f1e9dc8776ab7e
2022-12-21amr: Add missing header stdbool.hPau Espin Pedrol1-0/+1
Change-Id: I84e447960c4912147d2f3a6170393370d354625b
2022-12-21amr.h: Fix AMR_FT_{GSM,TDMA,PDC}_EFR_SID_LENPau Espin Pedrol1-13/+13
Fixes: 678c7fc8fe4fd11e09ccd642ad60c10c365bd19a Change-Id: I63c8082bec12bf81760330d1fc0b13de23ac6a24