|
| struct pbuf * | pbuf_alloc (pbuf_layer l, u16_t length, pbuf_type type) |
| struct pbuf * | pbuf_alloc_reference (void *payload, u16_t length, pbuf_type type) |
| void | pbuf_realloc (struct pbuf *p, u16_t size) |
| u8_t | pbuf_header (struct pbuf *p, s16_t header_size) |
| u8_t | pbuf_header_force (struct pbuf *p, s16_t header_size) |
| u8_t | pbuf_add_header (struct pbuf *p, size_t header_size_increment) |
| u8_t | pbuf_add_header_force (struct pbuf *p, size_t header_size_increment) |
| u8_t | pbuf_remove_header (struct pbuf *p, size_t header_size) |
| struct pbuf * | pbuf_free_header (struct pbuf *q, u16_t size) |
| void | pbuf_ref (struct pbuf *p) |
| u8_t | pbuf_free (struct pbuf *p) |
| u16_t | pbuf_clen (const struct pbuf *p) |
| void | pbuf_cat (struct pbuf *head, struct pbuf *tail) |
| void | pbuf_chain (struct pbuf *head, struct pbuf *tail) |
| struct pbuf * | pbuf_dechain (struct pbuf *p) |
| err_t | pbuf_copy (struct pbuf *p_to, const struct pbuf *p_from) |
| err_t | pbuf_copy_partial_pbuf (struct pbuf *p_to, const struct pbuf *p_from, u16_t copy_len, u16_t offset) |
| u16_t | pbuf_copy_partial (const struct pbuf *p, void *dataptr, u16_t len, u16_t offset) |
| void * | pbuf_get_contiguous (const struct pbuf *p, void *buffer, size_t bufsize, u16_t len, u16_t offset) |
| err_t | pbuf_take (struct pbuf *buf, const void *dataptr, u16_t len) |
| err_t | pbuf_take_at (struct pbuf *buf, const void *dataptr, u16_t len, u16_t offset) |
| struct pbuf * | pbuf_skip (struct pbuf *in, u16_t in_offset, u16_t *out_offset) |
| struct pbuf * | pbuf_coalesce (struct pbuf *p, pbuf_layer layer) |
| struct pbuf * | pbuf_clone (pbuf_layer l, pbuf_type type, struct pbuf *p) |
| u8_t | pbuf_get_at (const struct pbuf *p, u16_t offset) |
| int | pbuf_try_get_at (const struct pbuf *p, u16_t offset) |
| void | pbuf_put_at (struct pbuf *p, u16_t offset, u8_t data) |
| u16_t | pbuf_memcmp (const struct pbuf *p, u16_t offset, const void *s2, u16_t n) |
| u16_t | pbuf_memfind (const struct pbuf *p, const void *mem, u16_t mem_len, u16_t start_offset) |
| u16_t | pbuf_strstr (const struct pbuf *p, const char *substr) |
pbuf API
Definition in file pbuf.h.
| #define PBUF_TYPE_ALLOC_SRC_MASK 0x0F |
4 bits are reserved for 16 allocation sources (e.g. heap, pool1, pool2, etc) Internally, we use: 0=heap, 1=MEMP_PBUF, 2=MEMP_PBUF_POOL -> 13 types free
Definition at line 125 of file pbuf.h.
| u8_t pbuf_add_header |
( |
struct pbuf * | p, |
|
|
size_t | header_size_increment ) |
Adjusts the payload pointer to reveal headers in the payload.
Adjusts the ->payload pointer so that space for a header appears in the pbuf payload.
The ->payload, ->tot_len and ->len fields are adjusted.
- Parameters
-
| p | pbuf to change the header size. |
| header_size_increment | Number of bytes to increment header size which increases the size of the pbuf. New space is on the front. If header_size_increment is 0, this function does nothing and returns successful. |
PBUF_ROM and PBUF_REF type buffers cannot have their sizes increased, so the call will fail. A check is made that the increase in header size does not move the payload pointer in front of the start of the buffer.
- Returns
- non-zero on failure, zero on success.
Definition at line 556 of file pbuf.c.
| u8_t pbuf_header |
( |
struct pbuf * | p, |
|
|
s16_t | header_size_increment ) |
Adjusts the payload pointer to hide or reveal headers in the payload.
Adjusts the ->payload pointer so that space for a header (dis)appears in the pbuf payload.
The ->payload, ->tot_len and ->len fields are adjusted.
- Parameters
-
| p | pbuf to change the header size. |
| header_size_increment | Number of bytes to increment header size which increases the size of the pbuf. New space is on the front. (Using a negative value decreases the header size.) If header_size_increment is 0, this function does nothing and returns successful. |
PBUF_ROM and PBUF_REF type buffers cannot have their sizes increased, so the call will fail. A check is made that the increase in header size does not move the payload pointer in front of the start of the buffer.
- Returns
- non-zero on failure, zero on success.
Definition at line 651 of file pbuf.c.
| u8_t pbuf_remove_header |
( |
struct pbuf * | p, |
|
|
size_t | header_size_decrement ) |
Adjusts the payload pointer to hide headers in the payload.
Adjusts the ->payload pointer so that space for a header disappears in the pbuf payload.
The ->payload, ->tot_len and ->len fields are adjusted.
- Parameters
-
| p | pbuf to change the header size. |
| header_size_decrement | Number of bytes to decrement header size which decreases the size of the pbuf. If header_size_decrement is 0, this function does nothing and returns successful. |
- Returns
- non-zero on failure, zero on success.
Definition at line 587 of file pbuf.c.