aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/netif/stream.h3
-rw-r--r--src/stream.c18
2 files changed, 21 insertions, 0 deletions
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h
index 21483f2..c669011 100644
--- a/include/osmocom/netif/stream.h
+++ b/include/osmocom/netif/stream.h
@@ -11,6 +11,7 @@ void osmo_stream_server_link_set_port(struct osmo_stream_server_link *link, uint
void osmo_stream_server_link_set_accept_cb(struct osmo_stream_server_link *link, int (*accept_cb)(struct osmo_stream_server_link *link, int fd));
void osmo_stream_server_link_set_data(struct osmo_stream_server_link *link, void *data);
void *osmo_stream_server_link_get_data(struct osmo_stream_server_link *link);
+struct osmo_fd *osmo_stream_server_link_get_ofd(struct osmo_stream_server_link *link);
int osmo_stream_server_link_open(struct osmo_stream_server_link *link);
void osmo_stream_server_link_close(struct osmo_stream_server_link *link);
@@ -19,6 +20,7 @@ struct osmo_stream_server_conn;
struct osmo_stream_server_conn *osmo_stream_server_conn_create(void *ctx, struct osmo_stream_server_link *link, int fd, int (*cb)(struct osmo_stream_server_conn *conn), int (*closed_cb)(struct osmo_stream_server_conn *conn), void *data);
void *osmo_stream_server_conn_get_data(struct osmo_stream_server_conn *conn);
+struct osmo_fd *osmo_stream_server_conn_get_ofd(struct osmo_stream_server_conn *link);
void osmo_stream_server_conn_destroy(struct osmo_stream_server_conn *conn);
void osmo_stream_server_conn_send(struct osmo_stream_server_conn *conn, struct msgb *msg);
@@ -30,6 +32,7 @@ void osmo_stream_client_conn_set_addr(struct osmo_stream_client_conn *link, cons
void osmo_stream_client_conn_set_port(struct osmo_stream_client_conn *link, uint16_t port);
void osmo_stream_client_conn_set_data(struct osmo_stream_client_conn *link, void *data);
void *osmo_stream_client_conn_get_data(struct osmo_stream_client_conn *link);
+struct osmo_fd *osmo_stream_client_conn_get_ofd(struct osmo_stream_client_conn *link);
void osmo_stream_client_conn_set_connect_cb(struct osmo_stream_client_conn *link, int (*connect_cb)(struct osmo_stream_client_conn *link));
void osmo_stream_client_conn_set_read_cb(struct osmo_stream_client_conn *link, int (*read_cb)(struct osmo_stream_client_conn *link));
diff --git a/src/stream.c b/src/stream.c
index 782c4de..6aa85e1 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -189,6 +189,12 @@ void *osmo_stream_client_conn_get_data(struct osmo_stream_client_conn *link)
return link->data;
}
+struct osmo_fd *
+osmo_stream_client_conn_get_ofd(struct osmo_stream_client_conn *link)
+{
+ return &link->ofd;
+}
+
void
osmo_stream_client_conn_set_connect_cb(struct osmo_stream_client_conn *link,
int (*connect_cb)(struct osmo_stream_client_conn *link))
@@ -357,6 +363,12 @@ void *osmo_stream_server_link_get_data(struct osmo_stream_server_link *link)
return link->data;
}
+struct osmo_fd *
+osmo_stream_server_link_get_ofd(struct osmo_stream_server_link *link)
+{
+ return &link->ofd;
+}
+
void osmo_stream_server_link_set_accept_cb(struct osmo_stream_server_link *link,
int (*accept_cb)(struct osmo_stream_server_link *link, int fd))
@@ -490,6 +502,12 @@ void *osmo_stream_server_conn_get_data(struct osmo_stream_server_conn *link)
return link->data;
}
+struct osmo_fd *
+osmo_stream_server_conn_get_ofd(struct osmo_stream_server_conn *link)
+{
+ return &link->ofd;
+}
+
void osmo_stream_server_conn_destroy(struct osmo_stream_server_conn *conn)
{
close(conn->ofd.fd);