diff options
author | Luigi Rizzo <rizzo@icir.org> | 2007-11-17 14:11:53 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2007-11-17 14:11:53 +0000 |
commit | a0f06d0dd52fe25593c3d18786dc237e58950bb7 (patch) | |
tree | 7e317730a0c94e6d6b4c04aca0a04ca5fc30d7ca /include/asterisk/utils.h | |
parent | 616189c6ec5cd2c4124b39f307af300b41d1afbd (diff) |
start using asterisk/network.h for network related headers.
Also remove some unnecessary includes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/utils.h')
-rw-r--r-- | include/asterisk/utils.h | 29 |
1 files changed, 2 insertions, 27 deletions
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) */ |