mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-05 15:39:54 +00:00
Tried to improve pbuf_type, LWIP_SUPPORT_CUSTOM_PBUF and PBUF_FLAG_IS_CUSTOM documentation
This commit is contained in:
parent
e5e0a21fc6
commit
9352988c44
@ -40,8 +40,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Currently, the pbuf_custom code is only needed for one specific configuration
|
||||
* of IP_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. */
|
||||
#ifndef LWIP_SUPPORT_CUSTOM_PBUF
|
||||
#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG))
|
||||
#endif
|
||||
@ -65,17 +69,32 @@ typedef enum {
|
||||
} pbuf_layer;
|
||||
|
||||
typedef enum {
|
||||
PBUF_RAM, /* pbuf data is stored in RAM */
|
||||
PBUF_ROM, /* pbuf data is stored in ROM */
|
||||
PBUF_REF, /* pbuf comes from the pbuf pool */
|
||||
PBUF_POOL /* pbuf payload refers to RAM */
|
||||
/** pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload
|
||||
are allocated in one piece of contiguous memory (so the first payload byte
|
||||
can be calculated from struct pbuf)
|
||||
pbuf_alloc() allocates PBUF_RAM pbufs as unchained pbufs (although that might
|
||||
change in future versions) */
|
||||
PBUF_RAM,
|
||||
/** pbuf data is stored in ROM, i.e. struct pbuf and its payload are located in
|
||||
totally different memory areas. Since it points to ROM, payload does not
|
||||
have to be copied when queued for transmission. */
|
||||
PBUF_ROM,
|
||||
/** pbuf comes from the pbuf pool. Much like PBUF_ROM but payload might change
|
||||
so it has to be duplicated when queued before transmitting, depending on
|
||||
who has a 'ref' to it. */
|
||||
PBUF_REF,
|
||||
/** pbuf payload refers to RAM. This one comes from a pool and should be used
|
||||
for RX. Payload can be chained (scatter-gather RX) but like PBUF_RAM, struct
|
||||
pbuf and its payload are allocated in one piece of contiguous memory (so
|
||||
the first payload byte can be calculated from struct pbuf) */
|
||||
PBUF_POOL
|
||||
} pbuf_type;
|
||||
|
||||
|
||||
/** indicates this packet's data should be immediately passed to the application */
|
||||
#define PBUF_FLAG_PUSH 0x01U
|
||||
/** indicates this is a custom pbuf: pbuf_free and pbuf_header handle such a
|
||||
a pbuf differently */
|
||||
/** indicates this is a custom pbuf: pbuf_free calls pbuf_custom->custom_free_function()
|
||||
when the last reference is released (plus custom PBUF_RAM cannot be trimmed) */
|
||||
#define PBUF_FLAG_IS_CUSTOM 0x02U
|
||||
/** indicates this pbuf is UDP multicast to be looped back */
|
||||
#define PBUF_FLAG_MCASTLOOP 0x04U
|
||||
|
Loading…
x
Reference in New Issue
Block a user