Warning, cross-references for /kernel/include/lwip/netbuf.h need to be fixed.
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 #ifndef __LWIP_NETBUF_H__
0033 #define __LWIP_NETBUF_H__
0034
0035 #include "lwip/opt.h"
0036 #include "lwip/pbuf.h"
0037 #include "lwip/ip_addr.h"
0038
0039 #ifdef __cplusplus
0040 extern "C" {
0041 #endif
0042
0043 struct netbuf {
0044 struct pbuf *p, *ptr;
0045 struct ip_addr *addr;
0046 u16_t port;
0047 #if LWIP_NETBUF_RECVINFO
0048 struct ip_addr *toaddr;
0049 u16_t toport;
0050 #endif
0051 };
0052
0053
0054 struct netbuf * netbuf_new (void);
0055 void netbuf_delete (struct netbuf *buf);
0056 void * netbuf_alloc (struct netbuf *buf, u16_t size);
0057 void netbuf_free (struct netbuf *buf);
0058 err_t netbuf_ref (struct netbuf *buf,
0059 const void *dataptr, u16_t size);
0060 void netbuf_chain (struct netbuf *head,
0061 struct netbuf *tail);
0062
0063 u16_t netbuf_len (struct netbuf *buf);
0064 err_t netbuf_data (struct netbuf *buf,
0065 void **dataptr, u16_t *len);
0066 s8_t netbuf_next (struct netbuf *buf);
0067 void netbuf_first (struct netbuf *buf);
0068
0069
0070 #define netbuf_copy_partial(buf, dataptr, len, offset) \
0071 pbuf_copy_partial((buf)->p, (dataptr), (len), (offset))
0072 #define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0)
0073 #define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len)
0074 #define netbuf_len(buf) ((buf)->p->tot_len)
0075 #define netbuf_fromaddr(buf) ((buf)->addr)
0076 #define netbuf_fromport(buf) ((buf)->port)
0077 #if LWIP_NETBUF_RECVINFO
0078 #define netbuf_destaddr(buf) ((buf)->toaddr)
0079 #define netbuf_destport(buf) ((buf)->toport)
0080 #endif
0081
0082 #ifdef __cplusplus
0083 }
0084 #endif
0085
0086 #endif