pespin has uploaded this change for review.

View Change

stream: Add missing osmo_stream_srv_link_get_fd() API

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
---
M include/osmocom/netif/stream.h
M src/stream_srv.c
2 files changed, 22 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/41/35241/1
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h
index 218b635..681f9ec 100644
--- a/include/osmocom/netif/stream.h
+++ b/include/osmocom/netif/stream.h
@@ -38,6 +38,7 @@
void *osmo_stream_srv_link_get_data(struct osmo_stream_srv_link *link);
char *osmo_stream_srv_link_get_sockname(const struct osmo_stream_srv_link *link);
struct osmo_fd *osmo_stream_srv_link_get_ofd(struct osmo_stream_srv_link *link);
+int osmo_stream_srv_link_get_fd(const struct osmo_stream_srv_link *link);
bool osmo_stream_srv_link_is_opened(const struct osmo_stream_srv_link *link);
int osmo_stream_srv_link_open(struct osmo_stream_srv_link *link);
void osmo_stream_srv_link_close(struct osmo_stream_srv_link *link);
diff --git a/src/stream_srv.c b/src/stream_srv.c
index 42b04ad..f5a0b42 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -366,6 +366,14 @@
return &link->ofd;
}

+/*! \brief Get File Descriptor of the stream server link
+ * \param[in] conn Stream Server Link
+ * \returns file descriptor or negative on error */
+int osmo_stream_srv_link_get_fd(const struct osmo_stream_srv_link *link)
+{
+ return link->ofd.fd;
+}
+
/*! \brief Set the accept() call-back of the stream server link
* \param[in] link Stream Server Link
* \param[in] accept_cb Call-back function executed upon accept() */

To view, visit change 35241. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I1bd3f790d93af74c150938a59108b882ad2820f3
Gerrit-Change-Number: 35241
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange