Copies all of the data from the netbuf buf into the
memory pointed to by data even if the netbuf buf is
fragmented. The len parameter is an upper bound of
how much data that will be copied into the memory pointed to by data.
Example
Example 4-1. This example shows a simple use of netbuf_copy()
Here, 200 bytes of memory is allocated on the stack to hold data. Even if
the netbuf buf has more data that 200 bytes, only 200 bytes are copied into
data.
void
example_function(struct netbuf *buf)
{
char data[200];
netbuf_copy(buf, data, 200);
/* do something with the data */
}