Home | History | Annotate | Download | only in dns64

Lines Matching refs:qstate

90 	/** If the dns64 module started with no_cache bool set in the qstate,
455 * \param qstate Query state structure.
461 handle_ipv6_ptr(struct module_qstate* qstate, int id)
463 struct dns64_env* dns64_env = (struct dns64_env*)qstate->env->modinfo[id];
471 if (!ptr_to_ipv6((char*)qstate->qinfo.qname, sin6.sin6_addr.s6_addr,
491 qinfo = qstate->qinfo;
492 if (!(qinfo.qname = regional_alloc(qstate->region, MAX_PTR_QNAME_IPV4)))
499 fptr_ok(fptr_whitelist_modenv_attach_sub(qstate->env->attach_sub));
500 if(!(*qstate->env->attach_sub)(qstate, &qinfo, qstate->client_info,
501 qstate->query_flags, 0, 0, &subq))
513 generate_type_A_query(struct module_qstate* qstate, int id)
521 qinfo = qstate->qinfo;
525 fptr_ok(fptr_whitelist_modenv_attach_sub(qstate->env->attach_sub));
526 if(!(*qstate->env->attach_sub)(qstate, &qinfo, qstate->client_info,
527 qstate->query_flags, 0, 0, &subq))
545 * @param qstate: query state.
550 dns64_always_synth_for_qname(struct module_qstate* qstate, int id)
552 struct dns64_env* dns64_env = (struct dns64_env*)qstate->env->modinfo[id];
553 int labs = dname_count_labels(qstate->qinfo.qname);
555 qstate->qinfo.qname, qstate->qinfo.qname_len, labs,
556 qstate->qinfo.qclass);
567 * \param qstate A structure representing the state of the query that has just
574 handle_event_pass(struct module_qstate* qstate, int id)
576 struct dns64_qstate* iq = (struct dns64_qstate*)qstate->minfo[id];
577 int synth_all_cfg = qstate->env->cfg->dns64_synthall;
581 && qstate->qinfo.qtype == LDNS_RR_TYPE_PTR
582 && qstate->qinfo.qname_len == 74
583 && !strcmp((char*)&qstate->qinfo.qname[64], "\03ip6\04arpa")) {
585 return handle_ipv6_ptr(qstate, id);
589 qstate->qinfo.qtype == LDNS_RR_TYPE_AAAA &&
591 (synth_qname=(dns64_always_synth_for_qname(qstate, id)
592 && !(qstate->query_flags & BIT_CD))))) {
595 return generate_type_A_query(qstate, id);
611 * \param qstate A structure representing the state of the query that has just
618 handle_event_moddone(struct module_qstate* qstate, int id)
620 struct dns64_qstate* iq = (struct dns64_qstate*)qstate->minfo[id];
627 * - An AAAA query for which an error was returned.(qstate.return_rcode)
638 qstate->qinfo.qtype == LDNS_RR_TYPE_AAAA &&
640 !(qstate->query_flags & BIT_CD);
642 qstate->return_msg &&
643 qstate->return_msg->rep &&
644 reply_find_answer_rrset(&qstate->qinfo, qstate->return_msg->rep);
646 if(could_synth && !has_data && qstate->env->need_to_validate &&
647 qstate->return_msg && qstate->return_msg->rep &&
648 qstate->return_msg->rep->security == sec_status_bogus) {
655 (synth_qname=dns64_always_synth_for_qname(qstate, id)))) {
658 return generate_type_A_query(qstate, id);
663 !qstate->rpz_applied && !qstate->rpz_passthru &&
664 !qstate->is_subnet_answer &&
665 qstate->return_msg &&
666 qstate->return_msg->rep &&
667 !qstate->fwd_stub_no_cache &&
669 qstate->env, &qstate->qinfo, qstate->return_msg->rep,
670 0, qstate->prefetch_leeway, 0, NULL,
671 qstate->query_flags, qstate->qstarttime,
672 qstate->is_valrec))
684 * \param qstate Structure containing the state of the query.
692 dns64_operate(struct module_qstate* qstate, enum module_ev event, int id,
698 id, strextstate(qstate->ext_state[id]),
700 log_query_info(VERB_QUERY, "dns64 operate: query", &qstate->qinfo);
706 qstate->region, sizeof(*iq)))) {
708 qstate->ext_state[id] = module_error;
711 qstate->minfo[id] = iq;
713 iq->started_no_cache_store = qstate->no_cache_store;
714 qstate->no_cache_store = 1;
718 qstate->ext_state[id] = handle_event_pass(qstate, id);
721 qstate->ext_state[id] = handle_event_moddone(qstate, id);
724 qstate->ext_state[id] = module_finished;
727 if(qstate->ext_state[id] == module_finished) {
728 iq = (struct dns64_qstate*)qstate->minfo[id];
730 if(qstate->fwd_stub_no_cache) {
733 qstate->no_cache_store = qstate->fwd_stub_no_cache;
735 qstate->no_cache_store = iq->started_no_cache_store;
834 * \param qstate A query.
837 dns64_adjust_a(int id, struct module_qstate* super, struct module_qstate* qstate)
849 log_assert(qstate->return_msg);
850 log_assert(qstate->return_msg->rep);
863 rep = qstate->return_msg->rep;
942 * \param qstate IPv4 PTR sub-query.
946 dns64_adjust_ptr(struct module_qstate* qstate, struct module_qstate* super)
957 if (!(super->return_msg->rep = reply_info_copy(qstate->return_msg->rep,
967 answer = reply_find_answer_rrset(&qstate->qinfo, super->return_msg->rep);
979 * \param qstate State of the sub-query.
984 dns64_inform_super(struct module_qstate* qstate, int id,
989 &qstate->qinfo);
1013 if(qstate->return_rcode != LDNS_RCODE_NOERROR
1014 || !qstate->return_msg
1015 || !qstate->return_msg->rep) {
1020 if(qstate->qinfo.qtype == LDNS_RR_TYPE_A &&
1021 !reply_find_answer_rrset(&qstate->qinfo,
1022 qstate
1029 super->return_rcode = qstate->return_rcode;
1038 if(qstate->rpz_applied)
1040 if(qstate->rpz_passthru)
1043 /* Since the super qstate has a new response, its errinf is removed. */
1047 if (qstate->qinfo.qtype == LDNS_RR_TYPE_A) {
1048 dns64_adjust_a(id, super, qstate);
1050 log_assert(qstate->qinfo.qtype == LDNS_RR_TYPE_PTR);
1051 dns64_adjust_ptr(qstate, super);
1054 if(qstate->fwd_stub_no_cache)
1060 !qstate->fwd_stub_no_cache &&
1065 qstate->qstarttime, qstate->is_valrec))
1073 * \param qstate Query state.
1077 dns64_clear(struct module_qstate* qstate, int id)
1079 qstate->minfo[id] = NULL;