inet_chksum.h

IP checksum calculation functions.

Defines

SWAP_BYTES_IN_WORD(w)

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

FOLD_U32T(u)

Split an u32_t in two u16_ts and add them up.

LWIP_CHKSUM_COPY_ALGORITHM

Functions

u16_t inet_chksum(const void *dataptr, u16_t len)
u16_t inet_chksum_pbuf(struct pbuf *p)
u16_t ip_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len, const ip_addr_t *src, const ip_addr_t *dest)
u16_t ip_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len, u16_t chksum_len, const ip_addr_t *src, const ip_addr_t *dest)