Lines Matching refs:pbuf

204   struct pbuf *pbuf;
227 struct pbuf *pbuf;
330 * Add a label part to a domain (@see mdns_domain_add_label but copy directly from pbuf)
333 mdns_domain_add_label_pbuf(struct mdns_domain *domain, const struct pbuf *p, u16_t offset, u8_t len)
355 mdns_readname_loop(struct pbuf *p, u16_t offset, struct mdns_domain *domain, unsigned depth)
421 mdns_readname(struct pbuf *p, u16_t offset, struct mdns_domain *domain)
779 * @param pbuf Pointer to pbuf with the partially constructed DNS packet
788 mdns_compress_domain(struct pbuf *pbuf, u16_t *offset, struct mdns_domain *domain)
795 if (pbuf == NULL) {
798 target_end = mdns_readname(pbuf, *offset, &target);
849 u16_t len = mdns_compress_domain(outpkt->pbuf, &offset, domain);
860 res = pbuf_take_at(outpkt->pbuf, domain->name, writelen, outpkt->write_offset);
878 res = pbuf_take_at(outpkt->pbuf, &jump, DOMAIN_JUMP_SIZE, outpkt->write_offset);
906 if (!outpkt->pbuf) {
907 /* If no pbuf is active, allocate one */
908 outpkt->pbuf = pbuf_alloc(PBUF_TRANSPORT, OUTPACKET_SIZE, PBUF_RAM);
909 if (!outpkt->pbuf) {
917 if (outpkt->write_offset + question_len > outpkt->pbuf->tot_len) {
930 res = pbuf_take_at(outpkt->pbuf, &field16, sizeof(field16), outpkt->write_offset);
941 res = pbuf_take_at(outpkt->pbuf, &field16, sizeof(field16), outpkt->write_offset);
978 if (!reply->pbuf) {
979 /* If no pbuf is active, allocate one */
980 reply->pbuf = pbuf_alloc(PBUF_TRANSPORT, OUTPACKET_SIZE, PBUF_RAM);
981 if (!reply->pbuf) {
995 if (reply->write_offset + answer_len > reply->pbuf->tot_len) {
1005 res = pbuf_take_at(reply->pbuf, &field32, sizeof(field32), reply->write_offset);
1018 res = pbuf_take_at(reply->pbuf, buf, (u16_t)buf_length, reply->write_offset);
1035 res = pbuf_take_at(reply->pbuf, &field16, sizeof(field16), rdlen_offset);
1052 pkt->parse_offset = mdns_readname(pkt->pbuf, pkt->parse_offset, &info->domain);
1057 copied = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), pkt->parse_offset);
1064 copied = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), pkt->parse_offset);
1086 if (pkt->pbuf->tot_len < pkt->parse_offset) {
1111 * The variable length reply is not copied, its pbuf offset and length is stored instead.
1126 if (pkt->pbuf->tot_len < pkt->parse_offset) {
1146 copied = pbuf_copy_partial(pkt->pbuf, &ttl, sizeof(ttl), pkt->parse_offset);
1153 copied = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), pkt->parse_offset);
1304 * Add all selected answers (first write will allocate pbuf)
1470 if (outpkt->pbuf) {
1482 pbuf_take(outpkt->pbuf, &hdr, sizeof(hdr));
1485 pbuf_realloc(outpkt->pbuf, outpkt->write_offset);
1499 res = udp_sendto_if(mdns_pcb, outpkt->pbuf, &outpkt->dest_addr, outpkt->dest_port, outpkt->netif);
1501 res = udp_sendto_if(mdns_pcb, outpkt->pbuf, mcast_destaddr, LWIP_IANA_PORT_MDNS, outpkt->netif);
1506 if (outpkt->pbuf) {
1507 pbuf_free(outpkt->pbuf);
1508 outpkt->pbuf = NULL;
1652 len = mdns_readname(pkt->pbuf, ans.rd_offset, &known_ans);
1674 pbuf_memcmp(pkt->pbuf, ans.rd_offset, netif_ip4_addr(pkt->netif), ans.rd_length) == 0) {
1683 pbuf_memcmp(pkt->pbuf, ans.rd_offset, netif_ip6_addr(pkt->netif, 0), ans.rd_length) == 0) {
1706 len = mdns_readname(pkt->pbuf, ans.rd_offset, &known_ans);
1730 len = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), read_pos);
1736 len = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), read_pos);
1742 len = pbuf_copy_partial(pkt->pbuf, &field16, sizeof(field16), read_pos);
1748 len = mdns_readname(pkt->pbuf, read_pos, &known_ans);
1759 pbuf_memcmp(pkt->pbuf, ans.rd_offset, service->txtdata.name, ans.rd_length) == 0) {
1771 if (reply.pbuf) {
1773 pbuf_free(reply.pbuf);
1774 reply.pbuf = NULL;
1853 mdns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port)
1885 packet.pbuf = p;
2008 if (pkt.pbuf) {
2009 pbuf_free(pkt.pbuf);
2010 pkt.pbuf = NULL;