dnl checks for header files
AC_HEADER_STDC
-AC_CHECK_HEADERS(execinfo.h sys/select.h syslog.h ctype.h)
+AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
# The following test is taken from WebKit's webkit.m4
saved_CFLAGS="$CFLAGS"
#define _OSMOCORE_SOCKET_H
#include <stdint.h>
-#include <sys/socket.h>
+
+struct sockaddr;
int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto,
const char *host, uint16_t port, int connect0_bind1);
uint8_t proto, int connect0_bind1);
/* determine if the given address is a local address */
-int osmo_sockaddr_is_local(struct sockaddr *addr, socklen_t addrlen);
+int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen);
#endif /* _OSMOCORE_SOCKET_H */
#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>
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)
return -ENODEV;
}
-#ifdef HAVE_SYS_SELECT_H
-
int gsmtap_sendmsg(struct gsmtap_inst *gti, struct msgb *msg)
{
if (gti->ofd_wq_mode)
return gti;
}
-#endif /* HAVE_SYS_SELECT_H */
+#endif /* HAVE_SYS_SOCKET_H */
#include "../config.h"
+#ifdef HAVE_SYS_SOCKET_H
+
#include <osmocom/core/logging.h>
#include <osmocom/core/select.h>
#include <osmocom/core/socket.h>
}
static int sockaddr_equal(const struct sockaddr *a,
- const struct sockaddr *b, socklen_t len)
+ const struct sockaddr *b, unsigned int len)
{
struct sockaddr_in *sin_a, *sin_b;
struct sockaddr_in6 *sin6_a, *sin6_b;
return 0;
}
+
+#endif /* HAVE_SYS_SOCKET_H */