

Size_t len = unDataLen - CommonHelper::DATAGRAME_DATA_OFFSET // 42 is the Ethernet header
PD16 = reinterpret_casthandle data lenght, from IP layer to udp data layer
PD8 = reinterpret_castUnChecksum += _byteswap_ushort(*pD16++) // since wireshark file is big-endian, but c++ in PC is little-endian
PD16 = reinterpret_castHere is what I do for the UDP checksum: void ReCalculateCheckSum_UDP_Pkt(u_char* pData, unsigned int unDataLen) Memcpy((char*)(pData + 24), &un16TempChecksum, sizeof(uint16_t)) Un16TempChecksum = _byteswap_ushort(un16TempChecksum)
Uint16_t un16TempChecksum = static_castUnChecksum = (unChecksum & 0xffff) + (unChecksum > 16)
PD16 = reinterpret_castHere is what I do for IP Header checksum: void ReCalculateCheckSum_IPHeader(u_char* pData) I have tried to search on the web but what I found is the check sum calculation for the whole UDP packet which seems not the same checksum that I am asking for on the above.

I have a udp packet captured through multicast channel and I found that there is a Header checksum under Internet Protocol Version 4.
