Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4721 → Rev 4722

/branches/network/uspace/srv/net/include/crc.h
84,10 → 84,17
*/
uint16_t compact_checksum( uint32_t sum );
 
/** Returns or flips the checksum if zero.
* @param checksum The computed checksum. Input parameter.
* @returns The internet protocol header checksum.
* @returns 0xFFFF if the computed checksum is zero.
*/
uint16_t flip_checksum( uint16_t checksum );
 
/** Computes the ip header checksum.
* To compute the checksum of a new packet, the checksum header field must be zero.
* To check the checksum of a received packet, the checksum may be left set.
* The zero (0) value will returned in this case if valid.
* The zero (0) value will be returned in this case if valid.
* @param data The header data. Input parameter.
* @param length The header length in bytes. Input parameter.
* @returns The internet protocol header checksum.