Hello, im trying to use pcap_compile to compile a filter. Unfortunately
somewhere in these two lines

#define BPF_OPTIMIZE 0

<cut some stuff>

pcap_t *capture;
struct bpf_program *compiled_filter;
bpf_u_int32 netmask = 32;
char *INFILE="testdatafile.dat";
char *INFILTER="testfilter.fltr";
char caperr[PCAP_ERRBUF_SIZE];

<cut a bunch more stuff>

capture = pcap_open_offline(INFILE, caperr);
pcap_compile(capture, compiled_filter, INFILTER, BPF_OPTIMIZE, netmask);
pcap_setfilter(capture, compiled_filter);

and here the process core dumps. Any ideas why? im sure it's something
simple, like netmask maybe shouldn't be 32? I assumed that that was to be
the netmask of the network im capturing on, which is 32 bits. Am I mistaken?
If this is a stupid question, sorry, im just getting started working with
using filters with libpcap.

 Thanks!
Brad
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to