datapath-windows/ovsext/Offload.c
/*
 *----------------------------------------------------------------------------
 * IPv6PseudoChecksum --
 *
 *  Given IPv6 src and dst address, upper layer protocol and total
 *  upper layer protocol data length including upper layer header
 *  part, calculate the pseudo checksum for upper layer protocol
 *  checksum.
 *
 *  please note this checksum is just 1's complement addition.
 *
 *  Input Parameter:
 *    src:   src IPv6 address in network byte order
 *    dst:   dst IPv6 address.
 *    protocol: upper layer protocol
 *    totalLength: total length of upper layer data. Please note this is
 *         in host byte order.
 *
 *  Result:
 *
 *  Place in upper layer checksum field before calculate upper layer
 *  checksum.
 *----------------------------------------------------------------------------
 */
IPv6PseudoChecksum
Given IPv6 src and dst address, upper layer protocol and total
upper layer protocol data length including upper layer header
part, calculate the pseudo checksum for upper layer protocol
checksum.

please note this checksum is just 1's complement addition.

Input Parameter:
src:   src IPv6 address in network byte order
dst:   dst IPv6 address.
protocol: upper layer protocol
totalLength: total length of upper layer data. Please note this is
in host byte order.



Place in upper layer checksum field before calculate upper layer
checksum.
IPv6PseudoChecksum Given IPv6 src and dst address upper layer protocol and total upper layer protocol data length including upper layer header part calculate the pseudo checksum for upper layer protocol checksum . please note this checksum is just 1 ' s complement addition . Input Parameter : src : src IPv6 address in network byte order dst : dst IPv6 address . protocol : upper layer protocol totalLength : total length of upper layer data . Please note this is in host byte order . Place in upper layer checksum field before calculate upper layer checksum .
UINT16
IPv6PseudoChecksum(UINT32 *src,
                   UINT32 *dst,
                   UINT8 protocol,
                   UINT16 totalLength)
{
    UINT64 sum = (UINT32)htons(totalLength) + htons(protocol);
    sum += (UINT64)src[0] + src[1] + src[2] + src[3];
    sum += (UINT64)dst[0] + dst[1] + dst[2] + dst[3];
    fold64(sum);
    return (UINT16)sum;
}
UINT16 IPv6PseudoChecksum ( UINT32 * src , UINT32 * dst , UINT8 protocol , UINT16 totalLength ) { UINT64 sum = ( UINT32 ) htons ( totalLength ) + htons ( protocol ) ; sum += ( UINT64 ) src [ 0 ] + src [ 1 ] + src [ 2 ] + src [ 3 ] ; sum += ( UINT64 ) dst [ 0 ] + dst [ 1 ] + dst [ 2 ] + dst [ 3 ] ; fold64 ( sum ) ; return ( UINT16 ) sum ; }
IPv6PseudoChecksum
  Given IPv6 src and dst address, upper layer protocol and total
  upper layer protocol data length including upper layer header
  part, calculate the pseudo checksum for upper layer protocol
  checksum.
IPv6PseudoChecksum Given IPv6 src and dst address upper layer protocol and total upper layer protocol data length including upper layer header part calculate the pseudo checksum for upper layer protocol checksum .