20 const unsigned char *
buff,
30#define IPv4Checksum(Data, Count, Seed)(~ChecksumFold(ChecksumCompute(Data, Count, Seed)))
31#define TCPv4Checksum(Data, Count, Seed)(~ChecksumFold(csum_partial(Data, Count, Seed)))
38#define IPv4CorrectChecksum(Data, Count) \
39 (BOOLEAN)(IPv4Checksum(Data, Count, 0) == DH2N(0x0000FFFF))
46#define TCPv4CorrectChecksum(TcpPseudoHeader, Data, Count) \
47 (BOOLEAN)(TCPv4Checksum(Data, Count, \
48 TCPv4Checksum(TcpPseudoHeader, sizeof(TCPv4_PSEUDO_HEADER), \
49 0)) == DH2N(0x0000FFFF))
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum)
ULONG ChecksumCompute(PVOID Data, UINT Count, ULONG Seed)
ULONG UDPv4ChecksumCalculate(PIPv4_HEADER IPHeader, PUCHAR PacketBuffer, ULONG DataLength)
ULONG ChecksumFold(ULONG Sum)
static unsigned char buff[32768]
static int sum(int x_, int y_)