void CalculateCheckSum(
void *iphdr,
struct udphdr *udphdr,
char *payload,
int payloadlen)
{
struct iphdr *v4hdr=NULL;
unsigned long zero=0;
char buf[1000],
*ptr=NULL;
int chksumlen=0,
i;
ptr = buf;
v4hdr = (struct iphdr *)iphdr;
// Include the source and destination IP addresses
memcpy(ptr, &v4hdr->saddr, sizeof(v4hdr->saddr));
ptr += sizeof(v4hdr->saddr);
chksumlen += sizeof(v4hdr->saddr);