net_checksum.h File Reference

General CRC and checksum computation. More...

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

Go to the source code of this file.

Defines

#define compute_crc32(seed, data, length)   compute_crc32_le(seed, (uint8_t *) data, length)
#define IP_CHECKSUM_ZERO   0xffffU
 IP checksum value for computed zero checksum.

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.

Definition in file net_checksum.h.


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