Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: LwIPNetworking NetServicesMin EthernetInterface EthernetInterface_RSF ... more
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).   | |
| u16_t | lwip_chksum_copy (void *dst, const void *src, u16_t len) | 
| Safe but slow: first call MEMCPY, then call LWIP_CHKSUM.   | |
Detailed Description
Incluse internet checksum functions.
Definition in file 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:
 - 
  
p pbuf chain over that the checksum should be calculated  
- Returns:
 - checksum (as u16_t) to be saved directly in the protocol header
 
Definition at line 409 of file inet_chksum.c.
| u16_t lwip_chksum_copy | ( | void * | dst, | 
| const void * | src, | ||
| u16_t | len | ||
| ) | 
Safe but slow: first call MEMCPY, then call LWIP_CHKSUM.
For architectures with big caches, data might still be in cache when generating the checksum after copying.
Definition at line 445 of file 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)
 
 
Definition at line 135 of file inet_chksum.c.
| static u16_t lwip_standard_chksum | ( | void * | dataptr, | 
| u16_t | len | ||
| ) |  [static] | 
        
lwip checksum
- Parameters:
 - 
  
dataptr points to start of data to be summed at any boundary len length 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 81 of file inet_chksum.c.
Generated on Tue Jul 12 2022 17:31:05 by
 1.7.2