59# define LWIP_CHKSUM lwip_standard_chksum
60# ifndef LWIP_CHKSUM_ALGORITHM
61# define LWIP_CHKSUM_ALGORITHM 2
65#ifndef LWIP_CHKSUM_ALGORITHM
66# define LWIP_CHKSUM_ALGORITHM 0
69#if (LWIP_CHKSUM_ALGORITHM == 1)
93 src = (*octetptr) << 8;
103 src = (*octetptr) << 8;
107 acc = (acc >> 16) + (acc & 0x0000ffffUL);
108 if ((acc & 0xffff0000UL) != 0) {
109 acc = (acc >> 16) + (acc & 0x0000ffffUL);
118#if (LWIP_CHKSUM_ALGORITHM == 2)
144 ((
u8_t *)&
t)[1] = *pb++;
149 ps = (
u16_t *)(
void *)pb;
177#if (LWIP_CHKSUM_ALGORITHM == 3)
201 ((
u8_t *)&
t)[1] = *pb++;
286 (
void *)
q, (
void *)
q->next));
292 if (
q->len % 2 != 0) {
293 swapped = 1 - swapped;
303 acc += (
addr & 0xffffUL);
304 acc += ((
addr >> 16) & 0xffffUL);
306 acc += (
addr & 0xffffUL);
307 acc += ((
addr >> 16) & 0xffffUL);
316 return (
u16_t)~(acc & 0xffffUL);
345 for(
q =
p; (
q !=
NULL) && (chksum_len > 0);
q =
q->next) {
347 (
void *)
q, (
void *)
q->next));
349 if (chklen > chksum_len) {
353 chksum_len -= chklen;
358 if (
q->len % 2 != 0) {
359 swapped = 1 - swapped;
369 acc += (
addr & 0xffffUL);
370 acc += ((
addr >> 16) & 0xffffUL);
372 acc += (
addr & 0xffffUL);
373 acc += ((
addr >> 16) & 0xffffUL);
382 return (
u16_t)~(acc & 0xffffUL);
420 if (
q->len % 2 != 0) {
421 swapped = 1 - swapped;
429 return (
u16_t)~(acc & 0xffffUL);
439#if (LWIP_CHKSUM_COPY_ALGORITHM == 1)
#define LWIP_DEBUGF(debug, message)
#define LWIP_ASSERT(message, assertion)
GLdouble GLdouble GLdouble GLdouble q
GLenum const GLvoid * addr
u16_t inet_chksum_pseudo(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, u8_t proto, u16_t proto_len)
static u16_t lwip_standard_chksum(void *dataptr, int len)
u16_t inet_chksum(void *dataptr, u16_t 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)
u16_t inet_chksum_pbuf(struct pbuf *p)
#define SWAP_BYTES_IN_WORD(w)
typedefPACK_STRUCT_END struct ip_addr ip_addr_t
#define ip4_addr_get_u32(src_ipaddr)
int const JOCTET * dataptr
#define MEMCPY(DST, SRC, BYTES)
static int sum(int x_, int y_)