tcpdump mailing list archives

Re: non-recursive BPF code generator


From: Guy Harris <guy () netapp com>
Date: Tue, 11 Mar 2003 16:52:19 -0800

On Sat, Mar 08, 2003 at 09:25:48PM -0500, Lin Ge wrote:
Is there anybody know how to convert the recursive algorithm to 
non-recursive algorithm in the count_stmts() and convert_code_r() in the 
optimize.c file.

I haven't looked at whether it can be converted, and don't have any time
to do so.

However:

In the embedded programming, the stack is not big enough so 
that the system might overflow the stack when it dealt with huge filter 
rule.

If your *particular* embedded system has small stacks (not all do - some
might run a general-purpose OS such as a Linux-based system or some
version of BSD or embedded Windows), then:

        if the embedded device has to be able to handle arbitrary filter
        expressions - i.e., if you're compiling filter expressions
        supplied to the embedded device - perhaps the right answer is to
        do *all* the compiling on whatever front-end machine supplies
        the filter expression to the embedded device, and just have it
        supply a BPF program to the embedded device;

        if the embedded device has filter expressions built in, perhaps
        the right answer is to compile them when the software on the
        device is built, and build the BPF program into the software.
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: