Commit Graph

17 Commits

Author SHA1 Message Date
Pau Espin 05ff552f25 stream_{cli,srv}: Add 'res' param to read_cb2
Notify user about read errors, similar to what is supported in the
earlier ofd cb backend of osmo_stream_cli/srv:
https://osmocom.org/issues/6405#note-15

Related: OS#6405
Fixes: 5fec34a9f2
Fixes: 0245cf5e07
Change-Id: I395c75ff1e9904757ce1d767a9ac2f779593c4c8
2024-04-18 10:55:13 +02:00
Pau Espin 211c15d543 examples/ipa-stream-client: Fix memleaks in read_cb()
Change-Id: I86fc159d928fc7ebce2f771670c5a198c52f5fc0
2024-04-16 19:11:51 +02:00
arehbein 106b63907a stream: Add and use helper function osmo_ipa_push_headers()
Related OS#5753, OS#5751

Change-Id: I61e1fe59166c46595efe8c1f32b8f2607cb6c529
2023-10-09 12:49:36 +00:00
arehbein bc496b1db0 stream: Add client-side (segmentation) support for IPA
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-10-02 13:40:01 +00:00
arehbein 8712af589c examples: Add extension header octet to example
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-07 16:50:22 +02:00
Pau Espin 08e9b6c612 stream: Drop recently added API osmo_stream_cli_create2
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-20 13:49:37 +02:00
Daniel Willmann 8cd2c4455e examples: Set logging level to DEBUG in {,ipa-}stream-{client,server}
Change-Id: I8c37bbe3db9823a399773d6790000ba508e79377
2023-06-16 09:23:28 +00:00
Daniel Willmann c873b62929 examples: Use new stream API in {ipa-,}stream-{client,server}
Change-Id: I97a9979199c816686b32080534627f6f033e009e
2023-06-14 18:17:13 +02:00
Daniel Willmann 384b8f15cb examples: Use osmo_stream_*_set_nodelay in ipa examples
We have functions to help with/abstract the nodelay settings so use
those.

Change-Id: Icb143c6e5fc3063f942a744deb576865674a4c62
2020-10-14 18:05:40 +02:00
Max af63d87a76 Stream client: add disconnect callback
It's similar to connect_cb() but called once client has been
disconnected.

Change-Id: I905adb2d6191216551a3bcdcd1aec1f96f01612a
2019-02-20 17:33:32 +01:00
Pau Espin 6fb0f4de86 examples: use osmo_init_logging2
Change-Id: I7f1f4503f254931edeebfbadf3953efa7b20f85f
2018-04-17 13:55:09 +02:00
Harald Welte 1f760e8dcc ipa-stream-{client,server}: Add missing #include <sys/socket.h>
This lead to compiler warnings on FreeBSD, as setsockopt() is undefined.

Change-Id: Ie0ee3e48adfd0cd252703ec020cef28cf76ca223
2016-12-01 16:07:23 +01:00
Nikola Kolev 2f1ddb2709 Fix the compilation on FreeBSD. 2015-02-25 15:52:14 +01:00
Pablo Neira Ayuso 9ae91e594c ipa: add osmo_ipa_process_msg and remove osmo_ipa_recv_msg
This patch removes osmo_ipa_recv_msg, it performs two syscall invocations
and it's stream generic. Now we use the specific receival function
we want to use (no matter if stream or datagram based) and then we
call osmo_ipa_process_msg to check that the IPA message correct.
2012-08-19 20:14:25 +02:00
Pablo Neira Ayuso cee5fb36da src: shorter stream function names
%s/_client_conn_/_cli_/g
%s/_server_conn_/_srv_/g
%s/_client_/cli/g
%s/server/srv/g
%s/RECONFIG/RECONF/g
%s/SERVER/SRV/g
%s/CLIENT/CLI/g
2012-08-15 23:34:35 +02:00
Pablo Neira Ayuso e1a7ede826 examples: disable Nagle in ipa-stream-*.c
To emulate how openBSC behaves.
2011-10-17 23:02:39 +02:00
Pablo Neira Ayuso 20c660caec ipa: initial addition of helper functions and examples
This patch adds IPA helper function that can be use on top of stream
sockets.

The current API is just a copy and paste from libosmo-abis, it will
change in follow up patches to improve it.
2011-10-17 22:12:42 +02:00