uc-sdk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
netbuf.h File Reference
#include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/ip_addr.h"

Go to the source code of this file.

Classes

struct  netbuf
 

Macros

#define NETBUF_FLAG_DESTADDR   0x01
 
#define NETBUF_FLAG_CHKSUM   0x02
 
#define netbuf_copy_partial(buf, dataptr, len, offset)   pbuf_copy_partial((buf)->p, (dataptr), (len), (offset))
 
#define netbuf_copy(buf, dataptr, len)   netbuf_copy_partial(buf, dataptr, len, 0)
 
#define netbuf_take(buf, dataptr, len)   pbuf_take((buf)->p, dataptr, len)
 
#define netbuf_len(buf)   ((buf)->p->tot_len)
 
#define netbuf_fromaddr(buf)   (&((buf)->addr))
 
#define netbuf_set_fromaddr(buf, fromaddr)   ip_addr_set((&(buf)->addr), fromaddr)
 
#define netbuf_fromport(buf)   ((buf)->port)
 

Functions

struct netbufnetbuf_new (void)
 
void netbuf_delete (struct netbuf *buf)
 
void * netbuf_alloc (struct netbuf *buf, u16_t size)
 
void netbuf_free (struct netbuf *buf)
 
err_t netbuf_ref (struct netbuf *buf, const void *dataptr, u16_t size)
 
void netbuf_chain (struct netbuf *head, struct netbuf *tail)
 
err_t netbuf_data (struct netbuf *buf, void **dataptr, u16_t *len)
 
s8_t netbuf_next (struct netbuf *buf)
 
void netbuf_first (struct netbuf *buf)
 

Macro Definition Documentation

#define netbuf_copy (   buf,
  dataptr,
  len 
)    netbuf_copy_partial(buf, dataptr, len, 0)

Definition at line 81 of file netbuf.h.

#define netbuf_copy_partial (   buf,
  dataptr,
  len,
  offset 
)    pbuf_copy_partial((buf)->p, (dataptr), (len), (offset))

Definition at line 79 of file netbuf.h.

#define NETBUF_FLAG_CHKSUM   0x02

This netbuf includes a checksum

Definition at line 46 of file netbuf.h.

#define NETBUF_FLAG_DESTADDR   0x01

This netbuf has dest-addr/port set

Definition at line 44 of file netbuf.h.

#define netbuf_fromaddr (   buf)    (&((buf)->addr))

Definition at line 84 of file netbuf.h.

#define netbuf_fromport (   buf)    ((buf)->port)

Definition at line 86 of file netbuf.h.

#define netbuf_len (   buf)    ((buf)->p->tot_len)

Definition at line 83 of file netbuf.h.

#define netbuf_set_fromaddr (   buf,
  fromaddr 
)    ip_addr_set((&(buf)->addr), fromaddr)

Definition at line 85 of file netbuf.h.

#define netbuf_take (   buf,
  dataptr,
  len 
)    pbuf_take((buf)->p, dataptr, len)

Definition at line 82 of file netbuf.h.

Function Documentation

void* netbuf_alloc ( struct netbuf buf,
u16_t  size 
)
void netbuf_chain ( struct netbuf head,
struct netbuf tail 
)
err_t netbuf_data ( struct netbuf buf,
void **  dataptr,
u16_t len 
)
void netbuf_delete ( struct netbuf buf)
void netbuf_first ( struct netbuf buf)
void netbuf_free ( struct netbuf buf)
struct netbuf* netbuf_new ( void  )
s8_t netbuf_next ( struct netbuf buf)
err_t netbuf_ref ( struct netbuf buf,
const void *  dataptr,
u16_t  size 
)