Lines Matching refs:qlen
430 static unsigned char* do_doctor(unsigned char* p, int count, HEADER* header, size_t qlen) { in do_doctor() argument
435 if (!(p = skip_name(p, header, qlen, 10))) return 0; /* bad packet */ in do_doctor()
446 if (!CHECK_LEN(header, p, qlen, INADDRSZ)) return 0; in do_doctor()
467 if (!ADD_RDLEN(header, p, qlen, rdlen)) return 0; /* bad packet */ in do_doctor()
473 static int find_soa(HEADER* header, size_t qlen) { in find_soa() argument
480 if (!(p = skip_questions(header, qlen)) || in find_soa()
481 !(p = do_doctor(p, ntohs(header->ancount), header, qlen))) in find_soa()
485 if (!(p = skip_name(p, header, qlen, 10))) return 0; /* bad packet */ in find_soa()
497 if (!(p = skip_name(p, header, qlen, 0))) return 0; in find_soa()
499 if (!(p = skip_name(p, header, qlen, 20))) return 0; in find_soa()
504 } else if (!ADD_RDLEN(header, p, qlen, rdlen)) in find_soa()
509 if (!do_doctor(p, ntohs(header->arcount), header, qlen)) return 0; in find_soa()
520 int extract_addresses(HEADER* header, size_t qlen, char* name, time_t now) { in extract_addresses() argument
531 ttl = find_soa(header, qlen); in extract_addresses()
544 if (!extract_name(header, qlen, &p, name, 1, 4)) return 0; /* bad packet */ in extract_addresses()
560 if (!(p1 = skip_questions(header, qlen))) return 0; in extract_addresses()
565 if (!extract_name(header, qlen, &tmp, name, 1, 0) || in extract_addresses()
566 !(res = extract_name(header, qlen, &p1, name, 0, 10))) in extract_addresses()
579 if (!extract_name(header, qlen, &p1, name, 1, 0)) return 0; in extract_addresses()
591 if (!CHECK_LEN(header, p1, qlen, 0)) return 0; /* bad packet */ in extract_addresses()
598 ttl = find_soa(header, qlen); in extract_addresses()
623 if (!(p1 = skip_questions(header, qlen))) return 0; in extract_addresses()
626 if (!(res = extract_name(header, qlen, &p1, name, 0, 10))) in extract_addresses()
647 if (!extract_name(header, qlen, &p1, name, 1, 0)) return 0; in extract_addresses()
653 if (!CHECK_LEN(header, p1, qlen, addrlen)) return 0; /* bad packet */ in extract_addresses()
671 if (!CHECK_LEN(header, p1, qlen, 0)) return 0; /* bad packet */ in extract_addresses()
678 ttl = find_soa(header, qlen); in extract_addresses()
704 unsigned short extract_request(HEADER* header, size_t qlen, char* name, unsigned short* typep) { in extract_request() argument
713 if (!extract_name(header, qlen, &p, name, 1, 4)) return 0; /* bad packet */ in extract_request()
730 size_t setup_reply(HEADER* header, size_t qlen, struct all_addr* addrp, unsigned short flags, in setup_reply() argument
734 if (!(p = skip_questions(header, qlen))) return 0; in setup_reply()
801 int check_for_bogus_wildcard(HEADER* header, size_t qlen, char* name, struct bogus_addr* baddr, in check_for_bogus_wildcard() argument
809 if (!(p = skip_questions(header, qlen))) return 0; /* bad packet */ in check_for_bogus_wildcard()
812 if (!extract_name(header, qlen, &p, name, 1, 10)) return 0; /* bad packet */ in check_for_bogus_wildcard()
820 if (!CHECK_LEN(header, p, qlen, INADDRSZ)) return 0; in check_for_bogus_wildcard()
835 if (!ADD_RDLEN(header, p, qlen, rdlen)) return 0; in check_for_bogus_wildcard()
937 size_t answer_request(HEADER* header, char* limit, size_t qlen, struct in_addr local_addr, in answer_request() argument
953 if (qlen > (size_t)(limit - ((char*) header))) return 0; in answer_request()
961 if (find_pseudoheader(header, qlen, NULL, &pheader, &is_sign)) { in answer_request()
986 if (!(ansp = skip_questions(header, qlen))) return 0; /* bad packet */ in answer_request()
996 if (!extract_name(header, qlen, &p, name, 1, 4)) return 0; /* bad packet */ in answer_request()