net_checksum.c File Reference

General CRC and checksum computation implementation. More...

#include <sys/types.h>
#include <net_checksum.h>

Go to the source code of this file.

Defines

#define CRC_DIVIDER_BE   0x04c11db7
 Big-endian encoding CRC divider.
#define CRC_DIVIDER_LE   0xedb88320
 Little-endian encoding CRC divider.

Functions

uint16_t compact_checksum (uint32_t sum)
 Compacts the computed checksum to the 16 bit number adding the carries.
uint32_t compute_checksum (uint32_t seed, uint8_t *data, size_t length)
 Computes sum of the 2 byte fields.
uint32_t compute_crc32_be (uint32_t seed, uint8_t *data, size_t length)
 Computes CRC32 value in the big-endian environment.
uint32_t compute_crc32_le (uint32_t seed, uint8_t *data, size_t length)
 Computes CRC32 value in the little-endian environment.
uint16_t flip_checksum (uint16_t checksum)
 Returns or flips the checksum if zero.
uint16_t ip_checksum (uint8_t *data, size_t length)
 Computes the ip header checksum.


Detailed Description

General CRC and checksum computation implementation.

Definition in file net_checksum.c.


Generated on Thu Jun 2 07:45:53 2011 for HelenOS/USB by  doxygen 1.4.7