1PCAP_SETFILTER(3PCAP)                                    PCAP_SETFILTER(3PCAP)
2
3
4

NAME

6       pcap_setfilter - set the filter
7

SYNOPSIS

9       #include <pcap/pcap.h>
10
11       int pcap_setfilter(pcap_t *p, struct bpf_program *fp);
12

DESCRIPTION

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
16       pcap_compile(3PCAP).
17

RETURN VALUE

19       pcap_setfilter()  returns  0  on  success,  PCAP_ERROR_NOT_ACTIVATED if
20       called on a capture handle that has been created but not activated,  or
21       PCAP_ERROR    on    other   errors.    If   PCAP_ERROR   is   returned,
22       pcap_geterr(3PCAP) or pcap_perror(3PCAP) may be called with p as an ar‐
23       gument to fetch or display the error text.
24

SEE ALSO

26       pcap(3PCAP)
27
28
29
30                                 5 March 2022            PCAP_SETFILTER(3PCAP)
Impressum