libosmo-netif 1.6.0.5-6a68
Osmocom network interface library
All Data Structures Files Functions Variables Typedefs Macros Modules Pages
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
26enum osmo_stream_mode {
27 OSMO_STREAM_MODE_UNKNOWN,
28 OSMO_STREAM_MODE_OSMO_FD,
29 OSMO_STREAM_MODE_OSMO_IO,
30};
31
32struct osmo_io_fd;
33struct msghdr;
34
35int stream_sctp_sock_activate_events(int fd);
36int stream_setsockopt_nodelay(int fd, int proto, int on);
37int stream_sctp_recvmsg_wrapper(int fd, struct msgb *msg, const char *log_pfx);
38
39int stream_iofd_sctp_send_msgb(struct osmo_io_fd *iofd, struct msgb *msg, int sendmsg_flags);
40int stream_iofd_sctp_recvmsg_trailer(struct osmo_io_fd *iofd, struct msgb *msg, int ret, const struct msghdr *msgh);
41