aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorarehbein <arehbein@sysmocom.de>2023-10-12 00:20:17 +0200
committerarehbein <arehbein@sysmocom.de>2023-10-13 01:33:46 +0200
commit1584b2ac39292aedddb8abd165957912fe9399c0 (patch)
treef1162a099f573b761201428e660bf1a31d6364d4 /src
parent9519d8d27ad84845b3d60f36e46489f9c8d5c4be (diff)
gsmtap: Hide implementation of gsmtap_inst
- Use forward decl. of struct gsmtap_inst in header - Remove 'static inline' attributes from gsmtap_inst_fd() declaration, move function definition to gsmtap_util.c and mark it as deprecated - Add gsmtap_inst_fd2() as replacement for gsmtap_inst_fd() Related: OS#6213 Change-Id: Ibe1a51205a6df764571b6d074e365825555609a5
Diffstat (limited to 'src')
-rw-r--r--src/core/gsmtap_util.c26
-rw-r--r--src/core/libosmocore.map2
2 files changed, 26 insertions, 2 deletions
diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c
index 20c0ce1a..dcbd3049 100644
--- a/src/core/gsmtap_util.c
+++ b/src/core/gsmtap_util.c
@@ -46,6 +46,28 @@
*
* \file gsmtap_util.c */
+/*! one gsmtap instance */
+struct gsmtap_inst {
+ int ofd_wq_mode; /*!< wait queue mode? This field member may not be changed or moved (backwards compatibility) */
+ struct osmo_wqueue wq; /*!< the wait queue. This field member may not be changed or moved (backwards compatibility) */
+ struct osmo_fd sink_ofd; /*!< file descriptor */
+};
+
+/*! Deprecated, use gsmtap_inst_fd2() instead
+ * \param[in] gti GSMTAP instance
+ * \returns file descriptor of GSMTAP instance */
+int gsmtap_inst_fd(struct gsmtap_inst *gti)
+{
+ return gsmtap_inst_fd2(gti);
+}
+
+/*! obtain the file descriptor associated with a gsmtap instance
+ * \param[in] gti GSMTAP instance
+ * \returns file descriptor of GSMTAP instance */
+int gsmtap_inst_fd2(const struct gsmtap_inst *gti)
+{
+ return gti->wq.bfd.fd;
+}
/*! convert RSL channel number to GSMTAP channel type
* \param[in] rsl_chantype RSL channel type
@@ -330,7 +352,7 @@ int gsmtap_sendmsg(struct gsmtap_inst *gti, struct msgb *msg)
/* try immediate send and return error if any */
int rc;
- rc = write(gsmtap_inst_fd(gti), msg->data, msg->len);
+ rc = write(gsmtap_inst_fd2(gti), msg->data, msg->len);
if (rc < 0) {
return rc;
} else if (rc >= msg->len) {
@@ -447,7 +469,7 @@ int gsmtap_source_add_sink(struct gsmtap_inst *gti)
{
int fd, rc;
- fd = gsmtap_source_add_sink_fd(gsmtap_inst_fd(gti));
+ fd = gsmtap_source_add_sink_fd(gsmtap_inst_fd2(gti));
if (fd < 0)
return fd;
diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map
index 6c02cd30..e5f8bd8c 100644
--- a/src/core/libosmocore.map
+++ b/src/core/libosmocore.map
@@ -39,6 +39,8 @@ get_string_value;
get_value_string;
get_value_string_or_null;
gsmtap_gsm_channel_names;
+gsmtap_inst_fd;
+gsmtap_inst_fd2;
gsmtap_makemsg;
gsmtap_makemsg_ex;
gsmtap_send;