37 #ifndef LWIP_HDR_INET_CHKSUM_H
38 #define LWIP_HDR_INET_CHKSUM_H
46 #ifndef SWAP_BYTES_IN_WORD
47 #define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8)
52 #define FOLD_U32T(u) ((u32_t)(((u) >> 16) + ((u) & 0x0000ffffUL)))
55 #if LWIP_CHECKSUM_ON_COPY
58 # ifndef LWIP_CHKSUM_COPY
59 # define LWIP_CHKSUM_COPY(dst, src, len) lwip_chksum_copy(dst, src, len)
60 # ifndef LWIP_CHKSUM_COPY_ALGORITHM
61 # define LWIP_CHKSUM_COPY_ALGORITHM 1
64 # define LWIP_CHKSUM_COPY_ALGORITHM 0
67 # define LWIP_CHKSUM_COPY_ALGORITHM 0
76 #if LWIP_CHKSUM_COPY_ALGORITHM
77 u16_t lwip_chksum_copy(
void *dst,
const void *src,
u16_t len);
82 const ip4_addr_t *src,
const ip4_addr_t *dest);
84 u16_t proto_len,
u16_t chksum_len,
const ip4_addr_t *src,
const ip4_addr_t *dest);
89 const ip6_addr_t *src,
const ip6_addr_t *dest);
91 u16_t chksum_len,
const ip6_addr_t *src,
const ip6_addr_t *dest);
uint8_t u8_t
Definition: arch.h:125
uint16_t u16_t
Definition: arch.h:127
u16_t inet_chksum(const void *dataptr, u16_t len)
Definition: inet_chksum.c:555
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)
Definition: inet_chksum.c:379
u16_t inet_chksum_pbuf(struct pbuf *p)
Definition: inet_chksum.c:568
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)
Definition: inet_chksum.c:526
ip6_addr_t ip_addr_t
Definition: ip_addr.h:318