Lines Matching refs:header
84 size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t now, union mysockaddr *peer_addr, int local_query)
103 if (ntohs(header->qdcount) == 0 || OPCODE(header) != QUERY )
107 if (!(ansp = skip_questions(header, qlen)))
111 p = (unsigned char *)(header+1);
113 for (q = ntohs(header->qdcount); q != 0; q--)
119 nameoffset = p - (unsigned char *)header;
122 if (!extract_name(header, qlen, &p, name, 1, 4))
196 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
221 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
230 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
274 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp, daemon->auth_ttl,
289 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp, daemon->auth_ttl,
323 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp, daemon->auth_ttl,
337 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp, daemon->auth_ttl,
351 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp, daemon->auth_ttl,
384 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
402 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
486 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
507 if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
566 newoffset = ansp - (unsigned char *)header;
568 add_resource_record(header, limit, &trunc, 0, &ansp,
586 newoffset = ansp - (unsigned char *)header;
587 if (add_resource_record(header, limit, &trunc, -offset, &ansp,
600 if (add_resource_record(header, limit, &trunc, offset, &ansp,
620 if (add_resource_record(header, limit, &trunc, -axfroffset, &ansp, daemon->auth_ttl,
628 if (add_resource_record(header, limit, &trunc, -axfroffset, &ansp, daemon->auth_ttl,
644 if (add_resource_record(header, limit, &trunc, -axfroffset, &ansp, daemon->auth_ttl,
659 if (add_resource_record(header, limit, &trunc, -axfroffset, &ansp, daemon->auth_ttl,
674 if (add_resource_record(header, limit, &trunc, -axfroffset, &ansp, daemon->auth_ttl,
695 add_resource_record(header, limit, &trunc, -axfroffset, &ansp,
703 add_resource_record(header, limit, &trunc, -axfroffset, &ansp,
726 if (add_resource_record(header, limit, &trunc, -axfroffset, &ansp,
750 if (add_resource_record(header, limit, &trunc, -axfroffset, &ansp,
771 if (add_resource_record(header, limit, &trunc, -axfroffset, &ansp,
781 if (add_resource_record(header, limit, &trunc, axfroffset, &ansp,
793 /* done all questions, set up header and return length of result */
795 header->hb3 = (header->hb3 & ~(HB3_AA | HB3_TC)) | HB3_QR;
800 header->hb4 |= HB4_RA;
805 header->hb4 &= ~HB4_RA;
810 header->hb3 |= HB3_AA;
814 header->hb3 |= HB3_TC;
817 SET_RCODE(header, NXDOMAIN);
819 SET_RCODE(header, NOERROR); /* no error */
820 header->ancount = htons(anscount);
821 header->nscount = htons(authcount);
822 header->arcount = htons(0);
823 return ansp - (unsigned char *)header;