pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41987?usp=email )
Change subject: osmo_io: Introduce API osmo_iofd_get_txqueue_max_length() ......................................................................
osmo_io: Introduce API osmo_iofd_get_txqueue_max_length()
Change-Id: I92526aa554fc87734fae3fac0ad650d17bf52bb5 --- M include/osmocom/core/osmo_io.h M src/core/libosmocore.map M src/core/osmo_io.c 3 files changed, 12 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/87/41987/1
diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h index 525c23c..c92492c 100644 --- a/include/osmocom/core/osmo_io.h +++ b/include/osmocom/core/osmo_io.h @@ -233,6 +233,7 @@
void osmo_iofd_set_alloc_info(struct osmo_io_fd *iofd, unsigned int size, unsigned int headroom); void osmo_iofd_set_txqueue_max_length(struct osmo_io_fd *iofd, unsigned int size); +unsigned int osmo_iofd_get_txqueue_max_length(const struct osmo_io_fd *iofd); void *osmo_iofd_get_data(const struct osmo_io_fd *iofd); void osmo_iofd_set_data(struct osmo_io_fd *iofd, void *data);
diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map index cb79843..f6e15f0 100644 --- a/src/core/libosmocore.map +++ b/src/core/libosmocore.map @@ -273,6 +273,7 @@ osmo_iofd_set_name; osmo_iofd_set_name_f; osmo_iofd_get_priv_nr; +osmo_iofd_get_txqueue_max_length; osmo_iofd_init; osmo_iofd_mode_names; osmo_iofd_ops; diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index 514d592..3cd9dc5 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -1147,6 +1147,16 @@ iofd->tx_queue.max_length = max_length; }
+ +/*! Get the maximum number of messages enqueued for sending. + * \param[in] iofd the file descriptor + * \returns the maximum size of the transmit queue + */ +unsigned int osmo_iofd_get_txqueue_max_length(const struct osmo_io_fd *iofd) +{ + return iofd->tx_queue.max_length; +} + /*! Retrieve the associated user-data from an osmo_io_fd. * * A call to this function will return the opaque user data pointer which was specified previously