Lines Matching refs:dns_msg
739 struct dns_msg_t *dns_msg, in dns_validate_msg() argument
757 if (dns_msg->msg_size < (sizeof(*dns_id) + sizeof(uint16_t))) { in dns_validate_msg()
768 *dns_id = dns_unpack_header_id(dns_msg->msg); in dns_validate_msg()
770 if (dns_header_rcode(dns_msg->msg) == DNS_HEADER_REFUSED) { in dns_validate_msg()
778 if (dns_header_qr(dns_msg->msg) == DNS_QUERY) { in dns_validate_msg()
783 ret = dns_unpack_response_header(dns_msg, *dns_id); in dns_validate_msg()
789 if (dns_header_qdcount(dns_msg->msg) != 1) { in dns_validate_msg()
797 ret = dns_unpack_response_query(dns_msg); in dns_validate_msg()
813 dns_msg->answer_offset = dns_msg->query_offset; in dns_validate_msg()
827 while (server_idx < dns_header_ancount(dns_msg->msg)) { in dns_validate_msg()
828 ret = dns_unpack_answer(dns_msg, answer_ptr, &ttl, in dns_validate_msg()
835 switch (dns_msg->response_type) { in dns_validate_msg()
841 query_name = dns_msg->msg + dns_msg->query_offset; in dns_validate_msg()
903 if (dns_msg->response_length < address_size) { in dns_validate_msg()
909 if ((dns_msg->response_position + address_size) > in dns_validate_msg()
910 dns_msg->msg_size) { in dns_validate_msg()
916 src = dns_msg->msg + dns_msg->response_position; in dns_validate_msg()
932 answer_ptr = dns_msg->response_position; in dns_validate_msg()
941 dns_msg->answer_offset += dns_msg->response_position - in dns_validate_msg()
942 dns_msg->answer_offset; in dns_validate_msg()
943 dns_msg->answer_offset += dns_msg->response_length; in dns_validate_msg()
952 query_name = dns_msg->msg + dns_msg->query_offset; in dns_validate_msg()
967 if (dns_msg->response_type == DNS_RESPONSE_CNAME_NO_IP) { in dns_validate_msg()
968 uint16_t pos = dns_msg->response_position; in dns_validate_msg()
978 dns_msg, pos); in dns_validate_msg()
1008 struct dns_msg_t dns_msg; in dns_read() local
1015 dns_msg.msg = dns_data->data; in dns_read()
1016 dns_msg.msg_size = data_len; in dns_read()
1018 ret = dns_validate_msg(ctx, &dns_msg, dns_id, &query_idx, in dns_read()