tcpdump mailing list archives
Re: where is CFG generated?
From: Guy Harris <guy () alum mit edu>
Date: Tue, 12 Sep 2006 23:15:02 -0700
Hui.Ning () utstar com wrote:
For tcpdump, I am trying to find out where is CFG ( call flow graph structure, which is used for further optimization ) generated? during parsing stage or after the parsing stage?
*Currently*, the CFG is generated by pcap_parse() (and by a call to gen_retblk()), which means it's generated during the parsing stage. See pcap_compile() in gencode.c.
(This is in libpcap, not tcpdump. Tcpdump has no code to parse a filter and generate a CFG or generate BPF code from that; it calls libpcap to do that (as do many other applications).)
This is *NOT* guaranteed to remain true forever. The CFG might, in the future, be generated elsewhere; there might, for example, be a split between the parser and the code generator.
Why do you need to know where it's done? (As I indicated, it's not necessarily going to be done in the same place forever. You shouldn't write code that assumes pcap_compile() works in a particular fashion.)
- This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- where is CFG generated? Hui . Ning (Sep 11)
- Re: where is CFG generated? Guy Harris (Sep 12)