Lines Matching refs:query
202 static void add_answer(struct net_buf *query, enum dns_rr_type qtype, in add_answer() argument
205 char *dot = query->data + DNS_MSG_HEADER_SIZE; in add_answer()
224 query->len += 1; in add_answer()
226 offset = DNS_MSG_HEADER_SIZE + query->len; in add_answer()
227 UNALIGNED_PUT(htons(qtype), (uint16_t *)(query->data+offset)); in add_answer()
232 (uint16_t *)(query->data+offset)); in add_answer()
236 UNALIGNED_PUT(htonl(ttl), query->data + offset); in add_answer()
239 UNALIGNED_PUT(htons(addr_len), query->data + offset); in add_answer()
242 memcpy(query->data + offset, addr, addr_len); in add_answer()
246 struct net_buf *query, in create_answer() argument
253 if ((net_buf_max_len(query) - query->len) < (DNS_MSG_HEADER_SIZE + in create_answer()
260 memmove(query->data + DNS_MSG_HEADER_SIZE, query->data, query->len); in create_answer()
262 setup_dns_hdr(query->data, 1); in create_answer()
264 add_answer(query, qtype, MDNS_TTL, addr_len, addr); in create_answer()
266 query->len += DNS_MSG_HEADER_SIZE + in create_answer()
277 struct net_buf *query, in send_response() argument
311 ret = create_answer(sock, query, qtype, sizeof(struct in_addr), (uint8_t *)addr); in send_response()
328 ret = create_answer(sock, query, qtype, sizeof(struct in6_addr), (uint8_t *)addr); in send_response()
337 ret = zsock_sendto(sock, query->data, query->len, 0, in send_response()