Re: [tcpdump-workers] Protocol headers-only capture?

2008-12-17 Thread Dustin Spicuzza
Guy Harris wrote: > > On Dec 17, 2008, at 2:30 PM, Dustin Spicuzza wrote: > >> Speaking of which, is there something in tcpdump that can figure out how >> long the header is... I see that the printers figure out this >> information, but its not done separately as far as I can see. > > No, it's n

Re: [tcpdump-workers] Protocol headers-only capture?

2008-12-17 Thread Guy Harris
On Dec 17, 2008, at 2:30 PM, Dustin Spicuzza wrote: Speaking of which, is there something in tcpdump that can figure out how long the header is... I see that the printers figure out this information, but its not done separately as far as I can see. No, it's not. If you could have the vario

Re: [tcpdump-workers] Protocol headers-only capture?

2008-12-17 Thread Dustin Spicuzza
Guy Harris wrote: > > On Dec 17, 2008, at 12:18 PM, Matthew Luckie wrote: > >> could -s become a parameter that takes words as well as numbers, and >> have the compiler return the appropriate number of bytes in each >> case?. so -s udphdr -s tcphdr would return 14 + 20 + 8 for UDP >> packets on

Re: [tcpdump-workers] Protocol headers-only capture?

2008-12-17 Thread Dustin Spicuzza
Guy Harris wrote: > > On Dec 17, 2008, at 12:43 PM, Dustin Spicuzza wrote: > >> ... as long as you trust that the header >> values are ok (making sure that they stay in the bounds of the actual >> packet size). > > Don't do that. Check against the incoming caplen, and check the sanity > of leng

Re: [tcpdump-workers] Protocol headers-only capture?

2008-12-17 Thread Guy Harris
On Dec 17, 2008, at 12:43 PM, Dustin Spicuzza wrote: ... as long as you trust that the header values are ok (making sure that they stay in the bounds of the actual packet size). Don't do that. Check against the incoming caplen, and check the sanity of length fields. - This is the tcpdump-

Re: [tcpdump-workers] Protocol headers-only capture?

2008-12-17 Thread Guy Harris
On Dec 17, 2008, at 12:18 PM, Matthew Luckie wrote: could -s become a parameter that takes words as well as numbers, and have the compiler return the appropriate number of bytes in each case?. so -s udphdr -s tcphdr would return 14 + 20 + 8 for UDP packets on ethernet, Not all link laye

Re: [tcpdump-workers] Protocol headers-only capture?

2008-12-17 Thread Dustin Spicuzza
Matthew Luckie wrote: > Guy Harris wrote: > > could -s become a parameter that takes words as well as numbers, and > have the compiler return the appropriate number of bytes in each case?. > so -s udphdr -s tcphdr would return 14 + 20 + 8 for UDP packets on > ethernet, and tcphdr would return 14

Re: [tcpdump-workers] Protocol headers-only capture?

2008-12-17 Thread Matthew Luckie
Guy Harris wrote: On Dec 17, 2008, at 11:10 AM, Dustin Spicuzza wrote: Is there currently a way to save protocol headers (and by this, I mean ARP/IP/TCP/UDP/ICMP headers) to a file *without* the remaining payload? There's no way to do *exactly* that. You can, however, specify a snapshot len

Re: [tcpdump-workers] Protocol headers-only capture?

2008-12-17 Thread Guy Harris
On Dec 17, 2008, at 11:10 AM, Dustin Spicuzza wrote: Is there currently a way to save protocol headers (and by this, I mean ARP/IP/TCP/UDP/ICMP headers) to a file *without* the remaining payload? There's no way to do *exactly* that. You can, however, specify a snapshot length with "-s" tha

[tcpdump-workers] Protocol headers-only capture?

2008-12-17 Thread Dustin Spicuzza
Hey, Is there currently a way to save protocol headers (and by this, I mean ARP/IP/TCP/UDP/ICMP headers) to a file *without* the remaining payload? If not, I could be motivated to write a patch to do this (it doesn't seem like it would be that hard?) if someone just points me to the right area