Lines Matching refs:rep

78 store_rrsets(struct module_env* env, struct reply_info* rep, time_t now,  in store_rrsets()  argument
84 for(i=0; i<rep->rrset_count; i++) { in store_rrsets()
85 rep->ref[i].key = rep->rrsets[i]; in store_rrsets()
86 rep->ref[i].id = rep->rrsets[i]->id; in store_rrsets()
88 switch(rrset_cache_update(env->rrset_cache, &rep->ref[i], in store_rrsets()
89 env->alloc, ((ntohs(rep->ref[i].key->rk.type)== in store_rrsets()
96 lock_rw_rdlock(&rep->ref[i].key->entry.lock); in store_rrsets()
98 if(rep->ref[i].key->id == 0) in store_rrsets()
101 rep->ref[i].key, region, now); in store_rrsets()
102 lock_rw_unlock(&rep->ref[i].key->entry.lock); in store_rrsets()
113 rep->rrsets[i] = rep->ref[i].key; in store_rrsets()
137 hashvalue_type hash, struct reply_info* rep, time_t leeway, int pside, in dns_cache_store_msg() argument
142 time_t ttl = rep->ttl; in dns_cache_store_msg()
146 for(i=0; i<rep->rrset_count; i++) { in dns_cache_store_msg()
147 rep->ref[i].key = rep->rrsets[i]; in dns_cache_store_msg()
148 rep->ref[i].id = rep->rrsets[i]->id; in dns_cache_store_msg()
153 reply_info_set_ttls(rep, *env->now); in dns_cache_store_msg()
154 store_rrsets(env, rep, *env->now, leeway, pside, qrep, region, in dns_cache_store_msg()
160 reply_info_delete(rep, NULL); in dns_cache_store_msg()
178 reply_info_sortref(rep); in dns_cache_store_msg()
179 if(!(e = query_info_entrysetup(qinfo, rep, hash))) { in dns_cache_store_msg()
183 slabhash_insert(env->msg_cache, hash, &e->entry, rep, env->alloc); in dns_cache_store_msg()
293 if((msg->rep->rrsets[msg->rep->rrset_count] = in addr_to_additional()
295 msg->rep->ar_numrrsets++; in addr_to_additional()
296 msg->rep->rrset_count++; in addr_to_additional()
463 if((msg->rep->rrsets[msg->rep->rrset_count] = in find_add_ds()
465 msg->rep->ns_numrrsets++; in find_add_ds()
466 msg->rep->rrset_count++; in find_add_ds()
488 msg->rep = (struct reply_info*)regional_alloc_zero(region, in dns_msg_create()
490 if(!msg->rep) in dns_msg_create()
494 msg->rep->flags = BIT_QR; /* with QR, no AA */ in dns_msg_create()
495 msg->rep->qdcount = 1; in dns_msg_create()
496 msg->rep->reason_bogus = LDNS_EDE_NONE; in dns_msg_create()
497 msg->rep->rrsets = (struct ub_packed_rrset_key**) in dns_msg_create()
500 if(!msg->rep->rrsets) in dns_msg_create()
509 if(!(msg->rep->rrsets[msg->rep->rrset_count++] = in dns_msg_authadd()
512 msg->rep->ns_numrrsets++; in dns_msg_authadd()
520 if(!(msg->rep->rrsets[msg->rep->rrset_count++] = in dns_msg_ansadd()
523 msg->rep->an_numrrsets++; in dns_msg_ansadd()
590 msg->rep = (struct reply_info*)regional_alloc(region, in gen_dns_msg()
592 if(!msg->rep) in gen_dns_msg()
594 msg->rep->reason_bogus = LDNS_EDE_NONE; in gen_dns_msg()
595 msg->rep->reason_bogus_str = NULL; in gen_dns_msg()
598 msg->rep->rrsets = (struct ub_packed_rrset_key**) in gen_dns_msg()
601 if(!msg->rep->rrsets) in gen_dns_msg()
641 msg->rep->flags = r->flags; in tomsg()
642 msg->rep->qdcount = r->qdcount; in tomsg()
643 msg->rep->ttl = is_expired in tomsg()
647 msg->rep->prefetch_ttl = r->prefetch_ttl - now; in tomsg()
649 msg->rep->prefetch_ttl = PREFETCH_TTL_CALC(msg->rep->ttl); in tomsg()
650 msg->rep->serve_expired_ttl = msg->rep->ttl + SERVE_EXPIRED_TTL; in tomsg()
651 msg->rep->security = r->security; in tomsg()
652 msg->rep->an_numrrsets = r->an_numrrsets; in tomsg()
653 msg->rep->ns_numrrsets = r->ns_numrrsets; in tomsg()
654 msg->rep->ar_numrrsets = r->ar_numrrsets; in tomsg()
655 msg->rep->rrset_count = r->rrset_count; in tomsg()
656 msg->rep->authoritative = r->authoritative; in tomsg()
657 msg->rep->reason_bogus = r->reason_bogus; in tomsg()
659 msg->rep->reason_bogus_str = regional_strdup(region, r->reason_bogus_str); in tomsg()
677 for(i=0; i<msg->rep->rrset_count; i++) { in tomsg()
678 msg->rep->rrsets[i] = packed_rrset_copy_region(r->rrsets[i], in tomsg()
680 if(!msg->rep->rrsets[i]) { in tomsg()
698 res = gen_dns_msg(region, &origin->qinfo, origin->rep->rrset_count); in dns_msg_deepcopy_region()
700 *res->rep = *origin->rep; in dns_msg_deepcopy_region()
701 if(origin->rep->reason_bogus_str) { in dns_msg_deepcopy_region()
702 res->rep->reason_bogus_str = regional_strdup(region, in dns_msg_deepcopy_region()
703 origin->rep->reason_bogus_str); in dns_msg_deepcopy_region()
705 for(i=0; i<res->rep->rrset_count; i++) { in dns_msg_deepcopy_region()
706 res->rep->rrsets[i] = packed_rrset_copy_region( in dns_msg_deepcopy_region()
707 origin->rep->rrsets[i], region, 0); in dns_msg_deepcopy_region()
708 if(!res->rep->rrsets[i]) { in dns_msg_deepcopy_region()
728 msg->rep->flags = BIT_QR; /* reply, no AA, no error */ in rrset_msg()
729 msg->rep->authoritative = 0; /* reply stored in cache can't be authoritative */ in rrset_msg()
730 msg->rep->qdcount = 1; in rrset_msg()
731 msg->rep->ttl = d->ttl - now; in rrset_msg()
732 msg->rep->prefetch_ttl = PREFETCH_TTL_CALC(msg->rep->ttl); in rrset_msg()
733 msg->rep->serve_expired_ttl = msg->rep->ttl + SERVE_EXPIRED_TTL; in rrset_msg()
734 msg->rep->security = sec_status_unchecked; in rrset_msg()
735 msg->rep->an_numrrsets = 1; in rrset_msg()
736 msg->rep->ns_numrrsets = 0; in rrset_msg()
737 msg->rep->ar_numrrsets = 0; in rrset_msg()
738 msg->rep->rrset_count = 1; in rrset_msg()
739 msg->rep->reason_bogus = LDNS_EDE_NONE; in rrset_msg()
740 msg->rep->rrsets[0] = packed_rrset_copy_region(rrset, region, now); in rrset_msg()
741 if(!msg->rep->rrsets[0]) /* copy CNAME */ in rrset_msg()
767 msg->rep->flags = BIT_QR; /* reply, no AA, no error */ in synth_dname_msg()
768 msg->rep->authoritative = 0; /* reply stored in cache can't be authoritative */ in synth_dname_msg()
769 msg->rep->qdcount = 1; in synth_dname_msg()
770 msg->rep->ttl = d->ttl - now; in synth_dname_msg()
771 msg->rep->prefetch_ttl = PREFETCH_TTL_CALC(msg->rep->ttl); in synth_dname_msg()
772 msg->rep->serve_expired_ttl = msg->rep->ttl + SERVE_EXPIRED_TTL; in synth_dname_msg()
773 msg->rep->security = sec_status_unchecked; in synth_dname_msg()
774 msg->rep->an_numrrsets = 1; in synth_dname_msg()
775 msg->rep->ns_numrrsets = 0; in synth_dname_msg()
776 msg->rep->ar_numrrsets = 0; in synth_dname_msg()
777 msg->rep->rrset_count = 1; in synth_dname_msg()
778 msg->rep->reason_bogus = LDNS_EDE_NONE; in synth_dname_msg()
779 msg->rep->rrsets[0] = packed_rrset_copy_region(rrset, region, now); in synth_dname_msg()
780 if(!msg->rep->rrsets[0]) /* copy DNAME */ in synth_dname_msg()
788 msg->rep->flags |= LDNS_RCODE_YXDOMAIN; in synth_dname_msg()
804 msg->rep->rrsets[1] = ck; in synth_dname_msg()
830 msg->rep->ttl = newd->ttl; in synth_dname_msg()
831 msg->rep->prefetch_ttl = PREFETCH_TTL_CALC(newd->ttl); in synth_dname_msg()
832 msg->rep->serve_expired_ttl = newd->ttl + SERVE_EXPIRED_TTL; in synth_dname_msg()
835 msg->rep->an_numrrsets ++; in synth_dname_msg()
836 msg->rep->rrset_count ++; in synth_dname_msg()
862 msg->rep->flags |= LDNS_RCODE_NOTIMPL; in fill_any()
863 msg->rep->security = sec_status_indeterminate; in fill_any()
1056 msg->rep->security = sec_status_unchecked; in dns_cache_lookup()
1079 struct reply_info* rep = NULL; in dns_cache_store() local
1081 rep = reply_info_copy(msgrep, env->alloc, NULL); in dns_cache_store()
1082 if(!rep) in dns_cache_store()
1091 for(i=0; i<rep->rrset_count; i++) { in dns_cache_store()
1093 rep->rrsets[i]->entry.data, *env->now); in dns_cache_store()
1094 ref.key = rep->rrsets[i]; in dns_cache_store()
1095 ref.id = rep->rrsets[i]->id; in dns_cache_store()
1103 reply_info_delete(rep, NULL); in dns_cache_store()
1113 reply_info_parsedelete(rep, env->alloc); in dns_cache_store()
1119 rep->flags |= (BIT_RA | BIT_QR); in dns_cache_store()
1120 rep->flags &= ~(BIT_AA | BIT_CD); in dns_cache_store()
1122 dns_cache_store_msg(env, &qinf, h, rep, leeway, pside, msgrep, in dns_cache_store()
1139 struct reply_info* rep = (struct reply_info*)msg->entry.data; in dns_cache_prefetch_adjust() local
1140 if(rep) { in dns_cache_prefetch_adjust()
1141 rep->prefetch_ttl += adjust; in dns_cache_prefetch_adjust()