From 15de2de8449b4f5063f93578ae68aa0bc79a205c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sat, 12 May 2018 11:54:35 +0000 Subject: Vendor import of Unbound 1.6.4. --- services/mesh.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'services/mesh.h') diff --git a/services/mesh.h b/services/mesh.h index 1c77945320e31..67749accb35af 100644 --- a/services/mesh.h +++ b/services/mesh.h @@ -370,6 +370,35 @@ void mesh_detach_subs(struct module_qstate* qstate); int mesh_attach_sub(struct module_qstate* qstate, struct query_info* qinfo, uint16_t qflags, int prime, int valrec, struct module_qstate** newq); +/** + * Add detached query. + * Creates it if it does not exist already. + * Does not make super/sub references. + * Performs a cycle detection - for double check - and fails if there is one. + * Updates stat items in mesh_area structure. + * Pass if it is priming query or not. + * return: + * o if error (malloc) happened. + * o need to initialise the new state (module init; it is a new state). + * so that the next run of the query with this module is successful. + * o no init needed, attachment successful. + * o added subquery, created if it did not exist already. + * + * @param qstate: the state to find mesh state, and that wants to receive + * the results from the new subquery. + * @param qinfo: what to query for (copied). + * @param qflags: what flags to use (RD / CD flag or not). + * @param prime: if it is a (stub) priming query. + * @param valrec: if it is a validation recursion query (lookup of key, DS). + * @param newq: If the new subquery needs initialisation, it is returned, + * otherwise NULL is returned. + * @param sub: The added mesh state, created if it did not exist already. + * @return: false on error, true if success (and init may be needed). + */ +int mesh_add_sub(struct module_qstate* qstate, struct query_info* qinfo, + uint16_t qflags, int prime, int valrec, struct module_qstate** newq, + struct mesh_state** sub); + /** * Query state is done, send messages to reply entries. * Encode messages using reply entry values and the querystate (with original -- cgit v1.2.3