aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsmtap_util.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-05-22 12:25:57 +0200
committerHarald Welte <laforge@gnumonks.org>2011-05-22 12:25:57 +0200
commite476442cf0e84c65565ace545f5b73602b5f0ffc (patch)
tree02f3e4ecc2d42461d1fcb15e9d724e3d7d88a09d /src/gsmtap_util.c
parent33cb71ac91fb870702dbb71595dba4a554001e3c (diff)
GSMTAP/socket code: Check for sys/socket.h and conditionally compile
Diffstat (limited to 'src/gsmtap_util.c')
-rw-r--r--src/gsmtap_util.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c
index 15426358..5c68b6a0 100644
--- a/src/gsmtap_util.c
+++ b/src/gsmtap_util.c
@@ -32,10 +32,9 @@
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/rsl.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
#include <sys/types.h>
-#include <netinet/in.h>
+
+#include <arpa/inet.h>
#include <stdio.h>
#include <unistd.h>
@@ -111,6 +110,11 @@ struct msgb *gsmtap_makemsg(uint16_t arfcn, uint8_t ts, uint8_t chan_type,
return msg;
}
+#ifdef HAVE_SYS_SOCKET_H
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+
/* Open a GSMTAP source (sending) socket, conncet it to host/port and
* return resulting fd */
int gsmtap_source_init_fd(const char *host, uint16_t port)
@@ -142,8 +146,6 @@ int gsmtap_source_add_sink_fd(int gsmtap_fd)
return -ENODEV;
}
-#ifdef HAVE_SYS_SELECT_H
-
int gsmtap_sendmsg(struct gsmtap_inst *gti, struct msgb *msg)
{
if (gti->ofd_wq_mode)
@@ -270,4 +272,4 @@ struct gsmtap_inst *gsmtap_source_init(const char *host, uint16_t port,
return gti;
}
-#endif /* HAVE_SYS_SELECT_H */
+#endif /* HAVE_SYS_SOCKET_H */