aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-17 14:11:53 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-17 14:11:53 +0000
commitfb8143ad310bd312314014a3cc521bc090870ffb (patch)
tree7e317730a0c94e6d6b4c04aca0a04ca5fc30d7ca /include/asterisk
parent139e5f6dd448a51b1b5df6b2da1f23b43917515e (diff)
start using asterisk/network.h for network related headers.
Also remove some unnecessary includes. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89380 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/acl.h2
-rw-r--r--include/asterisk/autoconfig.h.in3
-rw-r--r--include/asterisk/dnsmgr.h2
-rw-r--r--include/asterisk/manager.h5
-rw-r--r--include/asterisk/netsock.h2
-rw-r--r--include/asterisk/rtp.h2
-rw-r--r--include/asterisk/udptl.h3
-rw-r--r--include/asterisk/utils.h29
8 files changed, 11 insertions, 37 deletions
diff --git a/include/asterisk/acl.h b/include/asterisk/acl.h
index db626c228..79b787d70 100644
--- a/include/asterisk/acl.h
+++ b/include/asterisk/acl.h
@@ -28,7 +28,7 @@
extern "C" {
#endif
-#include <netinet/in.h>
+#include "asterisk/network.h"
#include "asterisk/io.h"
#define AST_SENSE_DENY 0
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index e5b8f0485..5be612e44 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -337,6 +337,9 @@
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
diff --git a/include/asterisk/dnsmgr.h b/include/asterisk/dnsmgr.h
index c9061dc42..33b9556e7 100644
--- a/include/asterisk/dnsmgr.h
+++ b/include/asterisk/dnsmgr.h
@@ -27,7 +27,7 @@
extern "C" {
#endif
-#include <netinet/in.h>
+#include "asterisk/network.h"
struct ast_dnsmgr_entry;
diff --git a/include/asterisk/manager.h b/include/asterisk/manager.h
index cef48ed48..6566713f1 100644
--- a/include/asterisk/manager.h
+++ b/include/asterisk/manager.h
@@ -19,10 +19,7 @@
#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"
/*!
diff --git a/include/asterisk/netsock.h b/include/asterisk/netsock.h
index f3c932bf1..988d51fcf 100644
--- a/include/asterisk/netsock.h
+++ b/include/asterisk/netsock.h
@@ -28,7 +28,7 @@
extern "C" {
#endif
-#include <netinet/in.h>
+#include "asterisk/network.h"
#include "asterisk/io.h"
#include "asterisk/astobj.h"
diff --git a/include/asterisk/rtp.h b/include/asterisk/rtp.h
index 8d54cbe88..56ac76e86 100644
--- a/include/asterisk/rtp.h
+++ b/include/asterisk/rtp.h
@@ -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"
diff --git a/include/asterisk/udptl.h b/include/asterisk/udptl.h
index 4ee72b825..090cc5b07 100644
--- a/include/asterisk/udptl.h
+++ b/include/asterisk/udptl.h
@@ -18,13 +18,12 @@
#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,
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index c79cc8d0b..6b55a4272 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -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)
*/