handle_event_pass(struct module_qstate* qstate, int id)
{
	struct dns64_qstate* iq = (struct dns64_qstate*)qstate->minfo[id];
	if (iq && iq->state == DNS64_NEW_QUERY
            && qstate->qinfo.qtype == LDNS_RR_TYPE_PTR
            && qstate->qinfo.qname_len == 74
            && !strcmp((char*)&qstate->qinfo.qname[64], "\03ip6\04arpa"))
        /* Handle PTR queries for IPv6 addresses. */
        return handle_ipv6_ptr(qstate, id);

	if (qstate->env->cfg->dns64_synthall &&
	    iq && iq->state == DNS64_NEW_QUERY
	    && qstate->qinfo.qtype == LDNS_RR_TYPE_AAAA)
		return generate_type_A_query(qstate, id);

	if(dns64_always_synth_for_qname(qstate, id) &&
	    iq && iq->state == DNS64_NEW_QUERY
	    && !(qstate->query_flags & BIT_CD)
	    && qstate->qinfo.qtype == LDNS_RR_TYPE_AAAA) {
		verbose(VERB_ALGO, "dns64: ignore-aaaa and synthesize anyway");
		return generate_type_A_query(qstate, id);
	}

	/* We are finished when our sub-query is finished. */
	if (iq && iq->state == DNS64_SUBQUERY_FINISHED)
		return module_finished;

	/* Otherwise, pass request to next module. */
	verbose(VERB_ALGO, "dns64: pass to next module");
	return module_wait_module;
}
handle_event_pass(struct module_qstate* qstate, int id)
{
	struct dns64_qstate* iq = (struct dns64_qstate*)qstate->minfo[id];
	if (iq && iq->state == DNS64_NEW_QUERY
            && qstate->qinfo.qtype == LDNS_RR_TYPE_PTR
            && qstate->qinfo.qname_len == 74
            && !strcmp((char*)&qstate->qinfo.qname[64], "\03ip6\04arpa"))
         
        return handle_ipv6_ptr(qstate, id);

	if (qstate->env->cfg->dns64_synthall &&
	    iq && iq->state == DNS64_NEW_QUERY
	    && qstate->qinfo.qtype == LDNS_RR_TYPE_AAAA)
		return generate_type_A_query(qstate, id);

	if(dns64_always_synth_for_qname(qstate, id) &&
	    iq && iq->state == DNS64_NEW_QUERY
	    && !(qstate->query_flags & BIT_CD)
	    && qstate->qinfo.qtype == LDNS_RR_TYPE_AAAA) {
		verbose(VERB_ALGO, "dns64: ignore-aaaa and synthesize anyway");
		return generate_type_A_query(qstate, id);
	}

	 
	if (iq && iq->state == DNS64_SUBQUERY_FINISHED)
		return module_finished;

	 
	verbose(VERB_ALGO, "dns64: pass to next module");
	return module_wait_module;
}