• Home
  • Raw
  • Download

Lines Matching refs:rrset

192 	struct rrsetinfo *rrset = NULL;  in getrrsetbyname()  local
264 rrset = calloc(1, sizeof(struct rrsetinfo)); in getrrsetbyname()
265 if (rrset == NULL) { in getrrsetbyname()
269 rrset->rri_rdclass = response->query->class; in getrrsetbyname()
270 rrset->rri_rdtype = response->query->type; in getrrsetbyname()
271 rrset->rri_ttl = response->answer->ttl; in getrrsetbyname()
272 rrset->rri_nrdatas = response->header.ancount; in getrrsetbyname()
277 rrset->rri_flags |= RRSET_VALIDATED; in getrrsetbyname()
281 rrset->rri_name = strdup(response->answer->name); in getrrsetbyname()
282 if (rrset->rri_name == NULL) { in getrrsetbyname()
288 rrset->rri_nrdatas = count_dns_rr(response->answer, rrset->rri_rdclass, in getrrsetbyname()
289 rrset->rri_rdtype); in getrrsetbyname()
290 rrset->rri_nsigs = count_dns_rr(response->answer, rrset->rri_rdclass, in getrrsetbyname()
294 rrset->rri_rdatas = calloc(rrset->rri_nrdatas, in getrrsetbyname()
296 if (rrset->rri_rdatas == NULL) { in getrrsetbyname()
302 if (rrset->rri_nsigs > 0) { in getrrsetbyname()
303 rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo)); in getrrsetbyname()
304 if (rrset->rri_sigs == NULL) { in getrrsetbyname()
316 if (rr->class == rrset->rri_rdclass && in getrrsetbyname()
317 rr->type == rrset->rri_rdtype) in getrrsetbyname()
318 rdata = &rrset->rri_rdatas[index_ans++]; in getrrsetbyname()
320 if (rr->class == rrset->rri_rdclass && in getrrsetbyname()
322 rdata = &rrset->rri_sigs[index_sig++]; in getrrsetbyname()
337 *res = rrset; in getrrsetbyname()
341 if (rrset != NULL) in getrrsetbyname()
342 freerrset(rrset); in getrrsetbyname()
349 freerrset(struct rrsetinfo *rrset) in freerrset() argument
353 if (rrset == NULL) in freerrset()
356 if (rrset->rri_rdatas) { in freerrset()
357 for (i = 0; i < rrset->rri_nrdatas; i++) { in freerrset()
358 if (rrset->rri_rdatas[i].rdi_data == NULL) in freerrset()
360 free(rrset->rri_rdatas[i].rdi_data); in freerrset()
362 free(rrset->rri_rdatas); in freerrset()
365 if (rrset->rri_sigs) { in freerrset()
366 for (i = 0; i < rrset->rri_nsigs; i++) { in freerrset()
367 if (rrset->rri_sigs[i].rdi_data == NULL) in freerrset()
369 free(rrset->rri_sigs[i].rdi_data); in freerrset()
371 free(rrset->rri_sigs); in freerrset()
374 if (rrset->rri_name) in freerrset()
375 free(rrset->rri_name); in freerrset()
376 free(rrset); in freerrset()