C
WORD CalcIPChecksum( BYTE* buffer, WORD len );
Description
This function calculates an IP checksum over an array of input data. The checksum is the 16-bit one's complement of one's complement sum of all words in the data (with zero-padding if an odd number of bytes are summed). This checksum is defined in RFC 793.
Preconditions
buffer is WORD aligned (even memory address) on 16- and 32-bit PICs.
Parameters
Parameters |
Description |
buffer |
pointer to the data to be checksummed |
count |
number of bytes to be checksummed |
Returns
The calculated checksum.