From: W.C.A. Wijngaards Date: Mon, 22 Mar 2021 08:49:22 +0000 (+0100) Subject: - rpz-triggers, function documentation comments for iterator callback X-Git-Tag: release-1.14.0rc1~62^2~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3dd804755bec46dc9bee035c38ee2b081c3d41d2;p=thirdparty%2Funbound.git - rpz-triggers, function documentation comments for iterator callback functions. --- diff --git a/services/rpz.c b/services/rpz.c index 1daaf9bf2..24029537b 100644 --- a/services/rpz.c +++ b/services/rpz.c @@ -1068,7 +1068,7 @@ rpz_insert_rr(struct rpz* r, uint8_t* azname, size_t aznamelen, uint8_t* dname, /** * Find RPZ local-zone by qname. - * @param r: rpz containing local-zone tree + * @param zones: local-zone tree * @param qname: qname * @param qname_len: length of qname * @param qclass: qclass diff --git a/services/rpz.h b/services/rpz.h index 74a8d09e2..642548bdd 100644 --- a/services/rpz.h +++ b/services/rpz.h @@ -50,6 +50,7 @@ #include "sldns/sbuffer.h" #include "daemon/stats.h" #include "respip/respip.h" +struct iter_qstate; /** * RPZ triggers, only the QNAME trigger is currently supported in Unbound. @@ -180,10 +181,28 @@ int rpz_callback_from_worker_request(struct auth_zones* az, struct module_env* e struct regional* temp, struct comm_reply* repinfo, uint8_t* taglist, size_t taglen, struct ub_server_stats* stats); -struct iter_qstate; -struct dns_msg* rpz_callback_from_iterator_module(struct module_qstate*, struct iter_qstate*); +/** + * Callback to process when the iterator module is about to send queries. + * Checks for nsip and nsdname triggers. + * @param qstate: the query state. + * @param iq: iterator module query state. + * @return NULL if nothing is done. Or a new message with the contents from + * the rpz, based on the delegation point. It is allocated in the + * qstate region. + */ +struct dns_msg* rpz_callback_from_iterator_module(struct module_qstate* qstate, + struct iter_qstate* iq); -struct dns_msg* rpz_callback_from_iterator_cname(struct module_qstate*, struct iter_qstate*); +/** + * Callback to process when the iterator module has followed a cname. + * There can be a qname trigger for the new query name. + * @param qstate: the query state. + * @param iq: iterator module query state. + * @return NULL if nothing is done. Or a new message with the contents from + * the rpz, based on the iq.qchase. It is allocated in the qstate region. + */ +struct dns_msg* rpz_callback_from_iterator_cname(struct module_qstate* qstate, + struct iter_qstate* iq); /** * Delete RPZ