ReactOS 0.4.16-dev-470-g91b8923
|
Go to the source code of this file.
Classes | |
struct | pbuf |
struct | pbuf_rom |
Enumerations | |
enum | pbuf_layer { PBUF_TRANSPORT = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN , PBUF_IP = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN , PBUF_LINK = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN , PBUF_RAW_TX = PBUF_LINK_ENCAPSULATION_HLEN , PBUF_RAW = 0 } |
enum | pbuf_type { PBUF_RAM = (PBUF_ALLOC_FLAG_DATA_CONTIGUOUS | PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS | PBUF_TYPE_ALLOC_SRC_MASK_STD_HEAP) , PBUF_ROM = PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF , PBUF_REF = (PBUF_TYPE_FLAG_DATA_VOLATILE | PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF) , PBUF_POOL = (PBUF_ALLOC_FLAG_RX | PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS | PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF_POOL) } |
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_ALLOC_FLAG_DATA_CONTIGUOUS 0x0200 |
#define PBUF_ALLOC_FLAG_RX 0x0100 |
#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_get_allocsrc | ( | p | ) | ((p)->type_internal & PBUF_TYPE_ALLOC_SRC_MASK) |
#define pbuf_match_allocsrc | ( | p, | |
type | |||
) | (pbuf_get_allocsrc(p) == ((type) & PBUF_TYPE_ALLOC_SRC_MASK)) |
#define PBUF_POOL_FREE_OOSEQ 1 |
#define PBUF_TYPE_ALLOC_SRC_MASK 0x0F |
#define PBUF_TYPE_ALLOC_SRC_MASK_APP_MAX PBUF_TYPE_ALLOC_SRC_MASK |
#define PBUF_TYPE_ALLOC_SRC_MASK_APP_MIN 0x03 |
#define PBUF_TYPE_FLAG_DATA_VOLATILE 0x40 |
#define PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS 0x80 |
Indicates that the payload directly follows the struct pbuf. This makes pbuf_header work in both directions.
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.
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.
Definition at line 554 of file pbuf.c.
Referenced by test_udp_create_test_packet().
Same as pbuf_add_header but does not check if 'header_size > 0' is allowed. This is used internally only, to allow PBUF_REF for RX.
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 914 of file pbuf.c.
Similar to pbuf_header(-size) but de-refs header pbufs for (size >= p->len)
q | pbufs to operate on |
size | The number of bytes to remove from the beginning of the pbuf list. While size >= p->len, pbufs are freed. ATTENTION: this is the opposite direction as pbuf_header, but takes an u16_t not s16_t! |
Definition at line 674 of file pbuf.c.
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 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.
Definition at line 649 of file pbuf.c.
Referenced by START_TEST(), tcp_create_segment_wnd(), and test_tcp_input().
Same as pbuf_header but does not check if 'header_size > 0' is allowed. This is used internally only, to allow PBUF_REF for RX.
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.
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. |
Definition at line 585 of file pbuf.c.
Referenced by pbuf_free_header(), and pbuf_header_impl().
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 1534 of file pbuf.c.