1PCAP_SETFILTER(3PCAP) PCAP_SETFILTER(3PCAP)
2
3
4
6 pcap_setfilter - set the filter
7
9 #include <pcap/pcap.h>
10
11 int pcap_setfilter(pcap_t *p, struct bpf_program *fp);
12
14 pcap_setfilter() is used to specify a filter program. fp is a pointer
15 to a bpf_program struct, usually the result of a call to pcap_com‐
16 pile().
17
19 pcap_setfilter() returns 0 on success and -1 on failure. If -1 is
20 returned, pcap_geterr() or pcap_perror() may be called with p as an
21 argument to fetch or display the error text.
22
24 pcap(3PCAP), pcap_compile(3PCAP), pcap_geterr(3PCAP)
25
26
27
28 5 April 2008 PCAP_SETFILTER(3PCAP)