Lines Matching refs:len
255 p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)); in pbuf_alloc()
257 ((u8_t*)p->payload + p->len <= in pbuf_alloc()
269 rem_len = length - p->len; in pbuf_alloc()
289 q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED); in pbuf_alloc()
294 ((u8_t*)p->payload + p->len <= in pbuf_alloc()
298 rem_len -= q->len; in pbuf_alloc()
314 p->len = p->tot_len = length; in pbuf_alloc()
335 p->len = p->tot_len = length; in pbuf_alloc()
407 p->pbuf.len = p->pbuf.tot_len = length; in pbuf_alloced_custom()
456 while (rem_len > q->len) { in pbuf_realloc()
458 rem_len -= q->len; in pbuf_realloc()
471 if ((q->type == PBUF_RAM) && (rem_len != q->len)) { in pbuf_realloc()
477 q->len = rem_len; in pbuf_realloc()
478 q->tot_len = q->len; in pbuf_realloc()
525 LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;); in pbuf_header()
561 if ((header_size_increment < 0) && (increment_magnitude <= p->len)) { in pbuf_header()
575 p->len += header_size_increment; in pbuf_header()
706 u8_t len; in pbuf_clen() local
708 len = 0; in pbuf_clen()
710 ++len; in pbuf_clen()
713 return len; in pbuf_clen()
758 LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len); in pbuf_cat()
812 LWIP_ASSERT("p->tot_len == p->len + q->tot_len", q->tot_len == p->tot_len - p->len); in pbuf_dechain()
814 q->tot_len = p->tot_len - p->len; in pbuf_dechain()
818 p->tot_len = p->len; in pbuf_dechain()
829 LWIP_ASSERT("p->tot_len == p->len", p->tot_len == p->len); in pbuf_dechain()
854 u16_t offset_to=0, offset_from=0, len; in pbuf_copy() local
867 if ((p_to->len - offset_to) >= (p_from->len - offset_from)) { in pbuf_copy()
869 len = p_from->len - offset_from; in pbuf_copy()
872 len = p_to->len - offset_to; in pbuf_copy()
874 MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len); in pbuf_copy()
875 offset_to += len; in pbuf_copy()
876 offset_from += len; in pbuf_copy()
877 LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len); in pbuf_copy()
878 LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len); in pbuf_copy()
879 if (offset_from >= p_from->len) { in pbuf_copy()
884 if (offset_to == p_to->len) { in pbuf_copy()
891 if((p_from != NULL) && (p_from->len == p_from->tot_len)) { in pbuf_copy()
896 if((p_to != NULL) && (p_to->len == p_to->tot_len)) { in pbuf_copy()
918 pbuf_copy_partial(struct pbuf *buf, void *dataptr, u16_t len, u16_t offset) in pbuf_copy_partial() argument
935 for(p = buf; len != 0 && p != NULL; p = p->next) { in pbuf_copy_partial()
936 if ((offset != 0) && (offset >= p->len)) { in pbuf_copy_partial()
938 offset -= p->len; in pbuf_copy_partial()
941 buf_copy_len = p->len - offset; in pbuf_copy_partial()
942 if (buf_copy_len > len) in pbuf_copy_partial()
943 buf_copy_len = len; in pbuf_copy_partial()
948 len -= buf_copy_len; in pbuf_copy_partial()
966 pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len) in pbuf_take() argument
970 u16_t total_copy_len = len; in pbuf_take()
976 if ((buf == NULL) || (dataptr == NULL) || (buf->tot_len < len)) { in pbuf_take()
984 if (buf_copy_len > p->len) { in pbuf_take()
986 buf_copy_len = p->len; in pbuf_take()
993 LWIP_ASSERT("did not copy all data", total_copy_len == 0 && copied_total == len); in pbuf_take()
1043 u16_t len, u16_t *chksum) in pbuf_fill_chksum() argument
1051 LWIP_ASSERT("len != 0", len != 0); in pbuf_fill_chksum()
1053 if ((start_offset >= p->len) || (start_offset + len > p->len)) { in pbuf_fill_chksum()
1058 copy_chksum = LWIP_CHKSUM_COPY(dst_ptr, dataptr, len); in pbuf_fill_chksum()
1083 while ((q != NULL) && (q->len <= copy_from)) { in pbuf_get_at()
1084 copy_from -= q->len; in pbuf_get_at()
1088 if ((q != NULL) && (q->len > copy_from)) { in pbuf_get_at()
1110 while ((q != NULL) && (q->len <= start)) { in pbuf_memcmp()
1111 start -= q->len; in pbuf_memcmp()
1115 if ((q != NULL) && (q->len > start)) { in pbuf_memcmp()