56 #ifndef LWIP_HDR_INET_CHKSUM_H 57 #define LWIP_HDR_INET_CHKSUM_H 65 #ifndef SWAP_BYTES_IN_WORD 66 #define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) 71 #define FOLD_U32T(u) (((u) >> 16) + ((u) & 0x0000ffffUL)) 74 #if LWIP_CHECKSUM_ON_COPY 77 # ifndef LWIP_CHKSUM_COPY 78 # define LWIP_CHKSUM_COPY(dst, src, len) lwip_chksum_copy(dst, src, len) 79 # ifndef LWIP_CHKSUM_COPY_ALGORITHM 80 # define LWIP_CHKSUM_COPY_ALGORITHM 1 83 # define LWIP_CHKSUM_COPY_ALGORITHM 0 86 # define LWIP_CHKSUM_COPY_ALGORITHM 0 93 u16_t inet_chksum(
const void *dataptr, u16_t
len);
95 #if LWIP_CHKSUM_COPY_ALGORITHM 96 u16_t lwip_chksum_copy(
void *dst,
const void *src, u16_t len);
100 u16_t inet_chksum_pseudo(
struct pbuf *p, u8_t proto, u16_t proto_len,
101 const ip4_addr_t *src,
const ip4_addr_t *dest);
102 u16_t inet_chksum_pseudo_partial(
struct pbuf *p, u8_t proto,
103 u16_t proto_len, u16_t chksum_len,
const ip4_addr_t *src,
const ip4_addr_t *dest);
107 u16_t ip6_chksum_pseudo(
struct pbuf *p, u8_t proto, u16_t proto_len,
108 const ip6_addr_t *src,
const ip6_addr_t *dest);
109 u16_t ip6_chksum_pseudo_partial(
struct pbuf *p, u8_t proto, u16_t proto_len,
110 u16_t chksum_len,
const ip6_addr_t *src,
const ip6_addr_t *dest);
114 u16_t ip_chksum_pseudo(
struct pbuf *p, u8_t proto, u16_t proto_len,
115 const ip_addr_t *src,
const ip_addr_t *dest);
116 u16_t ip_chksum_pseudo_partial(
struct pbuf *p, u8_t proto, u16_t proto_len,
117 u16_t chksum_len,
const ip_addr_t *src,
const ip_addr_t *dest);
u16_t inet_chksum_pbuf(struct pbuf *p)