tcp_pbuf_prealloc() function
Allocate a PBUF_RAM pbuf, perhaps with extra space at the end. This function is like pbuf_alloc(layer, length, PBUF_RAM) except there may be extra bytes available at the end. Called by tcp_write
Arguments
layer
flag to define header size.
length
size of the pbuf's payload.
max_length
maximum usable size of payload+oversize.
oversize
pointer to a u16_t that will receive the number of usable tail bytes.
pcb
The TCP connection that will enqueue the pbuf.
apiflags
API flags given to tcp_write.
first_seg
true when this pbuf will be used in the first enqueued segment.