57# define LWIP_CHKSUM lwip_standard_chksum
58# ifndef LWIP_CHKSUM_ALGORITHM
59# define LWIP_CHKSUM_ALGORITHM 2
64#ifndef LWIP_CHKSUM_ALGORITHM
65# define LWIP_CHKSUM_ALGORITHM 0
68#if (LWIP_CHKSUM_ALGORITHM == 1)
92 src = (*octetptr) << 8;
102 src = (*octetptr) << 8;
106 acc = (acc >> 16) + (acc & 0x0000ffffUL);
107 if ((acc & 0xffff0000UL) != 0) {
108 acc = (acc >> 16) + (acc & 0x0000ffffUL);
117#if (LWIP_CHKSUM_ALGORITHM == 2)
143 ((
u8_t *)&
t)[1] = *pb++;
148 ps = (
const u16_t *)(
const void *)pb;
176#if (LWIP_CHKSUM_ALGORITHM == 3)
200 ((
u8_t *)&
t)[1] = *pb++;
204 ps = (
const u16_t *)(
const void *)pb;
211 pl = (
const u32_t *)(
const void *)ps;
230 ps = (
const u16_t *)pl;
268 (
void *)
q, (
void *)
q->next));
274 if (
q->len % 2 != 0) {
293 return (
u16_t)~(acc & 0xffffUL);
311 const ip4_addr_t *
src,
const ip4_addr_t *
dest)
317 acc = (
addr & 0xffffUL);
318 acc = (
u32_t)(acc + ((
addr >> 16) & 0xffffUL));
321 acc = (
u32_t)(acc + ((
addr >> 16) & 0xffffUL));
344 const ip6_addr_t *
src,
const ip6_addr_t *
dest)
350 for (addr_part = 0; addr_part < 4; addr_part++) {
353 acc = (
u32_t)(acc + ((
addr >> 16) & 0xffffUL));
356 acc = (
u32_t)(acc + ((
addr >> 16) & 0xffffUL));
387#if LWIP_IPV4 && LWIP_IPV6
392 return inet_chksum_pseudo(
p,
proto, proto_len, ip_2_ip4(
src), ip_2_ip4(
dest));
407 for (
q =
p; (
q !=
NULL) && (chksum_len > 0);
q =
q->next) {
409 (
void *)
q, (
void *)
q->next));
411 if (chklen > chksum_len) {
415 chksum_len = (
u16_t)(chksum_len - chklen);
420 if (
q->len % 2 != 0) {
439 return (
u16_t)~(acc & 0xffffUL);
457 u16_t chksum_len,
const ip4_addr_t *
src,
const ip4_addr_t *
dest)
463 acc = (
addr & 0xffffUL);
464 acc = (
u32_t)(acc + ((
addr >> 16) & 0xffffUL));
467 acc = (
u32_t)(acc + ((
addr >> 16) & 0xffffUL));
492 u16_t chksum_len,
const ip6_addr_t *
src,
const ip6_addr_t *
dest)
498 for (addr_part = 0; addr_part < 4; addr_part++) {
501 acc = (
u32_t)(acc + ((
addr >> 16) & 0xffffUL));
504 acc = (
u32_t)(acc + ((
addr >> 16) & 0xffffUL));
534#if LWIP_IPV4 && LWIP_IPV6
539 return inet_chksum_pseudo_partial(
p,
proto, proto_len, chksum_len, ip_2_ip4(
src), ip_2_ip4(
dest));
578 if (
q->len % 2 != 0) {
587 return (
u16_t)~(acc & 0xffffUL);
597#if (LWIP_CHKSUM_COPY_ALGORITHM == 1)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define LWIP_DEBUGF(debug, message)
#define LWIP_ASSERT(message, assertion)
GLdouble GLdouble GLdouble GLdouble q
GLenum const GLvoid * addr
u16_t inet_chksum(const void *dataptr, u16_t len)
u16_t lwip_standard_chksum(const void *dataptr, int len)
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 inet_chksum_pbuf(struct pbuf *p)
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)
static u16_t inet_cksum_pseudo_partial_base(struct pbuf *p, u8_t proto, u16_t proto_len, u16_t chksum_len, u32_t acc)
static u16_t inet_cksum_pseudo_base(struct pbuf *p, u8_t proto, u16_t proto_len, u32_t acc)
#define SWAP_BYTES_IN_WORD(w)
int const JOCTET * dataptr
#define MEMCPY(DST, SRC, BYTES)
static int sum(int x_, int y_)