libosmo-netif  1.4.0.19-26cd.202401052026
Osmocom network interface library
stream_private.h
1 #pragma once
2 
3 #include <stdbool.h>
4 #include <stdint.h>
5 
6 #include <osmocom/core/socket.h>
7 
8 #include "config.h"
9 
10 #ifdef HAVE_LIBSCTP
11 #include <netinet/sctp.h>
12  #define OSMO_STREAM_MAX_ADDRS OSMO_SOCK_MAX_ADDRS
13  /*
14  * Platforms that don't have MSG_NOSIGNAL (which disables SIGPIPE)
15  * usually have SO_NOSIGPIPE (set via setsockopt).
16  */
17  #ifndef MSG_NOSIGNAL
18  #define MSG_NOSIGNAL 0
19  #endif
20 #else
21  #define OSMO_STREAM_MAX_ADDRS 1
22 #endif
23 
28 enum osmo_stream_mode {
29  OSMO_STREAM_MODE_UNKNOWN,
30  OSMO_STREAM_MODE_OSMO_FD,
31  OSMO_STREAM_MODE_OSMO_IO,
32 };
33 
34 int stream_sctp_sock_activate_events(int fd);
35 int stream_setsockopt_nodelay(int fd, int proto, int on);
36 int stream_sctp_recvmsg_wrapper(int fd, struct msgb *msg, const char *log_pfx);
37