Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IP/UDP/TCP headers in WpdPack

6 views
Skip to first unread message

lance...@yahoo.com

unread,
Nov 23, 2009, 10:16:05 PM11/23/09
to
Hi all,

I can't seem to find any declarations of the IP/UDP/TCP header
structures in the include files of WpdPack 4.0.2, unlike in Linux
where they are defined in <netinet/tcp.h>, <netinet/udp.h> and
<netinet/ip.h>. I'm trying to use these headers in Visual Studio .NET
2003. Do I have to write my own?

Thank you.

Regards,
Rayne

Jorgen Grahn

unread,
Nov 24, 2009, 6:45:28 AM11/24/09
to
On Tue, 2009-11-24, lance...@yahoo.com wrote:
> Hi all,
>
> I can't seem to find any declarations of the IP/UDP/TCP header
> structures in the include files of WpdPack 4.0.2,

What is WpdPack? I don't feel like googling.

> unlike in Linux
> where they are defined in <netinet/tcp.h>, <netinet/udp.h> and
> <netinet/ip.h>. I'm trying to use these headers in Visual Studio .NET
> 2003. Do I have to write my own?

If I were you, I'd avoid trying to struct-map these things. Read and
write them octet-by-octets instead. Create utility functions for doing
that as appropriate. It's simple, fast and platform-independent.

Those header files are not even common across all Unixes. Not even
across Linux -- depending on what standard you chose to code against
you get some of them, and you might get differently named versions.
Lots of trouble and non-portability for no gain. It's not as if a
struct protects you from changes to the standard IP header format,
either -- the ancient RFCs rule, and will always rule.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

0 new messages