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
This commit is contained in:
parent
139e5f6dd4
commit
fb8143ad31
|
@ -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>],
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include "asterisk/network.h"
|
||||
#include "asterisk/io.h"
|
||||
|
||||
#define AST_SENSE_DENY 0
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include "asterisk/network.h"
|
||||
|
||||
struct ast_dnsmgr_entry;
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
/*!
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include "asterisk/network.h"
|
||||
#include "asterisk/io.h"
|
||||
#include "asterisk/astobj.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"
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
*/
|
||||
|
|
|
@ -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__)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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__)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -30,21 +30,9 @@
|
|||
|
||||
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>
|
||||
|
|
|
@ -27,11 +27,6 @@
|
|||
|
||||
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"
|
||||
|
|
Reference in New Issue