aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/netif
AgeCommit message (Collapse)AuthorFilesLines
10 daysdocs: Improve/clean-up doxygen for datagram.[ch]Harald Welte1-0/+13
* make sure datagram.h is part of the group * don't expose private #defines from C files to API documentation Change-Id: I64a9ee3306bcc01ba785da476aea581ce31150bd
10 daysdocs: various osmux API documentation updatesHarald Welte1-4/+7
Let's make sure * only exported / user-relevant #defines appear in the manual * deprecated functions are marked in a way doxygen can mark them * descriptive comments are using doxygen syntax Change-Id: I5af0133322ddd5345a13380f1c007474c0bea117
12 daysintroduce osmo_stream_cli_get_iofd() APIHarald Welte1-0/+2
Using this, a user can obtain the osmo_io_fd, for example in order to perform configuration like osmo_iofd_set_alloc_info() or osmo_iofd_set_txqueue_max_length(). Change-Id: Ie19c8294ddb12dfe5e0fd44e047c47e6f9cbd384
2024-03-15docs: Split Stream Server and Stream Client into separate groupsHarald Welte2-14/+79
This provides us with proper logical separation between client and server in the documentation. Change-Id: I9e037fedaecb78396f435577b1652284b4951ded
2024-03-15docs: Use \defgroup and avoid repeated boilerplate textHarald Welte1-1/+8
Change-Id: I1196c3b035f495c5dbaa4d47ce3f79a08d0727f2
2024-03-13prim: Introduce osmo_prim_srv{_link}_set_name APIsPau Espin Pedrol1-0/+2
This allows a user setting a name on the underlaying stream which in turns allows easily identifying the socket. Change-Id: Iba683e4d65e0aba81e13bdf1b9d5a9065b1fc89c
2024-03-13stream: Add osmo_stream_*_get_name() APIsPau Espin Pedrol1-0/+3
This allows users to retrieve a previously set name. Change-Id: If5054d3c207f8f5d58a448f1e58266ad9c4386dd
2024-02-29stream_{cli,srv}: Add support for SCTP in OSMO_IO modeHarald Welte1-0/+6
Let's enable the OSMO_IO_FD_MODE_RECVMSG_SENDMSG mode for SCTP sockets, allowing OSMO_STREAM_MODE_OSMO_IO to be used with SCTP. Change-Id: I6cf5bad5f618e71c80017960c38009b089dbd6a1 Depends: libosmocore Change-Id: I89eb519b22d21011d61a7855b2364bc3c295df82 Closes: OS#5753
2023-12-08stream_cli: Introduce API osmo_stream_srv_get_sockname()Pau Espin Pedrol1-0/+1
Similar to what osmo_stream_srv_link and osmo_stream_cli already have. Change-Id: I171befd1fdf40c3cbb3fc7e4c3eedf82128b0712 Related: SYS#5580
2023-12-08netif: sctp.h: Introduce value_string for enum sctp_sstat_statePau Espin Pedrol1-0/+5
This can be used by apps retrieving struct sctp_status through getsockopt(SCTP_STATUS). The relevant field is spinfo_state: osmo_sctp_sstat_state_str(st.sstat_state); Change-Id: Id7d8a9ad7b32406ac603e520b33809d7ae5c762f Related: SYS#6636
2023-12-08netif: sctp.h: Introduce value_string for enum sctp_spinfo_statePau Espin Pedrol1-0/+5
This can be used by apps retrieving struct sctp_paddrinfo through getsockopt(SCTP_GET_PEER_ADDR_INFO). The relevant field is spinfo_state: osmo_sctp_spinfo_state_str(pinfo.spinfo_state); Related: SYS#6636 Change-Id: I78a0bd8279a04f4011c7273e0f542981308e482f
2023-12-06stream: Add missing osmo_stream_srv_link_get_fd() APIPau Espin Pedrol1-0/+1
osmo_stream_srv and osmo_stream_cli already had that API introduced in order to use it instead of *_get_ofd(), since the later will eventually be deprecated due to incoming osmo_io. Change-Id: I1bd3f790d93af74c150938a59108b882ad2820f3
2023-11-21Introduce generic osmo_stream_{cli,srv}_get_fd() APIHarald Welte1-0/+2
The old osmo_stream_{cli,srv}_get_ofd() API only works for streams in OSMO_FD mode. However, it is legitimate for an application wanting to get low-level access to the file descriptor, for example to issue some {get,set}sockopt() calls on it. Change-Id: Ib0737f21150f6ac8d524b92c7ddb098f2afdeaab Related: OS#5753
2023-10-09stream: Add and use helper function osmo_ipa_push_headers()arehbein1-0/+2
Related OS#5753, OS#5751 Change-Id: I61e1fe59166c46595efe8c1f32b8f2607cb6c529
2023-10-02stream: Add client-side (segmentation) support for IPAarehbein1-0/+1
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-09-19ipa: Don't break strict aliasing rulearehbein1-1/+13
Somehow gcc doesn't always warn about this rule being broken. We are breaking the strict aliasing rule here and libosmo-netif currently does not make use of the '-fno-strict-aliasing' flag. It's possible that this has also been causing nondeterministic timestamps in libosmo-netif stream tests every once in a while. Related: OS#6164, OS#5753 Change-Id: Ibed543cdfcdda8c0256ce7d8818ff96d6d46e9b0
2023-09-12stream: Add new stream_{cli,srv_link} parameters to set SCTP_INITMSG sockopt ↵Pau Espin Pedrol1-0/+6
values This will allow osmo_stream users (like libosmo-sccp) to set SCTP_INITMSG related parameters, like number on inbound/outbound streams, connect attempts, connect timeout. Related: SYS#6558 Change-Id: I5343c7659881b29e0201e72badbc2d07e1ef2dca
2023-09-08stream: Introduce API to set several transport parametersPau Espin Pedrol1-0/+17
This will allow extending capabilitites to set different parameters at the lower layers as we need them. This commit changes the behavior of osmo_stream_{cli,srv_link}: It now doesn't enable by default SCTP AUTH/ASCONF features using setsockopt. It is left up to the user of the API (libosmo-sccp in this case) to set it. Since this unilateral use of setsockopt() has only been added recently and we didn't release yet, it's fine changing it. libosmo-sccp will be changed to unconditionally set its using setsockopt. It is left up to the user of the API (libosmo-sccp in this case) to set it. Related: SYS#6501 Related: SYS#6558 Change-Id: I2607c1c926a625986cd851adc65dd8b4de83d6ab
2023-08-25stream: Add server-side (segmentation) support for IPAarehbein1-0/+3
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-21stream: Refactor sctp_recvmsg_wrapper() loggingPau Espin Pedrol1-0/+1
*Move the helper function to stream.c and pass a logging prefix string so that it can be used by both client and server. * Adapt log level based on message type. * Rework logging code to log everything in one line Change-Id: I0ed84cc2effb71b6ef1f6efb3f8b663c602a5a31
2023-08-07stream_srv: Log SCTP REMOTE_ERROR eventsPau Espin Pedrol1-0/+21
The event was enabled but was not being logged. Change-Id: I49f5a648fd474e320101424fb6873a37442339bf
2023-08-07sctp: Document relevant RFC specsPau Espin Pedrol1-0/+6
Change-Id: Iae325b787fdb7fc95aa6922975a7e1fcf368527a
2023-08-07ipa: Add segmentation callbackarehbein1-0/+11
Related: OS#5753 Change-Id: I87ef4c7023126b783dd79e7ed47be31e1b76f975
2023-08-07examples: Add extension header octet to examplearehbein1-0/+2
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 Pedrol2-0/+41
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-06-20stream: Drop name param from recently added API osmo_stream_srv_create2()Pau Espin Pedrol1-1/+1
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 Pedrol1-1/+0
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: Allow setting name printed during loggingPau Espin Pedrol1-0/+3
Depends: libosmocore.git Change-Id If2772a3ccaa98616e0189862a49ab0243435e343 Change-Id: I539a0d29d11348efe702f971965a55cf56db5c59
2023-06-14Add osmo_io support to osmo_stream_cli and osmo_stream_srvDaniel Willmann1-0/+5
Change-Id: I2f52c7107c392b6f4b0bf2a84f8c873c084a200c
2023-06-08stream: Properly name osmo_stream_srv read callbackDaniel Willmann1-1/+1
Change-Id: I12d74e9b407f1ea7af83fb3ec4d03ad7228a27cf
2023-02-27rtp.h: add RTP_PT_CSDATAOliver Smith1-0/+2
Related: OS#4393 Change-Id: I2ea378ba4d17e977da25ef9e6e86b3de2ccd0ad7
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()Max1-1/+1
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
2022-12-21amr: Clarify size of AMR BWE header and ToCPau Espin Pedrol1-0/+3
Change-Id: I34c76b18ee45e12dba92864715e8ef91e6de3b01
2022-12-21amr: constify input buffer in osmo_amr_is_oa()Pau Espin Pedrol1-1/+1
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
2022-12-19amr: Support all SID and NO_DATA amr formatsPau Espin Pedrol1-19/+34
Related: SYS#6161 Change-Id: I0e766b3231f03ea87d89fad6ecdce3bd14769054
2022-12-19amr: Add struct definition for AMR BWE headerPau Espin Pedrol1-0/+28
Change-Id: I4b44257605bc5967d862ee29076ea6260d9a6bd8
2022-12-19amr.h: Fix missing include dependenciesPau Espin Pedrol1-0/+3
Needed for size_t uint8_t, etc. Change-Id: Ia808c2b6c426de79db5c88784dd7bce6096179aa
2022-11-18osmux: Introduce API osmux_xfrm_input_set_name()Pau Espin Pedrol1-0/+1
This will be used internally by osmux code to print more meaningful lines. Related: SYS#6161 Change-Id: Ibbcfdb23a6015ce45840bb64b2b560c2806f7ff6
2022-11-15osmux: Add data[0] field to osmux_hdrPau Espin Pedrol1-0/+1
This allows easy access to osmux_hdr payload. Change-Id: I27750c38f12d3d84dbaac5beff166d78ffa6c45b
2022-10-17stream: Introduce APIs osmo_stream_{cli,srv}_clear_tx_queue()Pau Espin Pedrol1-0/+4
Related: SYS#6113 Change-Id: Iecb0a4bc281647673d2930d1f1586a2df231af52
2022-10-17cosmetic: stream: Fix parameter namePau Espin Pedrol1-1/+1
The param is already "cli" in the .c file. Change-Id: I7e1e9902a39655e57e28d38a222bca850dd7de0e
2022-10-17stream: Improve logging of SCTP_PEER_ADDR_CHANGE notificationPau Espin Pedrol1-0/+10
Related: SYS#6113 Change-Id: Ieebc6e623874b4770ec7cd8b934244ffecaa089d
2022-10-03osmux: Introduce API osmux_xfrm_input_get_deliver_cb_data()Pau Espin Pedrol1-0/+1
This API allows retrieving back the private pointer set previously by osmux_xfrm_input_set_deliver_cb(). Change-Id: I95433b18802f73fa70e758f4aa02128eee940d88
2022-10-03osmux: Allocate struct osmux_out_handle through APIPau Espin Pedrol1-2/+7
Until now, the osmux_in_handle was allocated by the client, and passed to the API to initialize it. This makes it really hard to improve the implementation without breaking the ABI. Let's break the ABI now one last time (hopefully) by allocating the struct through an API. With only this change, the already built users (osmo-mgw, openbsci, osmo-bts) can still work fine, since there's no change on the struct osmux_in_handle. However, they will somehow break next time thestruct is changed until they are ported to the same API (easy to do). Change-Id: I752ab031f935f04731bb1a354333f1682a1aa5bd Related: SYS#5987
2022-10-03osmux: Take into account configured osmux_in_handle->osmux_seq fieldPau Espin Pedrol1-0/+1
It was not being used anywhere, yet older applications used to set it (always to 0, which was the default value applied internally). Let's make use of it and apply it as first seqnum to be used on a circuit. This value is applied upon call to osmux_xfrm_input_open_circuit(), hence it can be set independently for every new circuit. Change-Id: Ia26fcba5d7364a5744b2d64d0542a2b3880eee34
2022-09-28amr: Add data[0] field to amr_hdrPau Espin Pedrol1-0/+1
This allows easily accessing the AMR payload located after the TOC. Change-Id: I72c0a001bf7ce9a63ac03beef352af177084e644
2022-09-19stream: Provide caller with SCTP flags during osmo_stream_*_recv()Pau Espin Pedrol1-0/+4
The user may want to check the flags in order to know if the content pointed at by msgb is an sctp_notification structure, and not in-band data. This is useful for the user in order to gain connection state such as SCTP RESET notification, which means the client reconnected reusing the same socket, loosing all higher layers state. The MSG_NOTIFICATION from netinet/sctp.h is not reused, and instead an osmocom specific flag (and bitmask) is used. This is done in order to fit the flags in one byte, since for instance MSG_NOTIFICATION requires 2 bytes in my system (0x8000). Related: SYS#6113 Change-Id: I0ee94846a15a23950b9d70eaaef1251267296bdd