No such thing as a small change | |
PerlMonks |
Re: Re: converting tcpdump filesby Util (Priest) |
on May 01, 2003 at 19:58 UTC ( [id://254792]=note: print w/replies, xml ) | Need Help?? |
The -d option does something different than what botho is asking; it doesn't display the captured data in a different format, it displays the capture program that it writes. The 'capture filter' in tcpdump works by parsing the filter string during startup, and then writing an optimized machine-language filter subroutine which is called for each packet. The -d option shows that subroutine, in assembler language, which is 'human' compared to the raw machine language that -dd or -ddd would show. For example, if I want to capture only TCP packets, ignoring all UDP, ICMP, and non-IP packets, I would use tcpdump tcp . Adding -d and running it, I get: In (pseudo)Perl, that translates to: The -d option is really there for debugging the filter's parser and optimizer. All this explains why Ethereal supports two completely different filter languages. The 'capture' filters are identical (and as efficient) to tcpdump's filters, but the slower non-compiled 'read' filters provide much more power.
In Section
Seekers of Perl Wisdom
|
|