Home | History | Annotate | Download | only in src

Lines Matching refs:HEADER

206 			 HEADER *header, size_t plen, time_t now, struct frec *forward)
211 unsigned int crc = questions_crc(header, plen, daemon->namebuff);
213 unsigned short gotname = extract_request(header, plen, daemon->namebuff, NULL);
219 else if (forward || (forward = lookup_frec_by_sender(ntohs(header->id), udpaddr, crc)))
232 header->id = htons(forward->new_id);
247 find_pseudoheader(header, plen, NULL, NULL, &is_sign);
252 forward->orig_id = ntohs(header->id);
257 header->id = htons(forward->new_id);
335 if (sendto(fd, (char *)header, plen, 0,
378 header->id = htons(forward->orig_id);
385 plen = setup_reply(header, plen, addrp, flags, daemon->local_ttl);
386 send_from(udpfd, daemon->options & OPT_NOWILD, (char *)header, plen, udpaddr, dst_addr, dst_iface);
392 static size_t process_reply(HEADER *header, time_t now,
403 if ((pheader = find_pseudoheader(header, n, &plen, &sizep, &is_sign)) && !is_sign)
413 if (header->opcode != QUERY || (header->rcode != NOERROR && header->rcode != NXDOMAIN))
417 if (!header->ra && header->rcode == NOERROR && ntohs(header->ancount) == 0 &&
426 if (daemon->bogus_addr && header->rcode != NXDOMAIN &&
427 check_for_bogus_wildcard(header, n, daemon->namebuff, daemon->bogus_addr, now))
430 header->rcode = NXDOMAIN;
431 header->aa = 0;
435 if (header->rcode == NXDOMAIN &&
436 extract_request(header, n, daemon->namebuff, NULL) &&
443 header->aa = 1;
444 header->rcode = NOERROR;
447 if (extract_addresses(header, n, daemon->namebuff, now))
459 header->ancount = htons(0);
460 header->nscount = htons(0);
461 header->arcount = htons(0);
467 return resize_packet(header, n, pheader, plen);
475 HEADER *header;
499 header = (HEADER *)daemon->packet;
502 n < (int)sizeof(HEADER) || !header->qr ||
503 !(forward = lookup_frec(ntohs(header->id), questions_crc(header, n, daemon->namebuff))))
508 if ((header->rcode == SERVFAIL || header->rcode == REFUSED) &&
518 pheader = find_pseudoheader(header, (size_t)n, &plen, NULL, &is_sign);
521 header->ancount = htons(0);
522 header->nscount = htons(0);
523 header->arcount = htons(0);
524 if ((nn = resize_packet(header
526 header->qr = 0;
527 header->tc = 0;
528 forward_query(-1, NULL, NULL, 0, header, nn, now, forward);
536 if (header->rcode == SERVFAIL || header->rcode == REFUSED)
560 (header->rcode != REFUSED && header->rcode != SERVFAIL))
562 if ((nn = process_reply(header, now, server, (size_t)n)))
564 header->id = htons(forward->orig_id);
565 header->ra = 1; /* recursion if available */
576 HEADER *header = (HEADER *)daemon->packet;
631 if (n < (int)sizeof(HEADER) ||
633 header->qr)
698 if (extract_request(header, (size_t)n, daemon->namebuff, &type))
714 m = answer_request (header, ((char *) header) + PACKETSZ, (size_t)n,
718 send_from(listen->fd, daemon->options & OPT_NOWILD, (char *)header,
723 header, (size_t)n, now, NULL))
742 HEADER *header;
753 if (size < (int)sizeof(HEADER))
756 header = (HEADER *)packet;
758 if ((gotname = extract_request(header, (unsigned int)size, daemon->namebuff, &qtype)))
781 m = answer_request(header, ((char *) header) + 65536, (unsigned int)size,
805 unsigned int crc = questions_crc(header, (unsigned int)size, daemon->namebuff);
876 if (crc == questions_crc(header, (unsigned int)m, daemon->namebuff))
877 m = process_reply(header, now, last_server, (unsigned int)m);
885 m = setup_reply(header, (unsigned int)size, addrp, flags, daemon->local_ttl);