checksum.h File Reference

General CRC and checksum computation. More...

#include <byteorder.h>
#include <sys/types.h>
Include dependency graph for checksum.h:
This graph shows which files directly or indirectly include this file:

Defines

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

Functions

uint32_t compute_crc32_le (uint32_t seed, uint8_t *data, size_t length)
 Computes CRC32 value in the little-endian environment.
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_checksum (uint32_t seed, uint8_t *data, size_t length)
 Computes sum of the 2 byte fields.
uint16_t compact_checksum (uint32_t sum)
 Compacts the computed checksum to the 16 bit number adding the carries.
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.


Generated on Thu Mar 11 20:46:01 2010 for Networking and TCP/IP stack for HelenOS system by  doxygen 1.6.1