arehbein has uploaded this change for review.

View Change

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

Related: OS#6213
Change-Id: Ibe1a51205a6df764571b6d074e365825555609a5
---
M include/osmocom/core/gsmtap_util.h
M src/core/gsmtap_util.c
M src/core/logging_gsmtap.c
3 files changed, 32 insertions(+), 12 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/34720/1
diff --git a/include/osmocom/core/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h
index 9137c1d..7550e09 100644
--- a/include/osmocom/core/gsmtap_util.h
+++ b/include/osmocom/core/gsmtap_util.h
@@ -24,19 +24,9 @@
int8_t snr, const uint8_t *data, unsigned int len);

/*! one gsmtap instance */
-struct gsmtap_inst {
- int ofd_wq_mode; /*!< wait queue mode? */
- struct osmo_wqueue wq; /*!< the wait queue */
- struct osmo_fd sink_ofd;/*!< file descriptor */
-};
+struct gsmtap_inst;

-/*! obtain the file descriptor associated with a gsmtap instance
- * \param[in] gti GSMTAP instance
- * \returns file descriptor of GSMTAP instance */
-static inline int gsmtap_inst_fd(struct gsmtap_inst *gti)
-{
- return gti->wq.bfd.fd;
-}
+int gsmtap_inst_fd(struct gsmtap_inst *gti);

int gsmtap_source_init_fd(const char *host, uint16_t port);
int gsmtap_source_init_fd2(const char *local_host, uint16_t local_port, const char *rem_host, uint16_t rem_port);
diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c
index 20c0ce1..f37110b 100644
--- a/src/core/gsmtap_util.c
+++ b/src/core/gsmtap_util.c
@@ -46,6 +46,20 @@
*
* \file gsmtap_util.c */

+/*! one gsmtap instance */
+struct gsmtap_inst {
+ int ofd_wq_mode; /*!< wait queue mode? */
+ struct osmo_wqueue wq; /*!< the wait queue */
+ struct osmo_fd sink_ofd; /*!< file descriptor */
+};
+
+/*! obtain the file descriptor associated with a gsmtap instance
+ * \param[in] gti GSMTAP instance
+ * \returns file descriptor of GSMTAP instance */
+int gsmtap_inst_fd(struct gsmtap_inst *gti)
+{
+ return gti->wq.bfd.fd;
+}

/*! convert RSL channel number to GSMTAP channel type
* \param[in] rsl_chantype RSL channel type
diff --git a/src/core/logging_gsmtap.c b/src/core/logging_gsmtap.c
index dfd059b..bd5c271 100644
--- a/src/core/logging_gsmtap.c
+++ b/src/core/logging_gsmtap.c
@@ -51,6 +51,8 @@

#define GSMTAP_LOG_MAX_SIZE 4096

+struct gsmtap_inst;
+
static __thread uint32_t logging_gsmtap_tid;

static void _gsmtap_raw_output(struct log_target *target, int subsys,

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibe1a51205a6df764571b6d074e365825555609a5
Gerrit-Change-Number: 34720
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein <arehbein@sysmocom.de>
Gerrit-MessageType: newchange