37#ifndef LWIP_HDR_NETBUF_H
38#define LWIP_HDR_NETBUF_H
42#if LWIP_NETCONN || LWIP_SOCKET
55#define NETBUF_FLAG_DESTADDR 0x01
57#define NETBUF_FLAG_CHKSUM 0x02
64#if LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY
67#if LWIP_NETBUF_RECVINFO
74struct netbuf * netbuf_new (
void);
88#define netbuf_copy_partial(buf, dataptr, len, offset) \
89 pbuf_copy_partial((buf)->p, (dataptr), (len), (offset))
90#define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0)
91#define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len)
92#define netbuf_len(buf) ((buf)->p->tot_len)
93#define netbuf_fromaddr(buf) (&((buf)->addr))
94#define netbuf_set_fromaddr(buf, fromaddr) ip_addr_set(&((buf)->addr), fromaddr)
95#define netbuf_fromport(buf) ((buf)->port)
96#if LWIP_NETBUF_RECVINFO
97#define netbuf_destaddr(buf) (&((buf)->toaddr))
98#define netbuf_set_destaddr(buf, destaddr) ip_addr_set(&((buf)->toaddr), destaddr)
99#if LWIP_CHECKSUM_ON_COPY
100#define netbuf_destport(buf) (((buf)->flags & NETBUF_FLAG_DESTADDR) ? (buf)->toport_chksum : 0)
102#define netbuf_destport(buf) ((buf)->toport_chksum)
105#if LWIP_CHECKSUM_ON_COPY
106#define netbuf_set_chksum(buf, chksum) do { (buf)->flags = NETBUF_FLAG_CHKSUM; \
107 (buf)->toport_chksum = chksum; } while(0)
struct outqueuenode * tail
struct outqueuenode * head
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum const GLvoid * addr
int const JOCTET * dataptr