Lines Matching refs:buf
561 void *buf = NULL;
580 buf = sock->lastdata;
600 err = netconn_recv_tcp_pbuf(sock->conn, (struct pbuf **)&buf);
602 err = netconn_recv(sock->conn, (struct netbuf **)&buf);
605 err, buf));
616 LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): buf == NULL, error is \"%s\"!\n",
625 LWIP_ASSERT("buf != NULL", buf != NULL);
626 sock->lastdata = buf;
630 p = (struct pbuf *)buf;
632 p = ((struct netbuf *)buf)->p;
675 addr = netbuf_fromaddr((struct netbuf *)buf);
676 port = netbuf_fromport((struct netbuf *)buf);
700 addr = netbuf_fromaddr((struct netbuf *)buf);
701 port = netbuf_fromport((struct netbuf *)buf);
717 sock->lastdata = buf;
719 LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: lastdata now netbuf=%p\n", buf));
723 LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom: deleting netbuf=%p\n", buf));
725 pbuf_free((struct pbuf *)buf);
727 netbuf_delete((struct netbuf *)buf);
799 struct netbuf buf;
896 buf.p = buf.ptr = NULL;
898 buf.flags = 0;
901 inet_addr_to_ipaddr(&buf.addr, &to_in->sin_addr);
903 netbuf_fromport(&buf) = remote_port;
906 ip_addr_set_any(&buf.addr);
907 netbuf_fromport(&buf) = 0;
912 ip_addr_debug_print(SOCKETS_DEBUG, &buf.addr);
918 if (netbuf_alloc(&buf, short_size) == NULL) {
923 u16_t chksum = LWIP_CHKSUM_COPY(buf.p->payload, data, short_size);
924 netbuf_set_chksum(&buf, chksum);
929 err = netbuf_take(&buf, data, short_size);
933 err = netbuf_ref(&buf, data, short_size);
937 err = netconn_send(sock->conn, &buf);
941 netbuf_free(&buf);