Lines Matching refs:rep
99 struct reply_info* rep; in construct_reply_info_base() local
105 rep = (struct reply_info*)regional_alloc(region, s); in construct_reply_info_base()
106 else rep = (struct reply_info*)malloc(s + in construct_reply_info_base()
108 if(!rep) in construct_reply_info_base()
110 rep->flags = flags; in construct_reply_info_base()
111 rep->qdcount = qd; in construct_reply_info_base()
112 rep->ttl = ttl; in construct_reply_info_base()
113 rep->prefetch_ttl = prettl; in construct_reply_info_base()
114 rep->serve_expired_ttl = expttl; in construct_reply_info_base()
115 rep->an_numrrsets = an; in construct_reply_info_base()
116 rep->ns_numrrsets = ns; in construct_reply_info_base()
117 rep->ar_numrrsets = ar; in construct_reply_info_base()
118 rep->rrset_count = total; in construct_reply_info_base()
119 rep->security = sec; in construct_reply_info_base()
120 rep->reason_bogus = reason_bogus; in construct_reply_info_base()
122 rep->reason_bogus_str = NULL; in construct_reply_info_base()
123 rep->authoritative = 0; in construct_reply_info_base()
126 rep->rrsets = (struct ub_packed_rrset_key**)&(rep->ref[0]); in construct_reply_info_base()
127 else rep->rrsets = (struct ub_packed_rrset_key**)&(rep->ref[total]); in construct_reply_info_base()
129 memset( rep->rrsets, 0, sizeof(struct ub_packed_rrset_key*) * total); in construct_reply_info_base()
131 memset( &rep->ref[0], 0, sizeof(struct rrset_ref) * total); in construct_reply_info_base()
132 return rep; in construct_reply_info_base()
137 parse_create_repinfo(struct msg_parse* msg, struct reply_info** rep, in parse_create_repinfo() argument
140 *rep = construct_reply_info_base(region, msg->flags, msg->qdcount, 0, in parse_create_repinfo()
143 if(!*rep) in parse_create_repinfo()
149 reply_info_alloc_rrset_keys(struct reply_info* rep, struct alloc_cache* alloc, in reply_info_alloc_rrset_keys() argument
153 for(i=0; i<rep->rrset_count; i++) { in reply_info_alloc_rrset_keys()
155 rep->rrsets[i] = (struct ub_packed_rrset_key*) in reply_info_alloc_rrset_keys()
158 if(rep->rrsets[i]) { in reply_info_alloc_rrset_keys()
159 memset(rep->rrsets[i], 0, in reply_info_alloc_rrset_keys()
161 rep->rrsets[i]->entry.key = rep->rrsets[i]; in reply_info_alloc_rrset_keys()
164 else rep->rrsets[i] = alloc_special_obtain(alloc); in reply_info_alloc_rrset_keys()
165 if(!rep->rrsets[i]) in reply_info_alloc_rrset_keys()
167 rep->rrsets[i]->entry.data = NULL; in reply_info_alloc_rrset_keys()
173 make_new_reply_info(const struct reply_info* rep, struct regional* region, in make_new_reply_info() argument
184 new_rep = construct_reply_info_base(region, rep->flags, in make_new_reply_info()
185 rep->qdcount, rep->ttl, rep->prefetch_ttl, in make_new_reply_info()
186 rep->serve_expired_ttl, an_numrrsets, 0, 0, an_numrrsets, in make_new_reply_info()
193 new_rep->rrsets[i] = rep->rrsets[i]; in make_new_reply_info()
457 struct reply_info* rep, struct regional* region) in parse_copy_decompress() argument
462 log_assert(rep); in parse_copy_decompress()
463 rep->ttl = MAX_TTL; in parse_copy_decompress()
464 rep->security = sec_status_unchecked; in parse_copy_decompress()
465 if(rep->rrset_count == 0) in parse_copy_decompress()
466 rep->ttl = NORR_TTL; in parse_copy_decompress()
468 for(i=0; i<rep->rrset_count; i++) { in parse_copy_decompress()
470 rep->rrsets[i])) in parse_copy_decompress()
472 data = (struct packed_rrset_data*)rep->rrsets[i]->entry.data; in parse_copy_decompress()
473 if(data->ttl < rep->ttl) in parse_copy_decompress()
474 rep->ttl = data->ttl; in parse_copy_decompress()
478 rep->prefetch_ttl = PREFETCH_TTL_CALC(rep->ttl); in parse_copy_decompress()
479 rep->serve_expired_ttl = rep->ttl + SERVE_EXPIRED_TTL; in parse_copy_decompress()
486 struct reply_info** rep, struct regional* region) in parse_create_msg() argument
491 if(!parse_create_repinfo(msg, rep, region)) in parse_create_msg()
493 if(!reply_info_alloc_rrset_keys(*rep, alloc, region)) { in parse_create_msg()
494 if(!region) reply_info_parsedelete(*rep, alloc); in parse_create_msg()
497 if(!parse_copy_decompress(pkt, msg, *rep, region)) { in parse_create_msg()
498 if(!region) reply_info_parsedelete(*rep, alloc); in parse_create_msg()
505 struct query_info* qinf, struct reply_info** rep, in reply_info_parse() argument
514 *rep = NULL; in reply_info_parse()
529 if(!parse_create_msg(pkt, msg, alloc, qinf, rep, NULL)) { in reply_info_parse()
531 *rep = NULL; in reply_info_parse()
549 reply_info_sortref(struct reply_info* rep) in reply_info_sortref() argument
551 qsort(&rep->ref[0], rep->rrset_count, sizeof(struct rrset_ref), in reply_info_sortref()
556 reply_info_set_ttls(struct reply_info* rep, time_t timenow) in reply_info_set_ttls() argument
559 rep->ttl += timenow; in reply_info_set_ttls()
560 rep->prefetch_ttl += timenow; in reply_info_set_ttls()
561 rep->serve_expired_ttl += timenow; in reply_info_set_ttls()
562 for(i=0; i<rep->rrset_count; i++) { in reply_info_set_ttls()
564 rep->ref[i].key->entry.data; in reply_info_set_ttls()
565 if(i>0 && rep->ref[i].key == rep->ref[i-1].key) in reply_info_set_ttls()
576 reply_info_parsedelete(struct reply_info* rep, struct alloc_cache* alloc) in reply_info_parsedelete() argument
579 if(!rep) in reply_info_parsedelete()
582 for(i=0; i<rep->rrset_count; i++) { in reply_info_parsedelete()
583 ub_packed_rrset_parsedelete(rep->rrsets[i], alloc); in reply_info_parsedelete()
585 if(rep->reason_bogus_str) { in reply_info_parsedelete()
586 free(rep->reason_bogus_str); in reply_info_parsedelete()
587 rep->reason_bogus_str = NULL; in reply_info_parsedelete()
589 free(rep); in reply_info_parsedelete()
751 reply_info_copy(struct reply_info* rep, struct alloc_cache* alloc, in reply_info_copy() argument
755 cp = construct_reply_info_base(region, rep->flags, rep->qdcount, in reply_info_copy()
756 rep->ttl, rep->prefetch_ttl, rep->serve_expired_ttl, in reply_info_copy()
757 rep->an_numrrsets, rep->ns_numrrsets, rep->ar_numrrsets, in reply_info_copy()
758 rep->rrset_count, rep->security, rep->reason_bogus); in reply_info_copy()
762 if(rep->reason_bogus_str && *rep->reason_bogus_str != 0) { in reply_info_copy()
766 * (strlen(rep->reason_bogus_str)+1)); in reply_info_copy()
769 * (strlen(rep->reason_bogus_str)+1)); in reply_info_copy()
776 memcpy(cp->reason_bogus_str, rep->reason_bogus_str, in reply_info_copy()
777 strlen(rep->reason_bogus_str)+1); in reply_info_copy()
786 if(!repinfo_copy_rrsets(cp, rep, region)) { in reply_info_copy()
795 reply_find_final_cname_target(struct query_info* qinfo, struct reply_info* rep) in reply_find_final_cname_target() argument
800 for(i=0; i<rep->an_numrrsets; i++) { in reply_find_final_cname_target()
801 struct ub_packed_rrset_key* s = rep->rrsets[i]; in reply_find_final_cname_target()
816 reply_find_answer_rrset(struct query_info* qinfo, struct reply_info* rep) in reply_find_answer_rrset() argument
821 for(i=0; i<rep->an_numrrsets; i++) { in reply_find_answer_rrset()
822 struct ub_packed_rrset_key* s = rep->rrsets[i]; in reply_find_answer_rrset()
841 struct ub_packed_rrset_key* reply_find_rrset_section_an(struct reply_info* rep, in reply_find_rrset_section_an() argument
845 for(i=0; i<rep->an_numrrsets; i++) { in reply_find_rrset_section_an()
846 struct ub_packed_rrset_key* s = rep->rrsets[i]; in reply_find_rrset_section_an()
857 struct ub_packed_rrset_key* reply_find_rrset_section_ns(struct reply_info* rep, in reply_find_rrset_section_ns() argument
861 for(i=rep->an_numrrsets; i<rep->an_numrrsets+rep->ns_numrrsets; i++) { in reply_find_rrset_section_ns()
862 struct ub_packed_rrset_key* s = rep->rrsets[i]; in reply_find_rrset_section_ns()
873 struct ub_packed_rrset_key* reply_find_rrset(struct reply_info* rep, in reply_find_rrset() argument
877 for(i=0; i<rep->rrset_count; i++) { in reply_find_rrset()
878 struct ub_packed_rrset_key* s = rep->rrsets[i]; in reply_find_rrset()
890 log_dns_msg(const char* str, struct query_info* qinfo, struct reply_info* rep) in log_dns_msg() argument
901 if(!reply_info_encode(qinfo, rep, 0, rep->flags, buf, 0, in log_dns_msg()
966 reply_check_cname_chain(struct query_info* qinfo, struct reply_info* rep) in reply_check_cname_chain() argument
973 for(i=0; i<rep->an_numrrsets; i++) { in reply_check_cname_chain()
974 uint16_t t = ntohs(rep->rrsets[i]->rk.type); in reply_check_cname_chain()
978 if(query_dname_compare(sname, rep->rrsets[i]->rk.dname) != 0){ in reply_check_cname_chain()
984 get_cname_target(rep->rrsets[i], &sname, &snamelen); in reply_check_cname_chain()
991 reply_all_rrsets_secure(struct reply_info* rep) in reply_all_rrsets_secure() argument
994 for(i=0; i<rep->rrset_count; i++) { in reply_all_rrsets_secure()
995 if( ((struct packed_rrset_data*)rep->rrsets[i]->entry.data) in reply_all_rrsets_secure()
1006 struct reply_info* rep; in parse_reply_in_temp_region() local
1016 if(!parse_create_msg(pkt, msg, NULL, qi, &rep, region)) { in parse_reply_in_temp_region()
1019 return rep; in parse_reply_in_temp_region()
1125 struct reply_info* rep, int rcode, struct edns_data* edns, in inplace_cb_reply_call_generic() argument
1139 (void)(*(inplace_cb_reply_func_type*)cb->cb)(qinfo, qstate, rep, in inplace_cb_reply_call_generic()
1147 struct module_qstate* qstate, struct reply_info* rep, int rcode, in inplace_cb_reply_call() argument
1153 qstate, rep, rcode, edns, repinfo, region, start_time); in inplace_cb_reply_call()
1158 struct reply_info* rep, int rcode, struct edns_data* edns, in inplace_cb_reply_cache_call() argument
1164 qinfo, qstate, rep, rcode, edns, repinfo, region, start_time); in inplace_cb_reply_cache_call()
1169 struct reply_info* rep, int rcode, struct edns_data* edns, in inplace_cb_reply_local_call() argument
1175 qinfo, qstate, rep, rcode, edns, repinfo, region, start_time); in inplace_cb_reply_local_call()
1180 struct reply_info* rep, int rcode, struct edns_data* edns, in inplace_cb_reply_servfail_call() argument
1189 inplace_cb_reply_servfail, qinfo, qstate, rep, rcode, edns, repinfo, in inplace_cb_reply_servfail_call()