Lines Matching refs:resp
387 struct dns_response *resp;
391 resp = calloc(1, sizeof(*resp));
392 if (resp == NULL)
399 memcpy(&resp->header, cp, HFIXEDSZ);
403 resp->header.qdcount = ntohs(resp->header.qdcount);
404 resp->header.ancount = ntohs(resp->header.ancount);
405 resp->header.nscount = ntohs(resp->header.nscount);
406 resp->header.arcount = ntohs(resp->header.arcount);
409 if (resp->header.qdcount < 1) {
410 free_dns_response(resp);
415 resp->query = parse_dns_qsection(answer, size, &cp,
416 resp->header.qdcount);
417 if (resp->header.qdcount && resp->query == NULL) {
418 free_dns_response(resp);
423 resp->answer = parse_dns_rrsection(answer, size, &cp,
424 resp->header.ancount);
425 if (resp->header.ancount && resp->answer == NULL) {
426 free_dns_response(resp);
431 resp->authority = parse_dns_rrsection(answer, size, &cp,
432 resp->header.nscount);
433 if (resp->header.nscount && resp->authority == NULL) {
434 free_dns_response(resp);
439 resp->additional = parse_dns_rrsection(answer, size, &cp,
440 resp->header.arcount);
441 if (resp->header.arcount && resp->additional == NULL) {
442 free_dns_response(resp);
446 return (resp);