]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
start using asterisk/network.h for network related headers.
authorLuigi Rizzo <rizzo@icir.org>
Sat, 17 Nov 2007 14:11:53 +0000 (14:11 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Sat, 17 Nov 2007 14:11:53 +0000 (14:11 +0000)
Also remove some unnecessary includes.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89380 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 files changed:
configure.ac
include/asterisk/acl.h
include/asterisk/autoconfig.h.in
include/asterisk/dnsmgr.h
include/asterisk/manager.h
include/asterisk/netsock.h
include/asterisk/rtp.h
include/asterisk/udptl.h
include/asterisk/utils.h
main/acl.c
main/asterisk.c
main/manager.c
main/netsock.c
main/utils.c
pbx/pbx_dundi.c
res/res_agi.c

index d2bd34c9038a5c17856467b0baf5b66d4e92ca58..b092d7abe94d1098f0a6df3076b9f87610c8c3fe 100644 (file)
@@ -305,6 +305,8 @@ AC_SUBST(HAS_POLL)
 # 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>],
index db626c2281e8e439554ece7f28d2a170a104d127..79b787d7054c6c154f1b68c7c185e683174cf3a3 100644 (file)
@@ -28,7 +28,7 @@
 extern "C" {
 #endif
 
-#include <netinet/in.h>
+#include "asterisk/network.h"
 #include "asterisk/io.h"
 
 #define AST_SENSE_DENY                  0
index e5b8f04851e2e5e32d63fc06a0e611a7d39aaab4..5be612e44efe4519250c1fa6060063ffe5cd364e 100644 (file)
    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
 
index c9061dc42c65c47c0910fc7876732cdd48ba6c30..33b9556e70ab12fb77b4636603fd7ad4f5ccc19c 100644 (file)
@@ -27,7 +27,7 @@
 extern "C" {
 #endif
 
-#include <netinet/in.h>
+#include "asterisk/network.h"
 
 struct ast_dnsmgr_entry;
 
index cef48ed48f10d14c68a66ba73a2985f0fbf809c3..6566713f156f7fced040503e702e3f0bd6e3241c 100644 (file)
 #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"
 
 /*!
index f3c932bf1e7ed6c79ed1d78cad23c1fe45526d46..988d51fcf08ec54da9aeb2014ff97bc597c0dedb 100644 (file)
@@ -28,7 +28,7 @@
 extern "C" {
 #endif
 
-#include <netinet/in.h>
+#include "asterisk/network.h"
 #include "asterisk/io.h"
 #include "asterisk/astobj.h"
 
index 8d54cbe88a275ac3b89b1fc5e11c307907e92d77..56ac76e866381a3e958f5266309eb697847899b4 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef _ASTERISK_RTP_H
 #define _ASTERISK_RTP_H
 
-#include <netinet/in.h>
+#include "asterisk/network.h"
 
 #include "asterisk/frame.h"
 #include "asterisk/io.h"
index 4ee72b825fcd3d59f9baa5eecde2d9f1f97e0338..090cc5b0788821454c43b4d07ef59a05e6a0271e 100644 (file)
 #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,
index c79cc8d0bb6edd30959a7036a57e7a91a668139c..6b55a4272b920b859175034f8ad7e7d60e682bc2 100644 (file)
@@ -23,9 +23,8 @@
 #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 */
 
@@ -310,23 +309,6 @@ static force_inline void ast_slinear_saturated_divide(short *input, short *value
 
 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
@@ -346,13 +328,6 @@ int ast_wait_for_input(int fd, int ms);
 */
 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)
  */
index f82a0805cfc46bad3229b9d019bc8805c13893d6..03a01e73964e245fdec7156c82aec5eca544d538 100644 (file)
@@ -30,13 +30,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #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__)
index 3db9c0ca5ecac1d7e7269dfbce6a6addf9ad8fb5..905fb2f4581c62eb926a0da8a99bf6e9340ca46a 100644 (file)
@@ -67,7 +67,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <fcntl.h>
 #include <signal.h>
 #include <sched.h>
-#include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/wait.h>
 #include <errno.h>
@@ -87,14 +86,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #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"
index 7708d324f3de343b51ed1760550755f4355e995f..9edc02ad1ba73652e444ccb4bad8da05ded20fff 100644 (file)
@@ -47,11 +47,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #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>
index b391fc4eee319fc15cbf1adf1d65844676c87d4f..6cd5e090f21f438d722a98a7a5636295e02e01ab 100644 (file)
@@ -32,13 +32,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #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__)
index 586e1ccc77d86cbc829a1894d20a373656a2a5f9..ebec01e3831eeff939abc69bb750da9596d978ff 100644 (file)
@@ -30,15 +30,13 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #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"
index f2c3be341cb972dc93b5ef05dc22900ff658bf61..bcbce6e4eadc048a64345dc3a1230ca8a8806715 100644 (file)
 
 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>
index 36ad040b3503b90bdd28091c35f05ad3bdf961ee..55659f3cf752579038b643c1e645b279c2c61f25 100644 (file)
 
 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>
@@ -40,6 +35,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <sys/wait.h>
 #include <sys/stat.h>
 
+#include "asterisk/network.h"
 #include "asterisk/file.h"
 #include "asterisk/logger.h"
 #include "asterisk/channel.h"