Name

netbuf_data() — Obtain a pointer to netbuf data

Synopsis

err_t netbuf_data (struct netbuf *buf , void **data , u16_t *len );

Description

This function is used to obtain a pointer to and the length of a block of data in the netbuf buf. The arguments data and len are result parameters that will be filled with a pointer to the data and the length of the data pointed to. If the netbuf is fragmented, this function gives a pointer to one of the fragments in the netbuf. The application program must use the fragment handling functions netbuf_first() and netbuf_next() in order to reach all data in the netbuf. See the example under netbuf_next() for an example of how use netbuf_data().