cnet v3.1.4

home
FAQ

cmdline options
topology files
attributes

datatypes
data structures
core API
support API

download/install

cnet's Application Programming Interface

NAME
CRC and checksum functions

SYNOPSIS
#include <cnet.h>

int32_t CNET_IP_checksum(unsigned short *addr, size_t nbytes);

uint16_t CNET_ccitt(unsigned char *addr, size_t nbytes);

uint16_t CNET_crc16(unsigned char *addr, size_t nbytes);

uint32_t CNET_crc32(unsigned char *addr, size_t nbytes);

DESCRIPTION
These four functions each take a memory address and perform the requested checksum (iff CNET_IP_checksum()) or CRC (the other three) calculation on the indicated number of bytes starting from that address.

CNET_IP_checksum() calculates the standard Internet checksum, as defined in RFC-1071.

RETURN VALUE
The value returned will be the requested CRC or checksum of the indicated block of memory. No error detection is performed on the arguments.

cnet was written and is maintained by Chris McDonald (chris@csse.uwa.edu.au).

cnet development has been supported by an ACM-SIGCSE Special Project Grant, and an Australian Apple University Consortium Scholarship.