Changeset 3a14f3b for lib/format_pcap.c


Ignore:
Timestamp:
09/14/07 16:05:43 (14 years ago)
Author:
Scott Raynel <smr26@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
a81d2fc
Parents:
4c1302b
Message:

Allow libtrace applications to create filters based on pre-compiled BPF
bytecode as well as filterstrings. See trace_create_filter_from_bytecode()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_pcap.c

    r9bc4689 r3a14f3b  
    104104        }
    105105        if (DATA(libtrace)->filter) {
    106                 pcap_compile(INPUT.pcap, &DATA(libtrace)->filter->filter,
    107                                 DATA(libtrace)->filter->filterstring, 1, 0);
     106                if (DATA(libtrace)->filter->flag == 0) {
     107                        pcap_compile(INPUT.pcap,
     108                                        &DATA(libtrace)->filter->filter,
     109                                        DATA(libtrace)->filter->filterstring,
     110                                        1, 0);
     111                        DATA(libtrace)->filter->flag = 1;
     112                }
    108113                if (pcap_setfilter(INPUT.pcap,&DATA(libtrace)->filter->filter)
    109114                                == -1) {
Note: See TracChangeset for help on using the changeset viewer.