next up previous contents index
Next: Strings to Hosts Up: Utility Routines Previous: Byte Order: ntohs

Checksum

 

inCkSum

 

Calculates a 16-bit 1's complement checksum over buffer (of length length) and message, returning the bit complement of the sum. length should be even and the buffer must be aligned on a 16-bit boundary. length may be zero.

u_short inCkSum(Msg *message, u_short *buffer, int length)

ocsum

 

Returns the 1's complement sum of the count 16-bit words pointed to by hdr, which must be aligned on a 16-bit boundary.

u_short ocsum(u_short *hdr, int count)



Larry Peterson
Tue Jul 1 14:50:34 MST 1997