| UbixOS V2
    2.0
    | 


Go to the source code of this file.
| Data Structures | |
| struct | pbuf | 
| struct | pbuf_rom | 
| Macros | |
| #define | LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG)) | 
| #define | PBUF_CHECK_FREE_OOSEQ() | 
| #define | PBUF_FLAG_IS_CUSTOM 0x02U | 
| #define | PBUF_FLAG_LLBCAST 0x08U | 
| #define | PBUF_FLAG_LLMCAST 0x10U | 
| #define | PBUF_FLAG_MCASTLOOP 0x04U | 
| #define | PBUF_FLAG_PUSH 0x01U | 
| #define | PBUF_FLAG_TCP_FIN 0x20U | 
| #define | pbuf_init() | 
| #define | PBUF_IP_HLEN 20 | 
| #define | PBUF_POOL_FREE_OOSEQ 1 | 
| #define | PBUF_TRANSPORT_HLEN 20 | 
| Enumerations | |
| enum | pbuf_layer { PBUF_TRANSPORT, PBUF_IP, PBUF_LINK, PBUF_RAW_TX, PBUF_RAW } | 
| enum | pbuf_type { PBUF_RAM, PBUF_ROM, PBUF_REF, PBUF_POOL } | 
| Functions | |
| struct pbuf * | pbuf_alloc (pbuf_layer l, u16_t length, pbuf_type type) | 
| void | pbuf_cat (struct pbuf *head, struct pbuf *tail) | 
| void | pbuf_chain (struct pbuf *head, struct pbuf *tail) | 
| u16_t | pbuf_clen (const struct pbuf *p) | 
| struct pbuf * | pbuf_coalesce (struct pbuf *p, pbuf_layer layer) | 
| err_t | pbuf_copy (struct pbuf *p_to, const struct pbuf *p_from) | 
| u16_t | pbuf_copy_partial (const struct pbuf *p, void *dataptr, u16_t len, u16_t offset) | 
| struct pbuf * | pbuf_dechain (struct pbuf *p) | 
| u8_t | pbuf_free (struct pbuf *p) | 
| u8_t | pbuf_get_at (const struct pbuf *p, u16_t offset) | 
| u8_t | pbuf_header (struct pbuf *p, s16_t header_size) | 
| u8_t | pbuf_header_force (struct pbuf *p, s16_t header_size) | 
| 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) | 
| void | pbuf_put_at (struct pbuf *p, u16_t offset, u8_t data) | 
| void | pbuf_realloc (struct pbuf *p, u16_t size) | 
| void | pbuf_ref (struct pbuf *p) | 
| struct pbuf * | pbuf_skip (struct pbuf *in, u16_t in_offset, u16_t *out_offset) | 
| u16_t | pbuf_strstr (const struct pbuf *p, const char *substr) | 
| 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) | 
| int | pbuf_try_get_at (const struct pbuf *p, u16_t offset) | 
pbuf API
Definition in file pbuf.h.
| #define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG)) | 
LWIP_SUPPORT_CUSTOM_PBUF==1: Custom pbufs behave much like their pbuf type but they are allocated by external code (initialised by calling pbuf_alloced_custom()) and when pbuf_free gives up their last reference, they are freed by calling pbuf_custom->custom_free_function(). Currently, the pbuf_custom code is only needed for one specific configuration of IP_FRAG, unless required by external driver/application code.
| #define PBUF_FLAG_IS_CUSTOM 0x02U | 
| #define PBUF_FLAG_LLBCAST 0x08U | 
| #define PBUF_FLAG_LLMCAST 0x10U | 
| #define PBUF_FLAG_MCASTLOOP 0x04U | 
| #define PBUF_FLAG_PUSH 0x01U | 
| #define PBUF_FLAG_TCP_FIN 0x20U | 
| #define PBUF_POOL_FREE_OOSEQ 1 | 
Count number of pbufs in a chain
| p | first pbuf of chain | 
Definition at line 801 of file pbuf.c.
References pbuf::next, and NULL.
Dechains the first pbuf from its succeeding pbufs in the chain.
Makes p->tot_len field equal to p->len.
| p | pbuf to dechain | 
Definition at line 900 of file pbuf.c.
References pbuf::len, LWIP_ASSERT, LWIP_DBG_TRACE, LWIP_DEBUGF, pbuf::next, NULL, PBUF_DEBUG, pbuf_free(), and pbuf::tot_len.

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.
| 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 hdr_size_inc 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.
Find occurrence of substr with length substr_len in pbuf p, start at offset start_offset WARNING: in contrast to strstr(), this one does not stop at the first \0 in the pbuf/source string!
| p | pbuf to search, maximum length is 0xFFFE since 0xFFFF is used as return value 'not found' | 
| substr | string to search for in p, maximum length is 0xFFFE | 
Definition at line 1432 of file pbuf.c.
References NULL, pbuf_memfind(), strlen(), and pbuf::tot_len.
