- memcpy(&hdr->Options[0], Data, Length);
- hdr->Version = 4;
- hdr->HeaderLength = sizeof(tIPv4Header)/4;
- hdr->DiffServices = 0; // TODO: Check
-
- hdr->Reserved = 0;
- hdr->DontFragment = 0;
- hdr->MoreFragments = 0;
- hdr->FragOffLow = 0;
- hdr->FragOffHi = 0;
-
- hdr->TotalLength = htons( bufSize );
- hdr->Identifcation = htons( ID ); // TODO: Check
- hdr->TTL = DEFAULT_TTL;
- hdr->Protocol = Protocol;
- hdr->HeaderChecksum = 0; // Will be set later
- hdr->Source = *(tIPv4*)Iface->Address;
- hdr->Destination = Address;
- hdr->HeaderChecksum = htons( IPv4_Checksum(hdr, sizeof(tIPv4Header)) );