summaryrefslogtreecommitdiffstats
path: root/src/gsm/gsm0808_utils.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-05-15 12:50:04 +0200
committerHarald Welte <laforge@gnumonks.org>2017-05-15 13:42:03 +0200
commit20725b9eea15720a5dbad19aac6236b86a3e34c6 (patch)
treeed76d626ab497385c903e5a7c2af1cb993b5319d /src/gsm/gsm0808_utils.c
parentbfe62e5781e3ee895a44ca9ccc155ff87c42bf43 (diff)
gsm0808 + ipa: fix compilation on systems without sys/socket.h
Change-Id: I60f5d4982cd96ab29f9924ec11b46bf56fbfc346
Diffstat (limited to 'src/gsm/gsm0808_utils.c')
-rw-r--r--src/gsm/gsm0808_utils.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 2fa265a9..ff97b2d2 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -18,12 +18,12 @@
*
*/
+#include "config.h"
+
#include <osmocom/core/utils.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/byteswap.h>
#include <string.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
#include <errno.h>
#include <osmocom/gsm/protocol/gsm_08_08.h>
@@ -35,6 +35,10 @@
#define CHANNEL_TYPE_ELEMENT_MINLEN 3
#define ENCRYPT_INFO_ELEMENT_MINLEN 1
+#ifdef HAVE_SYS_SOCKET_H
+
+#include <sys/socket.h>
+#include <netinet/in.h>
/* Encode AoIP transport address element */
uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg,
const struct sockaddr_storage *ss)
@@ -125,6 +129,8 @@ int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss,
return (int)(elem - old_elem);
}
+#endif /* HAVE_SYS_SOCKET_H */
+
/* Helper function for gsm0808_enc_speech_codec()
* and gsm0808_enc_speech_codec_list() */
static uint8_t enc_speech_codec(struct msgb *msg,