query flags for detect cycle.

git-svn-id: file:///svn/unbound/trunk@469 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-08-01 11:29:12 +00:00
parent ac895c6d35
commit ec4878be75
5 changed files with 13 additions and 7 deletions

View file

@ -2,6 +2,7 @@
- set version to 0.5
- module work for module to module interconnections.
- config of modules.
- detect cycle takes flags.
31 July 2007: Wouter
- updated plan

View file

@ -365,7 +365,7 @@ causes_cycle(struct module_qstate* qstate, uint8_t* name, size_t namelen,
qinf.qname_len = namelen;
qinf.qtype = t;
qinf.qclass = c;
return (*qstate->env->detect_cycle)(qstate, &qinf);
return (*qstate->env->detect_cycle)(qstate, &qinf, BIT_RD, 0);
}
void

View file

@ -607,11 +607,12 @@ find_in_subsub(struct mesh_state* m, struct mesh_state* tofind)
}
int
mesh_detect_cycle(struct module_qstate* qstate, struct query_info* qinfo)
mesh_detect_cycle(struct module_qstate* qstate, struct query_info* qinfo,
uint16_t flags, int prime)
{
struct mesh_area* mesh = qstate->env->mesh;
struct mesh_state* cyc_m = qstate->mesh_info;
struct mesh_state* dep_m = mesh_area_find(mesh, qinfo, BIT_RD, 0);
struct mesh_state* dep_m = mesh_area_find(mesh, qinfo, flags, prime);
if(!dep_m)
return 0;
if(dep_m == cyc_m || find_in_subsub(dep_m, cyc_m))

View file

@ -362,10 +362,13 @@ size_t mesh_get_mem(struct mesh_area* mesh);
* trees.
* @param qstate: given mesh querystate.
* @param qinfo: query info for dependency.
* @param flags: query flags of dependency.
* @param prime: if dependency is a priming query or not.
* @return true if the name,type,class exists and the given qstate mesh exists
* as a dependency of that name. Thus if qstate becomes dependent on
* name,type,class then a cycle is created.
*/
int mesh_detect_cycle(struct module_qstate* qstate, struct query_info* qinfo);
int mesh_detect_cycle(struct module_qstate* qstate, struct query_info* qinfo,
uint16_t flags, int prime);
#endif /* SERVICES_MESH_H */

View file

@ -202,15 +202,16 @@ struct module_env {
* Detect if adding a dependency for qstate on name,type,class will
* create a dependency cycle.
* @param qstate: given mesh querystate.
* @param qinfo: query info for dependency. Assumed RDflag and not
* priming.
* @param qinfo: query info for dependency.
* @param flags: query flags of dependency, RD/CD flags.
* @param prime: if dependency is a priming query or not.
* @return true if the name,type,class exists and the given
* qstate mesh exists as a dependency of that name. Thus
* if qstate becomes dependent on name,type,class then a
* cycle is created.
*/
int (*detect_cycle)(struct module_qstate* qstate,
struct query_info* qinfo);
struct query_info* qinfo, uint16_t flags, int prime);
/** region for temporary usage. May be cleared after operate() call. */
struct region* scratch;