Lines Matching refs:buf

127 		struct net_buf_simple buf;           \
130 .buf.size = _size, \
142 static inline void net_buf_simple_init(struct net_buf_simple *buf, in net_buf_simple_init() argument
145 if (!buf->__buf) { in net_buf_simple_init()
146 buf->__buf = (uint8_t *)buf + sizeof(*buf); in net_buf_simple_init()
149 buf->data = buf->__buf + reserve_head; in net_buf_simple_init()
150 buf->len = 0U; in net_buf_simple_init()
162 void net_buf_simple_init_with_data(struct net_buf_simple *buf,
172 static inline void net_buf_simple_reset(struct net_buf_simple *buf) in net_buf_simple_reset() argument
174 buf->len = 0U; in net_buf_simple_reset()
175 buf->data = buf->__buf; in net_buf_simple_reset()
202 void *net_buf_simple_add(struct net_buf_simple *buf, size_t len);
216 void *net_buf_simple_add_mem(struct net_buf_simple *buf, const void *mem,
230 uint8_t *net_buf_simple_add_u8(struct net_buf_simple *buf, uint8_t val);
242 void net_buf_simple_add_le16(struct net_buf_simple *buf, uint16_t val);
254 void net_buf_simple_add_be16(struct net_buf_simple *buf, uint16_t val);
266 void net_buf_simple_add_le24(struct net_buf_simple *buf, uint32_t val);
278 void net_buf_simple_add_be24(struct net_buf_simple *buf, uint32_t val);
290 void net_buf_simple_add_le32(struct net_buf_simple *buf, uint32_t val);
302 void net_buf_simple_add_be32(struct net_buf_simple *buf, uint32_t val);
314 void net_buf_simple_add_le40(struct net_buf_simple *buf, uint64_t val);
326 void net_buf_simple_add_be40(struct net_buf_simple *buf, uint64_t val);
338 void net_buf_simple_add_le48(struct net_buf_simple *buf, uint64_t val);
350 void net_buf_simple_add_be48(struct net_buf_simple *buf, uint64_t val);
362 void net_buf_simple_add_le64(struct net_buf_simple *buf, uint64_t val);
374 void net_buf_simple_add_be64(struct net_buf_simple *buf, uint64_t val);
386 void *net_buf_simple_remove_mem(struct net_buf_simple *buf, size_t len);
398 uint8_t net_buf_simple_remove_u8(struct net_buf_simple *buf);
410 uint16_t net_buf_simple_remove_le16(struct net_buf_simple *buf);
422 uint16_t net_buf_simple_remove_be16(struct net_buf_simple *buf);
434 uint32_t net_buf_simple_remove_le24(struct net_buf_simple *buf);
446 uint32_t net_buf_simple_remove_be24(struct net_buf_simple *buf);
458 uint32_t net_buf_simple_remove_le32(struct net_buf_simple *buf);
470 uint32_t net_buf_simple_remove_be32(struct net_buf_simple *buf);
482 uint64_t net_buf_simple_remove_le40(struct net_buf_simple *buf);
494 uint64_t net_buf_simple_remove_be40(struct net_buf_simple *buf);
506 uint64_t net_buf_simple_remove_le48(struct net_buf_simple *buf);
518 uint64_t net_buf_simple_remove_be48(struct net_buf_simple *buf);
530 uint64_t net_buf_simple_remove_le64(struct net_buf_simple *buf);
542 uint64_t net_buf_simple_remove_be64(struct net_buf_simple *buf);
555 void *net_buf_simple_push(struct net_buf_simple *buf, size_t len);
569 void *net_buf_simple_push_mem(struct net_buf_simple *buf, const void *mem,
581 void net_buf_simple_push_le16(struct net_buf_simple *buf, uint16_t val);
592 void net_buf_simple_push_be16(struct net_buf_simple *buf, uint16_t val);
602 void net_buf_simple_push_u8(struct net_buf_simple *buf, uint8_t val);
613 void net_buf_simple_push_le24(struct net_buf_simple *buf, uint32_t val);
624 void net_buf_simple_push_be24(struct net_buf_simple *buf, uint32_t val);
635 void net_buf_simple_push_le32(struct net_buf_simple *buf, uint32_t val);
646 void net_buf_simple_push_be32(struct net_buf_simple *buf, uint32_t val);
657 void net_buf_simple_push_le40(struct net_buf_simple *buf, uint64_t val);
668 void net_buf_simple_push_be40(struct net_buf_simple *buf, uint64_t val);
679 void net_buf_simple_push_le48(struct net_buf_simple *buf, uint64_t val);
690 void net_buf_simple_push_be48(struct net_buf_simple *buf, uint64_t val);
701 void net_buf_simple_push_le64(struct net_buf_simple *buf, uint64_t val);
712 void net_buf_simple_push_be64(struct net_buf_simple *buf, uint64_t val);
725 void *net_buf_simple_pull(struct net_buf_simple *buf, size_t len);
738 void *net_buf_simple_pull_mem(struct net_buf_simple *buf, size_t len);
750 uint8_t net_buf_simple_pull_u8(struct net_buf_simple *buf);
762 uint16_t net_buf_simple_pull_le16(struct net_buf_simple *buf);
774 uint16_t net_buf_simple_pull_be16(struct net_buf_simple *buf);
786 uint32_t net_buf_simple_pull_le24(struct net_buf_simple *buf);
798 uint32_t net_buf_simple_pull_be24(struct net_buf_simple *buf);
810 uint32_t net_buf_simple_pull_le32(struct net_buf_simple *buf);
822 uint32_t net_buf_simple_pull_be32(struct net_buf_simple *buf);
834 uint64_t net_buf_simple_pull_le40(struct net_buf_simple *buf);
846 uint64_t net_buf_simple_pull_be40(struct net_buf_simple *buf);
858 uint64_t net_buf_simple_pull_le48(struct net_buf_simple *buf);
870 uint64_t net_buf_simple_pull_be48(struct net_buf_simple *buf);
882 uint64_t net_buf_simple_pull_le64(struct net_buf_simple *buf);
894 uint64_t net_buf_simple_pull_be64(struct net_buf_simple *buf);
905 static inline uint8_t *net_buf_simple_tail(const struct net_buf_simple *buf) in net_buf_simple_tail() argument
907 return buf->data + buf->len; in net_buf_simple_tail()
919 size_t net_buf_simple_headroom(const struct net_buf_simple *buf);
930 size_t net_buf_simple_tailroom(const struct net_buf_simple *buf);
941 uint16_t net_buf_simple_max_len(const struct net_buf_simple *buf);
965 static inline void net_buf_simple_save(const struct net_buf_simple *buf, in net_buf_simple_save() argument
968 state->offset = (uint16_t)net_buf_simple_headroom(buf); in net_buf_simple_save()
969 state->len = buf->len; in net_buf_simple_save()
981 static inline void net_buf_simple_restore(struct net_buf_simple *buf, in net_buf_simple_restore() argument
984 buf->data = buf->__buf + state->offset; in net_buf_simple_restore()
985 buf->len = state->len; in net_buf_simple_restore()
1059 uint8_t * __must_check (*alloc)(struct net_buf *buf, size_t *size,
1061 uint8_t * __must_check (*ref)(struct net_buf *buf, uint8_t *data);
1062 void (*unref)(struct net_buf *buf, uint8_t *data);
1109 void (*const destroy)(struct net_buf *buf);
1327 int net_buf_id(const struct net_buf *buf);
1435 static inline void net_buf_destroy(struct net_buf *buf) in net_buf_destroy() argument
1437 struct net_buf_pool *pool = net_buf_pool_get(buf->pool_id); in net_buf_destroy()
1439 if (buf->__buf) { in net_buf_destroy()
1440 if (!(buf->flags & NET_BUF_EXTERNAL_DATA)) { in net_buf_destroy()
1441 pool->alloc->cb->unref(buf, buf->__buf); in net_buf_destroy()
1443 buf->__buf = NULL; in net_buf_destroy()
1446 k_lifo_put(&pool->free, buf); in net_buf_destroy()
1456 void net_buf_reset(struct net_buf *buf);
1466 void net_buf_simple_reserve(struct net_buf_simple *buf, size_t reserve);
1474 void net_buf_slist_put(sys_slist_t *list, struct net_buf *buf);
1493 void net_buf_unref_debug(struct net_buf *buf, const char *func, int line);
1497 void net_buf_unref(struct net_buf *buf);
1507 struct net_buf * __must_check net_buf_ref(struct net_buf *buf);
1522 struct net_buf * __must_check net_buf_clone(struct net_buf *buf,
1532 static inline void * __must_check net_buf_user_data(const struct net_buf *buf) in net_buf_user_data() argument
1534 return (void *)buf->user_data; in net_buf_user_data()
1556 static inline void net_buf_reserve(struct net_buf *buf, size_t reserve) in net_buf_reserve() argument
1558 net_buf_simple_reserve(&buf->b, reserve); in net_buf_reserve()
1572 static inline void *net_buf_add(struct net_buf *buf, size_t len) in net_buf_add() argument
1574 return net_buf_simple_add(&buf->b, len); in net_buf_add()
1589 static inline void *net_buf_add_mem(struct net_buf *buf, const void *mem, in net_buf_add_mem() argument
1592 return net_buf_simple_add_mem(&buf->b, mem, len); in net_buf_add_mem()
1606 static inline uint8_t *net_buf_add_u8(struct net_buf *buf, uint8_t val) in net_buf_add_u8() argument
1608 return net_buf_simple_add_u8(&buf->b, val); in net_buf_add_u8()
1621 static inline void net_buf_add_le16(struct net_buf *buf, uint16_t val) in net_buf_add_le16() argument
1623 net_buf_simple_add_le16(&buf->b, val); in net_buf_add_le16()
1636 static inline void net_buf_add_be16(struct net_buf *buf, uint16_t val) in net_buf_add_be16() argument
1638 net_buf_simple_add_be16(&buf->b, val); in net_buf_add_be16()
1651 static inline void net_buf_add_le24(struct net_buf *buf, uint32_t val) in net_buf_add_le24() argument
1653 net_buf_simple_add_le24(&buf->b, val); in net_buf_add_le24()
1666 static inline void net_buf_add_be24(struct net_buf *buf, uint32_t val) in net_buf_add_be24() argument
1668 net_buf_simple_add_be24(&buf->b, val); in net_buf_add_be24()
1681 static inline void net_buf_add_le32(struct net_buf *buf, uint32_t val) in net_buf_add_le32() argument
1683 net_buf_simple_add_le32(&buf->b, val); in net_buf_add_le32()
1696 static inline void net_buf_add_be32(struct net_buf *buf, uint32_t val) in net_buf_add_be32() argument
1698 net_buf_simple_add_be32(&buf->b, val); in net_buf_add_be32()
1711 static inline void net_buf_add_le40(struct net_buf *buf, uint64_t val) in net_buf_add_le40() argument
1713 net_buf_simple_add_le40(&buf->b, val); in net_buf_add_le40()
1726 static inline void net_buf_add_be40(struct net_buf *buf, uint64_t val) in net_buf_add_be40() argument
1728 net_buf_simple_add_be40(&buf->b, val); in net_buf_add_be40()
1741 static inline void net_buf_add_le48(struct net_buf *buf, uint64_t val) in net_buf_add_le48() argument
1743 net_buf_simple_add_le48(&buf->b, val); in net_buf_add_le48()
1756 static inline void net_buf_add_be48(struct net_buf *buf, uint64_t val) in net_buf_add_be48() argument
1758 net_buf_simple_add_be48(&buf->b, val); in net_buf_add_be48()
1771 static inline void net_buf_add_le64(struct net_buf *buf, uint64_t val) in net_buf_add_le64() argument
1773 net_buf_simple_add_le64(&buf->b, val); in net_buf_add_le64()
1786 static inline void net_buf_add_be64(struct net_buf *buf, uint64_t val) in net_buf_add_be64() argument
1788 net_buf_simple_add_be64(&buf->b, val); in net_buf_add_be64()
1801 static inline void *net_buf_remove_mem(struct net_buf *buf, size_t len) in net_buf_remove_mem() argument
1803 return net_buf_simple_remove_mem(&buf->b, len); in net_buf_remove_mem()
1816 static inline uint8_t net_buf_remove_u8(struct net_buf *buf) in net_buf_remove_u8() argument
1818 return net_buf_simple_remove_u8(&buf->b); in net_buf_remove_u8()
1831 static inline uint16_t net_buf_remove_le16(struct net_buf *buf) in net_buf_remove_le16() argument
1833 return net_buf_simple_remove_le16(&buf->b); in net_buf_remove_le16()
1846 static inline uint16_t net_buf_remove_be16(struct net_buf *buf) in net_buf_remove_be16() argument
1848 return net_buf_simple_remove_be16(&buf->b); in net_buf_remove_be16()
1861 static inline uint32_t net_buf_remove_be24(struct net_buf *buf) in net_buf_remove_be24() argument
1863 return net_buf_simple_remove_be24(&buf->b); in net_buf_remove_be24()
1876 static inline uint32_t net_buf_remove_le24(struct net_buf *buf) in net_buf_remove_le24() argument
1878 return net_buf_simple_remove_le24(&buf->b); in net_buf_remove_le24()
1891 static inline uint32_t net_buf_remove_le32(struct net_buf *buf) in net_buf_remove_le32() argument
1893 return net_buf_simple_remove_le32(&buf->b); in net_buf_remove_le32()
1906 static inline uint32_t net_buf_remove_be32(struct net_buf *buf) in net_buf_remove_be32() argument
1908 return net_buf_simple_remove_be32(&buf->b); in net_buf_remove_be32()
1921 static inline uint64_t net_buf_remove_le40(struct net_buf *buf) in net_buf_remove_le40() argument
1923 return net_buf_simple_remove_le40(&buf->b); in net_buf_remove_le40()
1936 static inline uint64_t net_buf_remove_be40(struct net_buf *buf) in net_buf_remove_be40() argument
1938 return net_buf_simple_remove_be40(&buf->b); in net_buf_remove_be40()
1951 static inline uint64_t net_buf_remove_le48(struct net_buf *buf) in net_buf_remove_le48() argument
1953 return net_buf_simple_remove_le48(&buf->b); in net_buf_remove_le48()
1966 static inline uint64_t net_buf_remove_be48(struct net_buf *buf) in net_buf_remove_be48() argument
1968 return net_buf_simple_remove_be48(&buf->b); in net_buf_remove_be48()
1981 static inline uint64_t net_buf_remove_le64(struct net_buf *buf) in net_buf_remove_le64() argument
1983 return net_buf_simple_remove_le64(&buf->b); in net_buf_remove_le64()
1996 static inline uint64_t net_buf_remove_be64(struct net_buf *buf) in net_buf_remove_be64() argument
1998 return net_buf_simple_remove_be64(&buf->b); in net_buf_remove_be64()
2012 static inline void *net_buf_push(struct net_buf *buf, size_t len) in net_buf_push() argument
2014 return net_buf_simple_push(&buf->b, len); in net_buf_push()
2029 static inline void *net_buf_push_mem(struct net_buf *buf, const void *mem, in net_buf_push_mem() argument
2032 return net_buf_simple_push_mem(&buf->b, mem, len); in net_buf_push_mem()
2043 static inline void net_buf_push_u8(struct net_buf *buf, uint8_t val) in net_buf_push_u8() argument
2045 net_buf_simple_push_u8(&buf->b, val); in net_buf_push_u8()
2057 static inline void net_buf_push_le16(struct net_buf *buf, uint16_t val) in net_buf_push_le16() argument
2059 net_buf_simple_push_le16(&buf->b, val); in net_buf_push_le16()
2071 static inline void net_buf_push_be16(struct net_buf *buf, uint16_t val) in net_buf_push_be16() argument
2073 net_buf_simple_push_be16(&buf->b, val); in net_buf_push_be16()
2085 static inline void net_buf_push_le24(struct net_buf *buf, uint32_t val) in net_buf_push_le24() argument
2087 net_buf_simple_push_le24(&buf->b, val); in net_buf_push_le24()
2099 static inline void net_buf_push_be24(struct net_buf *buf, uint32_t val) in net_buf_push_be24() argument
2101 net_buf_simple_push_be24(&buf->b, val); in net_buf_push_be24()
2113 static inline void net_buf_push_le32(struct net_buf *buf, uint32_t val) in net_buf_push_le32() argument
2115 net_buf_simple_push_le32(&buf->b, val); in net_buf_push_le32()
2127 static inline void net_buf_push_be32(struct net_buf *buf, uint32_t val) in net_buf_push_be32() argument
2129 net_buf_simple_push_be32(&buf->b, val); in net_buf_push_be32()
2141 static inline void net_buf_push_le40(struct net_buf *buf, uint64_t val) in net_buf_push_le40() argument
2143 net_buf_simple_push_le40(&buf->b, val); in net_buf_push_le40()
2155 static inline void net_buf_push_be40(struct net_buf *buf, uint64_t val) in net_buf_push_be40() argument
2157 net_buf_simple_push_be40(&buf->b, val); in net_buf_push_be40()
2169 static inline void net_buf_push_le48(struct net_buf *buf, uint64_t val) in net_buf_push_le48() argument
2171 net_buf_simple_push_le48(&buf->b, val); in net_buf_push_le48()
2183 static inline void net_buf_push_be48(struct net_buf *buf, uint64_t val) in net_buf_push_be48() argument
2185 net_buf_simple_push_be48(&buf->b, val); in net_buf_push_be48()
2197 static inline void net_buf_push_le64(struct net_buf *buf, uint64_t val) in net_buf_push_le64() argument
2199 net_buf_simple_push_le64(&buf->b, val); in net_buf_push_le64()
2211 static inline void net_buf_push_be64(struct net_buf *buf, uint64_t val) in net_buf_push_be64() argument
2213 net_buf_simple_push_be64(&buf->b, val); in net_buf_push_be64()
2227 static inline void *net_buf_pull(struct net_buf *buf, size_t len) in net_buf_pull() argument
2229 return net_buf_simple_pull(&buf->b, len); in net_buf_pull()
2243 static inline void *net_buf_pull_mem(struct net_buf *buf, size_t len) in net_buf_pull_mem() argument
2245 return net_buf_simple_pull_mem(&buf->b, len); in net_buf_pull_mem()
2258 static inline uint8_t net_buf_pull_u8(struct net_buf *buf) in net_buf_pull_u8() argument
2260 return net_buf_simple_pull_u8(&buf->b); in net_buf_pull_u8()
2273 static inline uint16_t net_buf_pull_le16(struct net_buf *buf) in net_buf_pull_le16() argument
2275 return net_buf_simple_pull_le16(&buf->b); in net_buf_pull_le16()
2288 static inline uint16_t net_buf_pull_be16(struct net_buf *buf) in net_buf_pull_be16() argument
2290 return net_buf_simple_pull_be16(&buf->b); in net_buf_pull_be16()
2303 static inline uint32_t net_buf_pull_le24(struct net_buf *buf) in net_buf_pull_le24() argument
2305 return net_buf_simple_pull_le24(&buf->b); in net_buf_pull_le24()
2318 static inline uint32_t net_buf_pull_be24(struct net_buf *buf) in net_buf_pull_be24() argument
2320 return net_buf_simple_pull_be24(&buf->b); in net_buf_pull_be24()
2333 static inline uint32_t net_buf_pull_le32(struct net_buf *buf) in net_buf_pull_le32() argument
2335 return net_buf_simple_pull_le32(&buf->b); in net_buf_pull_le32()
2348 static inline uint32_t net_buf_pull_be32(struct net_buf *buf) in net_buf_pull_be32() argument
2350 return net_buf_simple_pull_be32(&buf->b); in net_buf_pull_be32()
2363 static inline uint64_t net_buf_pull_le40(struct net_buf *buf) in net_buf_pull_le40() argument
2365 return net_buf_simple_pull_le40(&buf->b); in net_buf_pull_le40()
2378 static inline uint64_t net_buf_pull_be40(struct net_buf *buf) in net_buf_pull_be40() argument
2380 return net_buf_simple_pull_be40(&buf->b); in net_buf_pull_be40()
2393 static inline uint64_t net_buf_pull_le48(struct net_buf *buf) in net_buf_pull_le48() argument
2395 return net_buf_simple_pull_le48(&buf->b); in net_buf_pull_le48()
2408 static inline uint64_t net_buf_pull_be48(struct net_buf *buf) in net_buf_pull_be48() argument
2410 return net_buf_simple_pull_be48(&buf->b); in net_buf_pull_be48()
2423 static inline uint64_t net_buf_pull_le64(struct net_buf *buf) in net_buf_pull_le64() argument
2425 return net_buf_simple_pull_le64(&buf->b); in net_buf_pull_le64()
2438 static inline uint64_t net_buf_pull_be64(struct net_buf *buf) in net_buf_pull_be64() argument
2440 return net_buf_simple_pull_be64(&buf->b); in net_buf_pull_be64()
2452 static inline size_t net_buf_tailroom(const struct net_buf *buf) in net_buf_tailroom() argument
2454 return net_buf_simple_tailroom(&buf->b); in net_buf_tailroom()
2466 static inline size_t net_buf_headroom(const struct net_buf *buf) in net_buf_headroom() argument
2468 return net_buf_simple_headroom(&buf->b); in net_buf_headroom()
2480 static inline uint16_t net_buf_max_len(const struct net_buf *buf) in net_buf_max_len() argument
2482 return net_buf_simple_max_len(&buf->b); in net_buf_max_len()
2494 static inline uint8_t *net_buf_tail(const struct net_buf *buf) in net_buf_tail() argument
2496 return net_buf_simple_tail(&buf->b); in net_buf_tail()
2610 size_t net_buf_append_bytes(struct net_buf *buf, size_t len,
2628 size_t net_buf_data_match(const struct net_buf *buf, size_t offset, const void *data, size_t len);
2645 static inline struct net_buf *net_buf_skip(struct net_buf *buf, size_t len) in net_buf_skip() argument
2647 while (buf && len--) { in net_buf_skip()
2648 net_buf_pull_u8(buf); in net_buf_skip()
2649 if (!buf->len) { in net_buf_skip()
2650 buf = net_buf_frag_del(NULL, buf); in net_buf_skip()
2654 return buf; in net_buf_skip()
2667 static inline size_t net_buf_frags_len(const struct net_buf *buf) in net_buf_frags_len() argument
2671 while (buf) { in net_buf_frags_len()
2672 bytes += buf->len; in net_buf_frags_len()
2673 buf = buf->frags; in net_buf_frags_len()