]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- rpz-triggers, function documentation comments for iterator callback
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 22 Mar 2021 08:49:22 +0000 (09:49 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 22 Mar 2021 08:49:22 +0000 (09:49 +0100)
  functions.

services/rpz.c
services/rpz.h

index 1daaf9bf24da85f280a6bf859cbe7cbd7fa31f75..24029537b2f2edf9dc4d7577ed0acf294a22c0c5 100644 (file)
@@ -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
index 74a8d09e21b81b2ed3283e7153c751fc8d751cde..642548bdd160287843c92d21f7ba48d2c819c672 100644 (file)
@@ -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