On Wed, 25 Jul 2001, Guy Harris wrote:
> ...as long as you account for the fact that not only are there systems
> that don't define "PACKET_STATISTICS", there are also systems that
> define it but that *don't* declare "struct tpacket_stats" - at least if
> you use <netpacket/packet.h>, rather than <linux/if_packet.h>, to get
> that stuff defined.
>
This was the trickiest part due to <netpacket/packet.h> only half defining
whats in <linux/if_packet.h>. I have my modifications compiling on
Linux 2.4.x and 2.2.x (with the capability being obviously absent in
2.2.x) machines cleanly and both work. I do not have access to a 2.0.x
machine so I don't know if I broke anything there. I ended up adding a
test to the aclocal that checks for "struct tpacket_stats" and if its
there it will use only <linux/if_packet.h>. I've got a few tweaks to make
and I'll submit the patch against the CVS code to patches@ for review.
>
> Personally, I'd vote for just saying "screw <netpacket/packet.h>" and
> using <linux/if_packet.h> - after all, "pcap-linux.c", as the name
> suggests, *is* Linux-specific, so it's not as if you have to worry about
> portability to non-Linux platforms using glibc.
>
I thought this very same thing while trying to make this compile cleanly
on 2.2.x and 2.4.x. Shall I go through and clean this up and remove the
<netpacket/packet.h> dependancies? Are there any kernal/glibc
combinations where it is necessary?
> Long term, I'd like to see "pcap_stats()" replaced by something better.
Something self describing would be interesting. I haven't given this any
thought yet but as a multi-platform pcap user this would be a nice
feature. I'll get back to the list on this.
Thanks,
Scott
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe