eCosPro® Reference Manual
Prev |  | Next

# netbuf_alloc()

## Name

netbuf_alloc() -- Allocate space in a netbuf

## Synopsis

``void *netbuf_alloc`(struct netbuf *buf, u16_t size);`

## Description

Allocates buffer memory with size number of bytes for the netbuf buf. The function returns a pointer to the allocated memory. Any memory previously allocated to the netbuf buf is deallocated. The allocated memory can later be deallocated with the `netbuf_free()` function. Since protocol headers are expected to precede the data when it should be sent, the function allocates memory for protocol headers as well as for the actual data.

Prev | Home | Next
netbuf_delete() | Up | netbuf_free()