Lines Matching refs:q
375 struct pbuf *q; local
381 q = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
382 if (q != NULL) {
383 err_t err = pbuf_copy(q, p);
386 pbuf_header(q, -(s16_t)((IPH_HL(iphdr) * 4) + UDP_HLEN));
387 mpcb->recv(mpcb->recv_arg, mpcb, q, ip_current_src_addr(), src);
566 struct pbuf *q; /* q will be sent down the stack */ local
590 q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);
592 if (q == NULL) {
598 pbuf_chain(q, p);
602 ("udp_send: added header pbuf %p before given pbuf %p\n", (void *)q, (void *)p));
606 q = p;
610 (q->len >= sizeof(struct udp_hdr)));
612 udphdr = (struct udp_hdr *)q->payload;
621 q->flags |= PBUF_FLAG_MCASTLOOP;
635 if (q != p) {
637 pbuf_free(q);
638 q = NULL;
647 LWIP_DEBUGF(UDP_DEBUG, ("udp_send: sending datagram of length %"U16_F"\n", q->tot_len));
653 LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP LITE packet length %"U16_F"\n", q->tot_len));
656 if ((chklen < sizeof(struct udp_hdr)) || (chklen > q->tot_len)) {
667 chklen = q->tot_len;
672 udphdr->chksum = inet_chksum_pseudo_partial(q, src_ip, dst_ip,
673 IP_PROTO_UDPLITE, q->tot_len,
693 err = ip_output_if(q, src_ip, dst_ip, pcb->ttl, pcb->tos, IP_PROTO_UDPLITE, netif);
698 LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %"U16_F"\n", q->tot_len));
699 udphdr->len = htons(q->tot_len);
707 udpchksum = inet_chksum_pseudo_partial(q, src_ip, dst_ip, IP_PROTO_UDP,
708 q->tot_len, UDP_HLEN);
714 udpchksum = inet_chksum_pseudo(q, src_ip, dst_ip, IP_PROTO_UDP, q->tot_len);
728 err = ip_output_if(q, src_ip, dst_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);
735 if (q != p) {
737 pbuf_free(q);
738 q = NULL;