diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-19 23:17:02 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-19 23:17:02 +0000 |
commit | c37a8a42b203bde0af14dc15b38a383ae6fbdb27 (patch) | |
tree | a00032c636bed69c8be6688a11afc43bc4053dfe /include/asterisk/utils.h | |
parent | d03367cafcf78ba084b460c8a3555405e54362ed (diff) |
split acl and netsock code into separate files, in preparation for new netsock implementation
various minor cleanups
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6165 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/utils.h')
-rwxr-xr-x | include/asterisk/utils.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index 246da5e76..1d398fa10 100755 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -136,14 +136,22 @@ extern int ast_base64decode(unsigned char *dst, char *src, int max); extern int test_for_thread_safety(void); extern const char *ast_inet_ntoa(char *buf, int bufsiz, struct in_addr ia); -extern int ast_utils_init(void); -extern int ast_wait_for_input(int fd, int ms); #ifdef inet_ntoa #undef inet_ntoa #endif #define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__ +extern int ast_utils_init(void); +extern int ast_wait_for_input(int fd, int ms); + +/*! Compares the source address and port of two sockaddr_in */ +static 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)); +} + #define AST_STACKSIZE 256 * 1024 #define ast_pthread_create(a,b,c,d) ast_pthread_create_stack(a,b,c,d,0) extern int ast_pthread_create_stack(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *data, size_t stacksize); |