A version of LWIP, provided for backwards compatibility.

Dependents:   AA_DemoBoard DemoBoard HelloServerDemo DemoBoard_RangeIndicator ... more

Embed: (wiki syntax)

« Back to documentation index

inet_chksum.c File Reference

inet_chksum.c File Reference

Incluse internet checksum functions. More...

Go to the source code of this file.

Functions

static u16_t lwip_standard_chksum (void *dataptr, u16_t len)
 lwip checksum
static u16_t lwip_standard_chksum (void *dataptr, int len)
 An optimized checksum routine.
u16_t inet_chksum_pbuf (struct pbuf *p)
 Calculate a checksum over a chain of pbufs (without pseudo-header, much like inet_chksum only pbufs are used).

Detailed Description

Incluse internet checksum functions.

Definition in file tag/7/Core/lwIP/core/ipv4/inet_chksum.c.


Function Documentation

u16_t inet_chksum_pbuf ( struct pbuf *  p )

Calculate a checksum over a chain of pbufs (without pseudo-header, much like inet_chksum only pbufs are used).

Parameters:
ppbuf chain over that the checksum should be calculated
Returns:
checksum (as u16_t) to be saved directly in the protocol header

Definition at line 408 of file tag/7/Core/lwIP/core/ipv4/inet_chksum.c.

static u16_t lwip_standard_chksum ( void *  dataptr,
u16_t  len 
) [static]

lwip checksum

Parameters:
dataptrpoints to start of data to be summed at any boundary
lenlength of data to be summed
Returns:
host order (!) lwip checksum (non-inverted Internet sum)
Note:
accumulator size limits summable length to 64k
host endianess is irrelevant (p3 RFC1071)

Definition at line 83 of file tag/7/Core/lwIP/core/ipv4/inet_chksum.c.

static u16_t lwip_standard_chksum ( void *  dataptr,
int  len 
) [static]

An optimized checksum routine.

Basically, it uses loop-unrolling on the checksum loop, treating the head and tail bytes specially, whereas the inner loop acts on 8 bytes at a time.

  • start of buffer to be checksummed. May be an odd byte address. number of bytes in the buffer to be checksummed.
    Returns:
    host order (!) lwip checksum (non-inverted Internet sum)
    by Curt McDowell, Broadcom Corp. December 8th, 2005

Definition at line 137 of file tag/7/Core/lwIP/core/ipv4/inet_chksum.c.