Lines Matching refs:len
24 * ->len field. It can be found by traversing the list. If the last
29 * loop end condition (tot_len == p->len), NOT (next == NULL).
255 p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset));
256 LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
257 ((u8_t*)p->payload + p->len <=
269 rem_len = length - p->len;
289 q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED);
293 LWIP_ASSERT("check p->payload + p->len does not overflow pbuf",
294 ((u8_t*)p->payload + p->len <=
298 rem_len -= q->len;
314 p->len = p->tot_len = length;
335 p->len = p->tot_len = length;
407 p->pbuf.len = p->pbuf.tot_len = length;
424 * @note If the pbuf is ROM/REF, only the ->tot_len and ->len fields are adjusted.
456 while (rem_len > q->len) {
458 rem_len -= q->len;
471 if ((q->type == PBUF_RAM) && (rem_len != q->len)) {
477 q->len = rem_len;
478 q->tot_len = q->len;
496 * The ->payload, ->tot_len and ->len fields are adjusted.
525 LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);
561 if ((header_size_increment < 0) && (increment_magnitude <= p->len)) {
575 p->len += header_size_increment;
706 u8_t len;
708 len = 0;
710 ++len;
713 return len;
758 LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
797 * Makes p->tot_len field equal to p->len.
811 /* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */
812 LWIP_ASSERT("p->tot_len == p->len + q->tot_len", q->tot_len == p->tot_len - p->len);
814 q->tot_len = p->tot_len - p->len;
818 p->tot_len = p->len;
828 /* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */
829 LWIP_ASSERT("p->tot_len == p->len", p->tot_len == p->len);
854 u16_t offset_to=0, offset_from=0, len;
867 if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
869 len = p_from->len - offset_from;
872 len = p_to->len - offset_to;
874 MEMCPY((u8_t*)p_to->payload + offset_to, (u8_t*)p_from->payload + offset_from, len);
875 offset_to += len;
876 offset_from += len;
877 LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
878 LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
879 if (offset_from >= p_from->len) {
884 if (offset_to == p_to->len) {
891 if((p_from != NULL) && (p_from->len == p_from->tot_len)) {
896 if((p_to != NULL) && (p_to->len == p_to->tot_len)) {
912 * @param len length of data to copy (dataptr must be big enough). No more
913 * than buf->tot_len will be copied, irrespective of len
914 * @param offset offset into the packet buffer from where to begin copying len bytes
918 pbuf_copy_partial(struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)
935 for(p = buf; len != 0 && p != NULL; p = p->next) {
936 if ((offset != 0) && (offset >= p->len)) {
938 offset -= p->len;
941 buf_copy_len = p->len - offset;
942 if (buf_copy_len > len)
943 buf_copy_len = len;
948 len -= buf_copy_len;
961 * @param len length of the application supplied data buffer
966 pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len)
970 u16_t total_copy_len = len;
976 if ((buf == NULL) || (dataptr == NULL) || (buf->tot_len < len)) {
984 if (buf_copy_len > p->len) {
986 buf_copy_len = p->len;
993 LWIP_ASSERT("did not copy all data", total_copy_len == 0 && copied_total == len);
1036 * @param len length of data to copy into the pbuf
1043 u16_t len, u16_t *chksum)
1051 LWIP_ASSERT("len != 0", len != 0);
1053 if ((start_offset >= p->len) || (start_offset + len > p->len)) {
1058 copy_chksum = LWIP_CHKSUM_COPY(dst_ptr, dataptr, len);
1083 while ((q != NULL) && (q->len <= copy_from)) {
1084 copy_from -= q->len;
1088 if ((q != NULL) && (q->len > copy_from)) {
1110 while ((q != NULL) && (q->len <= start)) {
1111 start -= q->len;
1115 if ((q != NULL) && (q->len > start)) {