Lines Matching full:query

194 static void add_question(struct net_buf *query, enum dns_rr_type qtype)  in add_question()  argument
196 char *dot = query->data + DNS_MSG_HEADER_SIZE; in add_question()
214 offset = DNS_MSG_HEADER_SIZE + query->len + 1; in add_question()
215 UNALIGNED_PUT(htons(qtype), (uint16_t *)(query->data+offset)); in add_question()
218 UNALIGNED_PUT(htons(DNS_CLASS_IN), (uint16_t *)(query->data+offset)); in add_question()
221 static int add_answer(struct net_buf *query, uint32_t ttl, in add_answer() argument
224 const uint16_t q_len = query->len + 1 + DNS_QTYPE_LEN + DNS_QCLASS_LEN; in add_answer()
227 memcpy(query->data + offset, query->data + DNS_MSG_HEADER_SIZE, q_len); in add_answer()
230 UNALIGNED_PUT(htonl(ttl), query->data + offset); in add_answer()
233 UNALIGNED_PUT(htons(addr_len), query->data + offset); in add_answer()
236 memcpy(query->data + offset, addr, addr_len); in add_answer()
242 struct net_buf *query, in create_answer() argument
246 /* Prepare the response into the query buffer: move the name in create_answer()
247 * query buffer has to get enough free space: dns_hdr + query + answer in create_answer()
249 if ((net_buf_max_len(query) - query->len) < (DNS_MSG_HEADER_SIZE + in create_answer()
252 addr_len + query->len)) { in create_answer()
256 memmove(query->data + DNS_MSG_HEADER_SIZE, query->data, query->len); in create_answer()
258 setup_dns_hdr(query->data, 1, dns_id); in create_answer()
260 add_question(query, qtype); in create_answer()
262 query->len = add_answer(query, LLMNR_TTL, addr_len, addr); in create_answer()
304 struct net_buf *query, in create_ipv4_answer() argument
324 if (create_answer(qtype, query, dns_id, addr_len, addr)) { in create_ipv4_answer()
337 struct net_buf *query, in create_ipv6_answer() argument
357 if (create_answer(qtype, query, dns_id, addr_len, addr)) { in create_ipv6_answer()
445 /* Store the DNS query name into a temporary net_buf, which will be in dns_read()
469 queries > 1 ? "queries" : "query", in dns_read()
487 NET_DBG("[%d] query %s/%s label %s (%d bytes)", queries, in dns_read()
491 /* If the query matches to our hostname, then send reply */ in dns_read()
494 NET_DBG("%s query to our hostname %s", "LLMNR", in dns_read()