From fb3e20b4b2a38cd09bf4ed7687dacd3ab6f15d44 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 21 Dec 2015 20:54:19 +0100 Subject: SCTP support for osmo_stream_{cli,srv} code Wih this change, osmo_stream_ client and server API can be used not only for TCP but also for SCTP. The latter is needed in SIGTRAN ad Iuh applications, for example. --- include/osmocom/netif/stream.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index ed399bf..efbb917 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -1,6 +1,9 @@ #ifndef _OSMO_STREAM_H_ #define _OSMO_STREAM_H_ +#define msgb_sctp_ppid(msg) (msg)->cb[3] +#define msgb_sctp_stream(msg) (msg)->cb[4] + struct osmo_stream_srv_link; struct osmo_stream_srv_link *osmo_stream_srv_link_create(void *ctx); @@ -8,6 +11,7 @@ void osmo_stream_srv_link_destroy(struct osmo_stream_srv_link *link); void osmo_stream_srv_link_set_addr(struct osmo_stream_srv_link *link, const char *addr); void osmo_stream_srv_link_set_port(struct osmo_stream_srv_link *link, uint16_t port); +void osmo_stream_srv_link_set_proto(struct osmo_stream_srv_link *link, uint16_t proto); void osmo_stream_srv_link_set_accept_cb(struct osmo_stream_srv_link *link, int (*accept_cb)(struct osmo_stream_srv_link *link, int fd)); void osmo_stream_srv_link_set_data(struct osmo_stream_srv_link *link, void *data); void *osmo_stream_srv_link_get_data(struct osmo_stream_srv_link *link); @@ -33,6 +37,7 @@ struct osmo_stream_cli; void osmo_stream_cli_set_addr(struct osmo_stream_cli *cli, const char *addr); void osmo_stream_cli_set_port(struct osmo_stream_cli *cli, uint16_t port); +void osmo_stream_cli_set_proto(struct osmo_stream_cli *cli, uint16_t proto); void osmo_stream_cli_set_data(struct osmo_stream_cli *cli, void *data); void osmo_stream_cli_set_reconnect_timeout(struct osmo_stream_cli *cli, int timeout); void *osmo_stream_cli_get_data(struct osmo_stream_cli *cli); -- cgit v1.2.3