3 * Make sure you compile it against the same libpcap version used in OpenWrt
11 #include <linux/types.h>
12 #include <linux/ppp_defs.h>
17 int main (int argc
, char ** argv
)
19 pcap_t
*pc
; /* Fake struct pcap so we can compile expr */
20 struct bpf_program filter
; /* Filter program for link-active pkts */
26 if (!strcmp (argv
[1], "-d"))
28 dflag
= atoi (argv
[2]);
35 printf ("usage; %s [ -d <debug_level> ] expression\n", argv
[0]);
39 pc
= pcap_open_dead(DLT_PPP_PPPD
, PPP_HDRLEN
);
40 if (pcap_compile(pc
, &filter
, argv
[1], 1, netmask
) == 0)
42 printf ("#\n# Expression: %s\n#\n", argv
[1]);
43 bpf_dump (&filter
, dflag
);
48 printf("error in active-filter expression: %s\n", pcap_geterr(pc
));
This page took 0.043217 seconds and 5 git commands to generate.