tcpdump mailing list archives
Re: loopback interface and byte order
From: Robert Lowe <Robert.H.Lowe () lawrence edu>
Date: Fri, 03 Dec 2004 13:18:49 -0600
Guy Harris wrote:
This leads me to another question. I've seen recommendations to roll your own structs for IP/TCP headers, hinting that there might be slight differencesin the definitions between platforms. Is this really true?Yes. For example, if I remember correctly, not all platforms' "struct ip" represent the "header length and version" field in the same way - some have bitfields and some have a single field for the header length and version and macros to extract the header length and version from it.That's why tcpdump has its own headers.
Thanks again for all the terrific information. I looked over the headers included with tcpdump. I think I'll use somewhat modified versions of those. In particular, I didn't traceback how u_int8_t gets defined, which seems to appear naturally on some systems, but not on others. I think instead I'll rely on an autoconf macro, ac_create_stdint_h, to make a header file for me and use uint8_t, for example, instead. Reasonable? Is there a better approach? -Robert - This is the tcpdump-workers list. Visit https://lists.sandelman.ca/ to unsubscribe.
Current thread:
- loopback interface and byte order Robert Lowe (Dec 01)
- Re: loopback interface and byte order Guy Harris (Dec 01)
- Re: loopback interface and byte order Robert Lowe (Dec 02)
- Re: loopback interface and byte order Guy Harris (Dec 02)
- Re: loopback interface and byte order Robert Lowe (Dec 03)
- Re: loopback interface and byte order Robert Lowe (Dec 02)
- Re: loopback interface and byte order Guy Harris (Dec 01)