# fopencookie on linux
AC_CHECK_FUNCS([funopen fopencookie])
+AC_CHECK_FUNCS([inet_aton])
+
# check if we have IP_PKTINFO constant defined
AC_LINK_IFELSE(
AC_LANG_PROGRAM([#include <netinet/in.h>],
extern "C" {
#endif
-#include <netinet/in.h>
+#include "asterisk/network.h"
#include "asterisk/io.h"
#define AST_SENSE_DENY 0
or greater. */
#undef HAVE_IMAP_TK2006
+/* Define to 1 if you have the `inet_aton' function. */
+#undef HAVE_INET_ATON
+
/* Define to 1 if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA
extern "C" {
#endif
-#include <netinet/in.h>
+#include "asterisk/network.h"
struct ast_dnsmgr_entry;
#ifndef _ASTERISK_MANAGER_H
#define _ASTERISK_MANAGER_H
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
+#include "asterisk/network.h"
#include "asterisk/lock.h"
/*!
extern "C" {
#endif
-#include <netinet/in.h>
+#include "asterisk/network.h"
#include "asterisk/io.h"
#include "asterisk/astobj.h"
#ifndef _ASTERISK_RTP_H
#define _ASTERISK_RTP_H
-#include <netinet/in.h>
+#include "asterisk/network.h"
#include "asterisk/frame.h"
#include "asterisk/io.h"
#ifndef _ASTERISK_UDPTL_H
#define _ASTERISK_UDPTL_H
+#include "asterisk/network.h"
#include "asterisk/frame.h"
#include "asterisk/io.h"
#include "asterisk/sched.h"
#include "asterisk/channel.h"
-#include <netinet/in.h>
-
enum
{
UDPTL_ERROR_CORRECTION_NONE,
#ifndef _ASTERISK_UTILS_H
#define _ASTERISK_UTILS_H
-#include <netinet/in.h>
-#include <arpa/inet.h> /* we want to override inet_ntoa */
-#include <netdb.h>
+#include "asterisk/network.h"
+
#include <limits.h>
#include <time.h> /* we want to override localtime_r */
int test_for_thread_safety(void);
-/*!
- * \brief thread-safe replacement for inet_ntoa().
- *
- * \note It is very important to note that even though this is a thread-safe
- * replacement for inet_ntoa(), it is *not* reentrant. In a single
- * thread, the result from a previous call to this function is no longer
- * valid once it is called again. If the result from multiple calls to
- * this function need to be kept or used at once, then the result must be
- * copied to a local buffer before calling this function again.
- */
-const char *ast_inet_ntoa(struct in_addr ia);
-
-#ifdef inet_ntoa
-#undef inet_ntoa
-#endif
-#define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__
-
#ifdef localtime_r
#undef localtime_r
#endif
*/
int ast_carefulwrite(int fd, char *s, int len, int timeoutms);
-/*! \brief Compares the source address and port of two sockaddr_in */
-static force_inline int inaddrcmp(const struct sockaddr_in *sin1, const struct sockaddr_in *sin2)
-{
- return ((sin1->sin_addr.s_addr != sin2->sin_addr.s_addr)
- || (sin1->sin_port != sin2->sin_port));
-}
-
/*
* Thread management support (should be moved to lock.h or a different header)
*/
#include <sys/time.h>
#include <signal.h>
#include <errno.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <net/if.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
#include <sys/ioctl.h>
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
#include <fcntl.h>
#include <signal.h>
#include <sched.h>
-#include <sys/socket.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <errno.h>
#endif /* linux */
#include <regex.h>
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
#if defined(SOLARIS)
int daemon(int, int); /* defined in libresolv of all places */
#include <sys/loadavg.h>
#endif
+#include "asterisk/network.h"
#include "asterisk/logger.h"
#include "asterisk/options.h"
#include "asterisk/cli.h"
#include <ctype.h>
#include <sys/time.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
#include <signal.h>
#include <errno.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <signal.h>
#include <errno.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <net/if.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
#include <sys/ioctl.h>
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
#include <ctype.h>
#include <errno.h>
#include <sys/stat.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
#ifdef HAVE_DEV_URANDOM
#include <fcntl.h>
#endif
+#include "asterisk/network.h"
+
#define AST_API_MODULE /* ensure that inlinable API functions will be built in lock.h if required */
#include "asterisk/lock.h"
#include "asterisk/io.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
+#include "asterisk/network.h"
#include <errno.h>
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(SOLARIS) || defined(__Darwin__)
-#include <sys/types.h>
-#include <netinet/in_systm.h>
-#endif
-#include <netinet/ip.h>
#include <sys/ioctl.h>
-#include <net/if.h>
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__)
-#include <net/if_dl.h>
-#include <ifaddrs.h>
-#endif
#include <zlib.h>
#include <sys/signal.h>
#include <pthread.h>
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#include <netdb.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
#include <math.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/stat.h>
+#include "asterisk/network.h"
#include "asterisk/file.h"
#include "asterisk/logger.h"
#include "asterisk/channel.h"