Added networking code from Casper Hornstrup
[reactos.git] / reactos / drivers / net / tcpip / include / checksum.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
4 * FILE: include/checksum.h
5 * PURPOSE: Checksum routine definitions
6 */
7 #ifndef __CHECKSUM_H
8 #define __CHECKSUM_H
9
10
11 ULONG ChecksumCompute(
12 PVOID Data,
13 UINT Count,
14 ULONG Seed);
15
16 #define IPv4Checksum(Data, Count, Seed)(ChecksumCompute(Data, Count, Seed))
17
18 /*
19 * Macro to check for a correct checksum
20 * BOOLEAN CorrectChecksum(PVOID Data, UINT Count)
21 */
22 #define CorrectChecksum(Data, Count) \
23 (BOOLEAN)(IPv4Checksum(Data, Count, 0) == DH2N(0x0000FFFF))
24
25 #endif /* __CHECKSUM_H */
26
27 /* EOF */