Compute CRC cheksum used in IP protocol

Category:
Network/Internet
Type:
Modules
Difficulty:
Intermediate
Author:
Nicco

Version Compatibility: Visual Basic 6

More information:
This function computes the checksum used in IP, ARP..., ie the "The 16 bit one's complement of the one 's complement sum of all 16 bit words" as seen in RFCs. Returns a 4 characters hexadecimal string.

To use it with a IP header, replace the CRC value with zeros, calculate the ckecksum, then replace it in the header. If everything's OK, you should have a CRC of 0 or FFFF when calculating it on the complete IP header (with checksum OK).

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: