17 #ifndef LWIP_MEMORY_MANAGER_H 18 #define LWIP_MEMORY_MANAGER_H 20 #include "EMACMemoryManager.h" 35 net_stack_mem_buf_t *
alloc_heap(uint32_t size, uint32_t align)
override;
48 net_stack_mem_buf_t *
alloc_pool(uint32_t size, uint32_t align)
override;
68 void free(net_stack_mem_buf_t *buf)
override;
78 uint32_t
get_total_len(
const net_stack_mem_buf_t *buf)
const override;
89 void copy(net_stack_mem_buf_t *to_buf,
const net_stack_mem_buf_t *from_buf)
override;
102 void copy_to_buf(net_stack_mem_buf_t *to_buf,
const void *ptr, uint32_t len)
override;
114 uint32_t
copy_from_buf(
void *ptr, uint32_t len,
const net_stack_mem_buf_t *from_buf)
const override;
126 void cat(net_stack_mem_buf_t *to_buf, net_stack_mem_buf_t *cat_buf)
override;
136 net_stack_mem_buf_t *
get_next(
const net_stack_mem_buf_t *buf)
const override;
144 void *
get_ptr(
const net_stack_mem_buf_t *buf)
const override;
152 uint32_t
get_len(
const net_stack_mem_buf_t *buf)
const override;
163 void set_len(net_stack_mem_buf_t *buf, uint32_t len)
override;
177 uint32_t count_total_align(uint32_t size, uint32_t align);
189 void align_memory(
struct pbuf *
pbuf, uint32_t align);
199 void set_total_len(
struct pbuf *pbuf);
void * get_ptr(const net_stack_mem_buf_t *buf) const override
Return pointer to the payload of the buffer.
net_stack_mem_buf_t * alloc_pool(uint32_t size, uint32_t align) override
Allocates memory buffer chain from a pool.
void copy(net_stack_mem_buf_t *to_buf, const net_stack_mem_buf_t *from_buf) override
Copy a memory buffer chain.
void copy_to_buf(net_stack_mem_buf_t *to_buf, const void *ptr, uint32_t len) override
Copy to a memory buffer chain.
void set_len(net_stack_mem_buf_t *buf, uint32_t len) override
Sets the payload size of the buffer.
uint32_t get_total_len(const net_stack_mem_buf_t *buf) const override
Return total length of a memory buffer chain.
void free(net_stack_mem_buf_t *buf) override
Free memory buffer chain.
uint32_t get_pool_alloc_unit(uint32_t align) const override
Get memory buffer pool allocation unit.
net_stack_mem_buf_t * alloc_heap(uint32_t size, uint32_t align) override
Allocates memory buffer from the heap.
net_stack_mem_buf_t * get_next(const net_stack_mem_buf_t *buf) const override
Returns the next buffer.
Main packet buffer struct.
uint32_t copy_from_buf(void *ptr, uint32_t len, const net_stack_mem_buf_t *from_buf) const override
Copy from a memory buffer chain.
void cat(net_stack_mem_buf_t *to_buf, net_stack_mem_buf_t *cat_buf) override
Concatenate two memory buffer chains.
uint32_t get_len(const net_stack_mem_buf_t *buf) const override
Return payload size of the buffer.