ACL: ast_apply_acl_nolog - identical to ast_apply_acl but without logging.

Due to use in res_rtp_asterisk there is a need to be able to apply an
ACL without logging any invalid/denies.  It's probably sensible to at
least validate the ACL once directly after load and report invalid ACLs.

Change-Id: I256169229d945ca7c1bbf228fc492d91df345843
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
This commit is contained in:
Jaco Kroon
2019-12-04 10:35:52 +02:00
parent 91cdb9537e
commit 32160cb456
2 changed files with 34 additions and 5 deletions

View File

@@ -212,6 +212,20 @@ enum ast_acl_sense ast_apply_ha(const struct ast_ha *ha, const struct ast_sockad
*/
enum ast_acl_sense ast_apply_acl(struct ast_acl_list *acl_list, const struct ast_sockaddr *addr, const char *purpose);
/*!
* \brief Apply a set of rules to a given IP address, don't log failure.
*
* \details
* Exactly like ast_apply_acl, except that it will never log anything.
*
* \param acl_list The head of the list of ACLs to evaluate
* \param addr An ast_sockaddr whose address is considered when matching rules
*
* \retval AST_SENSE_ALLOW The IP address passes our ACLs
* \retval AST_SENSE_DENY The IP address fails our ACLs
*/
enum ast_acl_sense ast_apply_acl_nolog(struct ast_acl_list *acl_list, const struct ast_sockaddr *addr);
/*!
* \brief Get the IP address given a hostname
*