Defines | Functions

alexb/lib/lwip/contrib/src/include/ipv4/lwip/inet_chksum.h File Reference

#include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/ip_addr.h"

Defines

#define SWAP_BYTES_IN_WORD(w)   (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8)
 Swap the bytes in an u16_t: much like htons() for little-endian.
#define FOLD_U32T(u)   (((u) >> 16) + ((u) & 0x0000ffffUL))
 Split an u32_t in two u16_ts and add them up.
#define LWIP_CHKSUM_COPY_ALGORITHM   0

Functions

u16_t inet_chksum (void *dataptr, u16_t len)
u16_t inet_chksum_pbuf (struct pbuf *p)
 Calculate a checksum over a chain of pbufs (without pseudo-header, much like inet_chksum only pbufs are used).
u16_t inet_chksum_pseudo (struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, u8_t proto, u16_t proto_len)
u16_t inet_chksum_pseudo_partial (struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, u8_t proto, u16_t proto_len, u16_t chksum_len)

Define Documentation

#define FOLD_U32T (   u  )     (((u) >> 16) + ((u) & 0x0000ffffUL))

Split an u32_t in two u16_ts and add them up.

#define LWIP_CHKSUM_COPY_ALGORITHM   0
#define SWAP_BYTES_IN_WORD (   w  )     (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8)

Swap the bytes in an u16_t: much like htons() for little-endian.


Function Documentation

u16_t inet_chksum ( void *  dataptr,
u16_t  len 
)
u16_t inet_chksum_pbuf ( struct pbuf p  ) 

Calculate a checksum over a chain of pbufs (without pseudo-header, much like inet_chksum only pbufs are used).

Parameters:
p pbuf chain over that the checksum should be calculated
Returns:
checksum (as u16_t) to be saved directly in the protocol header
u16_t inet_chksum_pseudo ( struct pbuf p,
ip_addr_t src,
ip_addr_t dest,
u8_t  proto,
u16_t  proto_len 
)
u16_t inet_chksum_pseudo_partial ( struct pbuf p,
ip_addr_t src,
ip_addr_t dest,
u8_t  proto,
u16_t  proto_len,
u16_t  chksum_len 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines