How explained at http://winpcap.polito.it/docs/dll.htm#PacketSendPacket,
you'll not need to build the MAC CRC, because the lower layers (network
adapter or NIC driver) will calculate it and attach it to the packet for
you.
As for the layers 3 and 4, winpcap doesn't have the concept of these layers,
so I think it's not the right palce where to put this kind of functions.
Note also that other libraries (like if I remember well libnet) provide this
functionality.

Loris

> I have just started using WinPcap (actually, Beesync's PacketX), and boy
am
> I having fun. However, I have come to realize that, to send packets, I
will
> need to calculate at least three checksums for each packet: one at layer
2,
> one at layer 3, and one at layer 4. Calculating these checksums will add
> huge overhead--at least three separate do/while loops per packet
> transmitted. Although the code for checksum calculation is short (about
ten
> lines, I guess), the overhead is still so great that RFC 1071 recommends
> taking advantage of "every machine-specific trick" to optimize
performance.
> As an intermediate VB programmer, such machine-level expertise is
currently
> beyond me, so it would be nice (in the extreme) if such functions were
built
> into WinPCap. It would be great if I could pass WinPcap a pointer to a
byte
> array and have it return a checksum value against the array. Do you think
> you could be convinced to add such functionality into the library?
>
> --
> Eric Robinson
> Network Analyst
> State of Nevada DOT
>
>

Reply via email to