2 * Copyright (c) 2014 VMware, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #define __CHECKSUM_H_ 1
20 typedef union _OVS_PACKET_HDR_INFO *POVS_PACKET_HDR_INFO;
22 UINT16 CalculateChecksum(UINT8 *ptr, UINT16 length, UINT16 initial);
23 UINT16 CopyAndCalculateChecksum(UINT8 *dst, UINT8 *src, UINT16 length,
25 UINT16 IPChecksum(UINT8 *ipHdr, UINT16 length, UINT16 initial);
26 UINT16 IPPseudoChecksum(UINT32 *src, UINT32 *dst, UINT8 protocol,
28 UINT16 IPv6PseudoChecksum(UINT32 *src, UINT32 *dst, UINT8 protocol,
30 UINT16 ChecksumUpdate32(UINT16 oldSum, UINT32 prev, UINT32 newValue);
31 UINT16 ChecksumUpdate16(UINT16 oldSum, UINT16 prev, UINT16 newValue);
32 UINT16 CalculateChecksumNB(const PNET_BUFFER nb, UINT16 csumDataLen,
34 NDIS_STATUS OvsValidateIPChecksum(PNET_BUFFER_LIST curNbl,
35 POVS_PACKET_HDR_INFO hdrInfo);
36 NDIS_STATUS OvsValidateUDPChecksum(PNET_BUFFER_LIST curNbl,
39 #endif /* __CHECKSUM_H_ */