Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

acl.h

Go to the documentation of this file.
00001 /* 00002 * Asterisk -- A telephony toolkit for Linux. 00003 * 00004 * Access Control of various sorts 00005 * 00006 * Copyright (C) 1999, Mark Spencer 00007 * 00008 * Mark Spencer <markster@linux-support.net> 00009 * 00010 * This program is free software, distributed under the terms of 00011 * the GNU General Public License 00012 */ 00013 00014 #ifndef _ASTERISK_ACL_H 00015 #define _ASTERISK_ACL_H 00016 00017 #define AST_SENSE_DENY 0 00018 #define AST_SENSE_ALLOW 1 00019 00020 00021 #if defined(__cplusplus) || defined(c_plusplus) 00022 extern "C" { 00023 #endif 00024 00025 #include <netinet/in.h> 00026 00027 /* Host based access control */ 00028 00029 struct ast_ha; 00030 00031 extern void ast_free_ha(struct ast_ha *ha); 00032 extern struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path); 00033 extern int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin); 00034 extern int ast_get_ip(struct sockaddr_in *sin, char *value); 00035 extern int ast_ouraddrfor(struct in_addr *them, struct in_addr *us); 00036 extern int ast_lookup_iface(char *iface, struct in_addr *address); 00037 extern struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original); 00038 00039 //! Compares the source address and port of two sockaddr_in 00040 static inline int inaddrcmp(struct sockaddr_in *sin1, struct sockaddr_in *sin2) 00041 { 00042 return ((sin1->sin_addr.s_addr != sin2->sin_addr.s_addr ) 00043 || (sin1->sin_port != sin2->sin_port)); 00044 } 00045 00046 #if defined(__cplusplus) || defined(c_plusplus) 00047 } 00048 #endif 00049 00050 #endif

Generated on Sat Jun 12 16:40:57 2004 for Asterisk by doxygen 1.3.7