From 06075d395bfe1e7141986fe6387eefef5a76cb56 Mon Sep 17 00:00:00 2001 From: dvossel Date: Thu, 3 Sep 2009 18:32:32 +0000 Subject: Merge code associated with AST-2009-006 (closes issue #12912) Reported by: rathaus Tested by: tilghman, russell, dvossel, dbrooks git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@216000 f38db490-d61c-443f-a65b-d21fe96a405b --- include/asterisk/acl.h | 12 +++++++++--- include/asterisk/astobj2.h | 10 ++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asterisk/acl.h b/include/asterisk/acl.h index f9114ce11..d3e7a4f5a 100644 --- a/include/asterisk/acl.h +++ b/include/asterisk/acl.h @@ -35,11 +35,17 @@ extern "C" { #define AST_SENSE_ALLOW 1 /* Host based access control */ - -struct ast_ha; +struct ast_ha { + /* Host access rule */ + struct in_addr netaddr; + struct in_addr netmask; + int sense; + struct ast_ha *next; +}; void ast_free_ha(struct ast_ha *ha); -struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path); +void ast_copy_ha(const struct ast_ha *from, struct ast_ha *to); +struct ast_ha *ast_append_ha(char *sense, const char *stuff, struct ast_ha *path); int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin); int ast_get_ip(struct sockaddr_in *sin, const char *value); int ast_get_ip_or_srv(struct sockaddr_in *sin, const char *value, const char *service); diff --git a/include/asterisk/astobj2.h b/include/asterisk/astobj2.h index ec841b888..91836b9e7 100644 --- a/include/asterisk/astobj2.h +++ b/include/asterisk/astobj2.h @@ -290,6 +290,16 @@ enum search_flags { * This implies that it can be passed to the object's hash function * for optimized searching. */ OBJ_POINTER = (1 << 3), + /*! + * \brief Continue if a match is not found in the hashed out bucket + * + * This flag is to be used in combination with OBJ_POINTER. This tells + * the ao2_callback() core to keep searching through the rest of the + * buckets if a match is not found in the starting bucket defined by + * the hash value on the argument. + */ + OBJ_CONTINUE = (1 << 4), + }; /*! -- cgit v1.2.3