MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / netbuf_data

Function netbuf_data

components/net/lwip/lwip-2.1.2/src/api/netbuf.c:195–208  ·  view source on GitHub ↗

* @ingroup netbuf * Get the data pointer and length of the data inside a netbuf. * * @param buf netbuf to get the data from * @param dataptr pointer to a void pointer where to store the data pointer * @param len pointer to an u16_t where the length of the data is stored * @return ERR_OK if the information was retrieved, * ERR_BUF on error. */

Source from the content-addressed store, hash-verified

193 * ERR_BUF on error.
194 */
195err_t
196netbuf_data(struct netbuf *buf, void **dataptr, u16_t *len)
197{
198 LWIP_ERROR("netbuf_data: invalid buf", (buf != NULL), return ERR_ARG;);
199 LWIP_ERROR("netbuf_data: invalid dataptr", (dataptr != NULL), return ERR_ARG;);
200 LWIP_ERROR("netbuf_data: invalid len", (len != NULL), return ERR_ARG;);
201
202 if (buf->ptr == NULL) {
203 return ERR_BUF;
204 }
205 *dataptr = buf->ptr->payload;
206 *len = buf->ptr->len;
207 return ERR_OK;
208}
209
210/**
211 * @ingroup netbuf

Callers 2

drv_ethernet.cFile · 0.50
tcpecho_entryFunction · 0.50

Calls

no outgoing calls

Tested by 1

tcpecho_entryFunction · 0.40