Lines Matching defs:reply
248 /** If reply should be sent unicast */
251 * question again in reply before answer) */
271 /** unicast reply requested */
665 * if reply bit has REPLY_HOST_PTR_V6 set
896 * reply with a unicast packet
951 * Write answer to reply packet.
955 * @param reply The outpacket to write to
960 * this reply replaces any earlier answer for this domain/type/class
968 mdns_add_answer(struct mdns_outpacket *reply, struct mdns_domain *domain, u16_t type, u16_t klass, u16_t cache_flush,
978 if (!reply->pbuf) {
980 reply->pbuf = pbuf_alloc(PBUF_TRANSPORT, OUTPACKET_SIZE, PBUF_RAM);
981 if (!reply->pbuf) {
984 reply->write_offset = SIZEOF_DNS_HDR;
995 if (reply->write_offset + answer_len > reply->pbuf->tot_len) {
1001 mdns_add_question(reply, domain, type, klass, cache_flush);
1005 res = pbuf_take_at(reply->pbuf, &field32, sizeof(field32), reply->write_offset);
1009 reply->write_offset += sizeof(field32);
1012 rdlen_offset = reply->write_offset;
1013 reply->write_offset += sizeof(field16);
1014 answer_offset = reply->write_offset;
1018 res = pbuf_take_at(reply->pbuf, buf, (u16_t)buf_length, reply->write_offset);
1022 reply->write_offset += (u16_t)buf_length;
1027 res = mdns_write_domain(reply, answer_domain);
1034 field16 = lwip_htons(reply->write_offset - answer_offset);
1035 res = pbuf_take_at(reply->pbuf, &field16, sizeof(field16), rdlen_offset);
1111 * The variable length reply is not copied, its pbuf offset and length is stored instead.
1171 mdns_add_a_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct netif *netif)
1176 return mdns_add_answer(reply, &host, DNS_RRTYPE_A, DNS_RRCLASS_IN, cache_flush, (NETIF_TO_HOST(netif))->dns_ttl, (const u8_t *) netif_ip4_addr(netif), sizeof(ip4_addr_t), NULL);
1181 mdns_add_hostv4_ptr_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct netif *netif)
1187 return mdns_add_answer(reply, &revhost, DNS_RRTYPE_PTR, DNS_RRCLASS_IN, cache_flush, (NETIF_TO_HOST(netif))->dns_ttl, NULL, 0, &host);
1194 mdns_add_aaaa_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct netif *netif, int addrindex)
1199 return mdns_add_answer(reply, &host, DNS_RRTYPE_AAAA, DNS_RRCLASS_IN, cache_flush, (NETIF_TO_HOST(netif))->dns_ttl, (const u8_t *) netif_ip6_addr(netif, addrindex), sizeof(ip6_addr_p_t), NULL);
1204 mdns_add_hostv6_ptr_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct netif *netif, int addrindex)
1210 return mdns_add_answer(reply, &revhost, DNS_RRTYPE_PTR, DNS_RRCLASS_IN, cache_flush, (NETIF_TO_HOST(netif))->dns_ttl, NULL, 0, &host);
1216 mdns_add_servicetype_ptr_answer(struct mdns_outpacket *reply, struct mdns_service *service)
1222 return mdns_add_answer(reply, &service_dnssd, DNS_RRTYPE_PTR, DNS_RRCLASS_IN, 0, service->dns_ttl, NULL, 0, &service_type);
1227 mdns_add_servicename_ptr_answer(struct mdns_outpacket *reply, struct mdns_service *service)
1233 return mdns_add_answer(reply, &service_type, DNS_RRTYPE_PTR, DNS_RRCLASS_IN, 0, service->dns_ttl, NULL, 0, &service_instance);
1238 mdns_add_srv_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct mdns_host *mdns, struct mdns_service *service)
1244 if (reply->legacy_query) {
1255 return mdns_add_answer(reply, &service_instance, DNS_RRTYPE_SRV, DNS_RRCLASS_IN, cache_flush, service->dns_ttl,
1261 mdns_add_txt_answer(struct mdns_outpacket *reply, u16_t cache_flush, struct mdns_service *service)
1267 return mdns_add_answer(reply, &service_instance, DNS_RRTYPE_TXT, DNS_RRCLASS_IN, cache_flush, service->dns_ttl,
1272 * Setup outpacket as a reply to the incoming packet
1302 * Send chosen answers as a reply
1559 * 3. Put chosen answers in new packet and send as reply
1565 struct mdns_outpacket reply;
1577 mdns_init_outpacket(&reply, pkt);
1594 reply.unicast_reply = 1;
1597 reply.host_replies |= check_host(pkt->netif, &q.info, &reply.host_reverse_v6_replies);
1598 replies |= reply.host_replies;
1605 reply.serv_replies[i] |= check_service(service, &q.info);
1606 replies |= reply.serv_replies[i];
1609 if (replies && reply.legacy_query) {
1610 /* Add question to reply packet (legacy packet only has 1 question) */
1611 res = mdns_add_question(&reply, &q.info.domain, q.info.type, q.info.klass, 0);
1612 reply.questions = 1;
1642 match = reply.host_replies & check_host(pkt->netif, &ans.info, &rev_v6);
1658 reply.host_replies &= ~REPLY_HOST_PTR_V4;
1664 reply.host_reverse_v6_replies &= ~rev_v6;
1665 if (reply.host_reverse_v6_replies == 0) {
1666 reply.host_replies &= ~REPLY_HOST_PTR_V6;
1676 reply.host_replies &= ~REPLY_HOST_A;
1685 reply.host_replies &= ~REPLY_HOST_AAAA;
1696 match = reply.serv_replies[i] & check_service(service, &ans.info);
1712 reply.serv_replies[i] &= ~REPLY_SERVICE_TYPE_PTR;
1719 reply.serv_replies[i] &= ~REPLY_SERVICE_NAME_PTR;
1754 reply.serv_replies[i] &= ~REPLY_SERVICE_SRV;
1761 reply.serv_replies[i] &= ~REPLY_SERVICE_TXT;
1768 mdns_send_outpacket(&reply, DNS_FLAG1_RESPONSE | DNS_FLAG1_AUTHORATIVE);
1771 if (reply.pbuf) {
1773 pbuf_free(reply.pbuf);
1774 reply.pbuf = NULL;
2186 * @param txt_fn Callback to get TXT data. Will be called each time a TXT reply is created to
2299 * @return ERR_OK if the string was added to the reply, an err_t otherwise