]> git.proxmox.com Git - mirror_ovs.git/blob - datapath-windows/ovsext/Offload.h
datapath-windows: Account for VLAN tag in tunnel Decap
[mirror_ovs.git] / datapath-windows / ovsext / Offload.h
1 /*
2 * Copyright (c) 2014, 2016 VMware, Inc.
3 *
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:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17 #ifndef __OFFLOAD_H_
18 #define __OFFLOAD_H_ 1
19
20 typedef union _OVS_PACKET_HDR_INFO *POVS_PACKET_HDR_INFO;
21
22 UINT16 CalculateChecksum(UINT8 *ptr, UINT16 length, UINT16 initial);
23 UINT16 CopyAndCalculateChecksum(UINT8 *dst, UINT8 *src, UINT16 length,
24 UINT16 initial);
25 UINT16 IPChecksum(UINT8 *ipHdr, UINT16 length, UINT16 initial);
26 UINT16 IPPseudoChecksum(UINT32 *src, UINT32 *dst, UINT8 protocol,
27 UINT16 totalLength);
28 UINT16 IPv6PseudoChecksum(UINT32 *src, UINT32 *dst, UINT8 protocol,
29 UINT16 totalLength);
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,
33 UINT32 offset);
34 NDIS_STATUS OvsValidateIPChecksum(PNET_BUFFER_LIST curNbl,
35 POVS_PACKET_HDR_INFO hdrInfo);
36 NDIS_STATUS OvsValidateUDPChecksum(PNET_BUFFER_LIST curNbl,
37 BOOLEAN udpCsumZero);
38 NDIS_STATUS OvsCalculateUDPChecksum(PNET_BUFFER_LIST curNbl,
39 PNET_BUFFER curNb,
40 IPHdr *ipHdr,
41 UDPHdr *udpHdr,
42 UINT32 packetLength,
43 POVS_PACKET_HDR_INFO layers);
44
45 ULONG OVSGetTcpMSS(PNET_BUFFER_LIST nbl);
46
47 NDIS_STATUS OvsApplySWChecksumOnNB(POVS_PACKET_HDR_INFO layers,
48 PNET_BUFFER_LIST nbl,
49 PNDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO
50 csumInfo);
51
52 #endif /* __OFFLOAD_H_ */