tcpdump mailing list archives
Re: System header structs vs custom struct
From: Guy Harris <guy () alum mit edu>
Date: Fri, 13 Jan 2006 19:03:38 -0800
On Jan 13, 2006, at 6:37 PM, SPYRIDON PAPADOPOULOS wrote:
i am creating a packet capture tool on a FreeBSD 5.4 - RELEASE for my dissertation using pcap. I am using the system headers in /usr/ include/net/ and /usr/include/netinet/ directories to start decoding EN10MB, ip, tcp, udp, icmp etc packets. I am not working too long on it am i am not an experienced C programmer. However i lately tried to test the thing on slackware (the OS my project supervisor preferes) and i had many errors mostly about values in system header structures.
And now you know one of the reasons why tcpdump has its own headers for packet data structures.
I was thinking since the beginning that it doesn't worth it to copy more or less the structs from tcpdump to describe protocol headers since i have them already, so i kept staying with the system's headers. Now i am realising that maybe this is a very good reason for changing to custom structures.Any advice
I'd advise you to go to custom structures, so your program isn't as dependent on what the headers on a particular OS define - that's why tcpdump uses *its* own header files.
- This is the tcpdump-workers list. Visit https://lists.sandelman.ca/ to unsubscribe.
Current thread:
- System header structs vs custom struct SPYRIDON PAPADOPOULOS (Jan 13)
- Re: System header structs vs custom struct Guy Harris (Jan 13)