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
This commit is contained in:
Pau Espin 2023-12-06 17:55:32 +01:00
parent a15d8f7f20
commit 14dd5ba329
2 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,7 @@ 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);
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);

View File

@ -366,6 +366,14 @@ osmo_stream_srv_link_get_ofd(struct osmo_stream_srv_link *link)
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() */