Lines Matching refs:buf
121 struct net_buf_simple buf; \
124 .buf.size = _size, \
136 static inline void net_buf_simple_init(struct net_buf_simple *buf, in net_buf_simple_init() argument
139 if (!buf->__buf) { in net_buf_simple_init()
140 buf->__buf = (uint8_t *)buf + sizeof(*buf); in net_buf_simple_init()
143 buf->data = buf->__buf + reserve_head; in net_buf_simple_init()
144 buf->len = 0U; in net_buf_simple_init()
156 void net_buf_simple_init_with_data(struct net_buf_simple *buf,
166 static inline void net_buf_simple_reset(struct net_buf_simple *buf) in net_buf_simple_reset() argument
168 buf->len = 0U; in net_buf_simple_reset()
169 buf->data = buf->__buf; in net_buf_simple_reset()
196 void *net_buf_simple_add(struct net_buf_simple *buf, size_t len);
210 void *net_buf_simple_add_mem(struct net_buf_simple *buf, const void *mem,
224 uint8_t *net_buf_simple_add_u8(struct net_buf_simple *buf, uint8_t val);
236 void net_buf_simple_add_le16(struct net_buf_simple *buf, uint16_t val);
248 void net_buf_simple_add_be16(struct net_buf_simple *buf, uint16_t val);
260 void net_buf_simple_add_le24(struct net_buf_simple *buf, uint32_t val);
272 void net_buf_simple_add_be24(struct net_buf_simple *buf, uint32_t val);
284 void net_buf_simple_add_le32(struct net_buf_simple *buf, uint32_t val);
296 void net_buf_simple_add_be32(struct net_buf_simple *buf, uint32_t val);
308 void net_buf_simple_add_le48(struct net_buf_simple *buf, uint64_t val);
320 void net_buf_simple_add_be48(struct net_buf_simple *buf, uint64_t val);
332 void net_buf_simple_add_le64(struct net_buf_simple *buf, uint64_t val);
344 void net_buf_simple_add_be64(struct net_buf_simple *buf, uint64_t val);
356 void *net_buf_simple_remove_mem(struct net_buf_simple *buf, size_t len);
368 uint8_t net_buf_simple_remove_u8(struct net_buf_simple *buf);
380 uint16_t net_buf_simple_remove_le16(struct net_buf_simple *buf);
392 uint16_t net_buf_simple_remove_be16(struct net_buf_simple *buf);
404 uint32_t net_buf_simple_remove_le24(struct net_buf_simple *buf);
416 uint32_t net_buf_simple_remove_be24(struct net_buf_simple *buf);
428 uint32_t net_buf_simple_remove_le32(struct net_buf_simple *buf);
440 uint32_t net_buf_simple_remove_be32(struct net_buf_simple *buf);
452 uint64_t net_buf_simple_remove_le48(struct net_buf_simple *buf);
464 uint64_t net_buf_simple_remove_be48(struct net_buf_simple *buf);
476 uint64_t net_buf_simple_remove_le64(struct net_buf_simple *buf);
488 uint64_t net_buf_simple_remove_be64(struct net_buf_simple *buf);
501 void *net_buf_simple_push(struct net_buf_simple *buf, size_t len);
515 void *net_buf_simple_push_mem(struct net_buf_simple *buf, const void *mem,
527 void net_buf_simple_push_le16(struct net_buf_simple *buf, uint16_t val);
538 void net_buf_simple_push_be16(struct net_buf_simple *buf, uint16_t val);
548 void net_buf_simple_push_u8(struct net_buf_simple *buf, uint8_t val);
559 void net_buf_simple_push_le24(struct net_buf_simple *buf, uint32_t val);
570 void net_buf_simple_push_be24(struct net_buf_simple *buf, uint32_t val);
581 void net_buf_simple_push_le32(struct net_buf_simple *buf, uint32_t val);
592 void net_buf_simple_push_be32(struct net_buf_simple *buf, uint32_t val);
603 void net_buf_simple_push_le48(struct net_buf_simple *buf, uint64_t val);
614 void net_buf_simple_push_be48(struct net_buf_simple *buf, uint64_t val);
625 void net_buf_simple_push_le64(struct net_buf_simple *buf, uint64_t val);
636 void net_buf_simple_push_be64(struct net_buf_simple *buf, uint64_t val);
649 void *net_buf_simple_pull(struct net_buf_simple *buf, size_t len);
662 void *net_buf_simple_pull_mem(struct net_buf_simple *buf, size_t len);
674 uint8_t net_buf_simple_pull_u8(struct net_buf_simple *buf);
686 uint16_t net_buf_simple_pull_le16(struct net_buf_simple *buf);
698 uint16_t net_buf_simple_pull_be16(struct net_buf_simple *buf);
710 uint32_t net_buf_simple_pull_le24(struct net_buf_simple *buf);
722 uint32_t net_buf_simple_pull_be24(struct net_buf_simple *buf);
734 uint32_t net_buf_simple_pull_le32(struct net_buf_simple *buf);
746 uint32_t net_buf_simple_pull_be32(struct net_buf_simple *buf);
758 uint64_t net_buf_simple_pull_le48(struct net_buf_simple *buf);
770 uint64_t net_buf_simple_pull_be48(struct net_buf_simple *buf);
782 uint64_t net_buf_simple_pull_le64(struct net_buf_simple *buf);
794 uint64_t net_buf_simple_pull_be64(struct net_buf_simple *buf);
805 static inline uint8_t *net_buf_simple_tail(struct net_buf_simple *buf) in net_buf_simple_tail() argument
807 return buf->data + buf->len; in net_buf_simple_tail()
819 size_t net_buf_simple_headroom(struct net_buf_simple *buf);
830 size_t net_buf_simple_tailroom(struct net_buf_simple *buf);
841 uint16_t net_buf_simple_max_len(struct net_buf_simple *buf);
865 static inline void net_buf_simple_save(struct net_buf_simple *buf, in net_buf_simple_save() argument
868 state->offset = net_buf_simple_headroom(buf); in net_buf_simple_save()
869 state->len = buf->len; in net_buf_simple_save()
881 static inline void net_buf_simple_restore(struct net_buf_simple *buf, in net_buf_simple_restore() argument
884 buf->data = buf->__buf + state->offset; in net_buf_simple_restore()
885 buf->len = state->len; in net_buf_simple_restore()
955 uint8_t * __must_check (*alloc)(struct net_buf *buf, size_t *size,
957 uint8_t * __must_check (*ref)(struct net_buf *buf, uint8_t *data);
958 void (*unref)(struct net_buf *buf, uint8_t *data);
999 void (*const destroy)(struct net_buf *buf);
1225 int net_buf_id(struct net_buf *buf);
1357 static inline void net_buf_destroy(struct net_buf *buf) in net_buf_destroy() argument
1359 struct net_buf_pool *pool = net_buf_pool_get(buf->pool_id); in net_buf_destroy()
1361 k_lifo_put(&pool->free, buf); in net_buf_destroy()
1371 void net_buf_reset(struct net_buf *buf);
1381 void net_buf_simple_reserve(struct net_buf_simple *buf, size_t reserve);
1392 void net_buf_slist_put(sys_slist_t *list, struct net_buf *buf);
1415 void net_buf_put(struct k_fifo *fifo, struct net_buf *buf);
1425 void net_buf_unref_debug(struct net_buf *buf, const char *func, int line);
1429 void net_buf_unref(struct net_buf *buf);
1439 struct net_buf * __must_check net_buf_ref(struct net_buf *buf);
1454 struct net_buf * __must_check net_buf_clone(struct net_buf *buf,
1464 static inline void * __must_check net_buf_user_data(const struct net_buf *buf) in net_buf_user_data() argument
1466 return (void *)buf->user_data; in net_buf_user_data()
1477 static inline void net_buf_reserve(struct net_buf *buf, size_t reserve) in net_buf_reserve() argument
1479 net_buf_simple_reserve(&buf->b, reserve); in net_buf_reserve()
1493 static inline void *net_buf_add(struct net_buf *buf, size_t len) in net_buf_add() argument
1495 return net_buf_simple_add(&buf->b, len); in net_buf_add()
1510 static inline void *net_buf_add_mem(struct net_buf *buf, const void *mem, in net_buf_add_mem() argument
1513 return net_buf_simple_add_mem(&buf->b, mem, len); in net_buf_add_mem()
1527 static inline uint8_t *net_buf_add_u8(struct net_buf *buf, uint8_t val) in net_buf_add_u8() argument
1529 return net_buf_simple_add_u8(&buf->b, val); in net_buf_add_u8()
1542 static inline void net_buf_add_le16(struct net_buf *buf, uint16_t val) in net_buf_add_le16() argument
1544 net_buf_simple_add_le16(&buf->b, val); in net_buf_add_le16()
1557 static inline void net_buf_add_be16(struct net_buf *buf, uint16_t val) in net_buf_add_be16() argument
1559 net_buf_simple_add_be16(&buf->b, val); in net_buf_add_be16()
1572 static inline void net_buf_add_le24(struct net_buf *buf, uint32_t val) in net_buf_add_le24() argument
1574 net_buf_simple_add_le24(&buf->b, val); in net_buf_add_le24()
1587 static inline void net_buf_add_be24(struct net_buf *buf, uint32_t val) in net_buf_add_be24() argument
1589 net_buf_simple_add_be24(&buf->b, val); in net_buf_add_be24()
1602 static inline void net_buf_add_le32(struct net_buf *buf, uint32_t val) in net_buf_add_le32() argument
1604 net_buf_simple_add_le32(&buf->b, val); in net_buf_add_le32()
1617 static inline void net_buf_add_be32(struct net_buf *buf, uint32_t val) in net_buf_add_be32() argument
1619 net_buf_simple_add_be32(&buf->b, val); in net_buf_add_be32()
1632 static inline void net_buf_add_le48(struct net_buf *buf, uint64_t val) in net_buf_add_le48() argument
1634 net_buf_simple_add_le48(&buf->b, val); in net_buf_add_le48()
1647 static inline void net_buf_add_be48(struct net_buf *buf, uint64_t val) in net_buf_add_be48() argument
1649 net_buf_simple_add_be48(&buf->b, val); in net_buf_add_be48()
1662 static inline void net_buf_add_le64(struct net_buf *buf, uint64_t val) in net_buf_add_le64() argument
1664 net_buf_simple_add_le64(&buf->b, val); in net_buf_add_le64()
1677 static inline void net_buf_add_be64(struct net_buf *buf, uint64_t val) in net_buf_add_be64() argument
1679 net_buf_simple_add_be64(&buf->b, val); in net_buf_add_be64()
1692 static inline void *net_buf_remove_mem(struct net_buf *buf, size_t len) in net_buf_remove_mem() argument
1694 return net_buf_simple_remove_mem(&buf->b, len); in net_buf_remove_mem()
1707 static inline uint8_t net_buf_remove_u8(struct net_buf *buf) in net_buf_remove_u8() argument
1709 return net_buf_simple_remove_u8(&buf->b); in net_buf_remove_u8()
1722 static inline uint16_t net_buf_remove_le16(struct net_buf *buf) in net_buf_remove_le16() argument
1724 return net_buf_simple_remove_le16(&buf->b); in net_buf_remove_le16()
1737 static inline uint16_t net_buf_remove_be16(struct net_buf *buf) in net_buf_remove_be16() argument
1739 return net_buf_simple_remove_be16(&buf->b); in net_buf_remove_be16()
1752 static inline uint32_t net_buf_remove_be24(struct net_buf *buf) in net_buf_remove_be24() argument
1754 return net_buf_simple_remove_be24(&buf->b); in net_buf_remove_be24()
1767 static inline uint32_t net_buf_remove_le24(struct net_buf *buf) in net_buf_remove_le24() argument
1769 return net_buf_simple_remove_le24(&buf->b); in net_buf_remove_le24()
1782 static inline uint32_t net_buf_remove_le32(struct net_buf *buf) in net_buf_remove_le32() argument
1784 return net_buf_simple_remove_le32(&buf->b); in net_buf_remove_le32()
1797 static inline uint32_t net_buf_remove_be32(struct net_buf *buf) in net_buf_remove_be32() argument
1799 return net_buf_simple_remove_be32(&buf->b); in net_buf_remove_be32()
1812 static inline uint64_t net_buf_remove_le48(struct net_buf *buf) in net_buf_remove_le48() argument
1814 return net_buf_simple_remove_le48(&buf->b); in net_buf_remove_le48()
1827 static inline uint64_t net_buf_remove_be48(struct net_buf *buf) in net_buf_remove_be48() argument
1829 return net_buf_simple_remove_be48(&buf->b); in net_buf_remove_be48()
1842 static inline uint64_t net_buf_remove_le64(struct net_buf *buf) in net_buf_remove_le64() argument
1844 return net_buf_simple_remove_le64(&buf->b); in net_buf_remove_le64()
1857 static inline uint64_t net_buf_remove_be64(struct net_buf *buf) in net_buf_remove_be64() argument
1859 return net_buf_simple_remove_be64(&buf->b); in net_buf_remove_be64()
1873 static inline void *net_buf_push(struct net_buf *buf, size_t len) in net_buf_push() argument
1875 return net_buf_simple_push(&buf->b, len); in net_buf_push()
1890 static inline void *net_buf_push_mem(struct net_buf *buf, const void *mem, in net_buf_push_mem() argument
1893 return net_buf_simple_push_mem(&buf->b, mem, len); in net_buf_push_mem()
1904 static inline void net_buf_push_u8(struct net_buf *buf, uint8_t val) in net_buf_push_u8() argument
1906 net_buf_simple_push_u8(&buf->b, val); in net_buf_push_u8()
1918 static inline void net_buf_push_le16(struct net_buf *buf, uint16_t val) in net_buf_push_le16() argument
1920 net_buf_simple_push_le16(&buf->b, val); in net_buf_push_le16()
1932 static inline void net_buf_push_be16(struct net_buf *buf, uint16_t val) in net_buf_push_be16() argument
1934 net_buf_simple_push_be16(&buf->b, val); in net_buf_push_be16()
1946 static inline void net_buf_push_le24(struct net_buf *buf, uint32_t val) in net_buf_push_le24() argument
1948 net_buf_simple_push_le24(&buf->b, val); in net_buf_push_le24()
1960 static inline void net_buf_push_be24(struct net_buf *buf, uint32_t val) in net_buf_push_be24() argument
1962 net_buf_simple_push_be24(&buf->b, val); in net_buf_push_be24()
1974 static inline void net_buf_push_le32(struct net_buf *buf, uint32_t val) in net_buf_push_le32() argument
1976 net_buf_simple_push_le32(&buf->b, val); in net_buf_push_le32()
1988 static inline void net_buf_push_be32(struct net_buf *buf, uint32_t val) in net_buf_push_be32() argument
1990 net_buf_simple_push_be32(&buf->b, val); in net_buf_push_be32()
2002 static inline void net_buf_push_le48(struct net_buf *buf, uint64_t val) in net_buf_push_le48() argument
2004 net_buf_simple_push_le48(&buf->b, val); in net_buf_push_le48()
2016 static inline void net_buf_push_be48(struct net_buf *buf, uint64_t val) in net_buf_push_be48() argument
2018 net_buf_simple_push_be48(&buf->b, val); in net_buf_push_be48()
2030 static inline void net_buf_push_le64(struct net_buf *buf, uint64_t val) in net_buf_push_le64() argument
2032 net_buf_simple_push_le64(&buf->b, val); in net_buf_push_le64()
2044 static inline void net_buf_push_be64(struct net_buf *buf, uint64_t val) in net_buf_push_be64() argument
2046 net_buf_simple_push_be64(&buf->b, val); in net_buf_push_be64()
2060 static inline void *net_buf_pull(struct net_buf *buf, size_t len) in net_buf_pull() argument
2062 return net_buf_simple_pull(&buf->b, len); in net_buf_pull()
2076 static inline void *net_buf_pull_mem(struct net_buf *buf, size_t len) in net_buf_pull_mem() argument
2078 return net_buf_simple_pull_mem(&buf->b, len); in net_buf_pull_mem()
2091 static inline uint8_t net_buf_pull_u8(struct net_buf *buf) in net_buf_pull_u8() argument
2093 return net_buf_simple_pull_u8(&buf->b); in net_buf_pull_u8()
2106 static inline uint16_t net_buf_pull_le16(struct net_buf *buf) in net_buf_pull_le16() argument
2108 return net_buf_simple_pull_le16(&buf->b); in net_buf_pull_le16()
2121 static inline uint16_t net_buf_pull_be16(struct net_buf *buf) in net_buf_pull_be16() argument
2123 return net_buf_simple_pull_be16(&buf->b); in net_buf_pull_be16()
2136 static inline uint32_t net_buf_pull_le24(struct net_buf *buf) in net_buf_pull_le24() argument
2138 return net_buf_simple_pull_le24(&buf->b); in net_buf_pull_le24()
2151 static inline uint32_t net_buf_pull_be24(struct net_buf *buf) in net_buf_pull_be24() argument
2153 return net_buf_simple_pull_be24(&buf->b); in net_buf_pull_be24()
2166 static inline uint32_t net_buf_pull_le32(struct net_buf *buf) in net_buf_pull_le32() argument
2168 return net_buf_simple_pull_le32(&buf->b); in net_buf_pull_le32()
2181 static inline uint32_t net_buf_pull_be32(struct net_buf *buf) in net_buf_pull_be32() argument
2183 return net_buf_simple_pull_be32(&buf->b); in net_buf_pull_be32()
2196 static inline uint64_t net_buf_pull_le48(struct net_buf *buf) in net_buf_pull_le48() argument
2198 return net_buf_simple_pull_le48(&buf->b); in net_buf_pull_le48()
2211 static inline uint64_t net_buf_pull_be48(struct net_buf *buf) in net_buf_pull_be48() argument
2213 return net_buf_simple_pull_be48(&buf->b); in net_buf_pull_be48()
2226 static inline uint64_t net_buf_pull_le64(struct net_buf *buf) in net_buf_pull_le64() argument
2228 return net_buf_simple_pull_le64(&buf->b); in net_buf_pull_le64()
2241 static inline uint64_t net_buf_pull_be64(struct net_buf *buf) in net_buf_pull_be64() argument
2243 return net_buf_simple_pull_be64(&buf->b); in net_buf_pull_be64()
2255 static inline size_t net_buf_tailroom(struct net_buf *buf) in net_buf_tailroom() argument
2257 return net_buf_simple_tailroom(&buf->b); in net_buf_tailroom()
2269 static inline size_t net_buf_headroom(struct net_buf *buf) in net_buf_headroom() argument
2271 return net_buf_simple_headroom(&buf->b); in net_buf_headroom()
2283 static inline uint16_t net_buf_max_len(struct net_buf *buf) in net_buf_max_len() argument
2285 return net_buf_simple_max_len(&buf->b); in net_buf_max_len()
2297 static inline uint8_t *net_buf_tail(struct net_buf *buf) in net_buf_tail() argument
2299 return net_buf_simple_tail(&buf->b); in net_buf_tail()
2413 size_t net_buf_append_bytes(struct net_buf *buf, size_t len,
2432 static inline struct net_buf *net_buf_skip(struct net_buf *buf, size_t len) in net_buf_skip() argument
2434 while (buf && len--) { in net_buf_skip()
2435 net_buf_pull_u8(buf); in net_buf_skip()
2436 if (!buf->len) { in net_buf_skip()
2437 buf = net_buf_frag_del(NULL, buf); in net_buf_skip()
2441 return buf; in net_buf_skip()
2454 static inline size_t net_buf_frags_len(struct net_buf *buf) in net_buf_frags_len() argument
2458 while (buf) { in net_buf_frags_len()
2459 bytes += buf->len; in net_buf_frags_len()
2460 buf = buf->frags; in net_buf_frags_len()