Blame pcap_setfilter.3pcap

Packit Service c0f7c7
.\" Copyright (c) 1994, 1996, 1997
Packit Service c0f7c7
.\"	The Regents of the University of California.  All rights reserved.
Packit Service c0f7c7
.\"
Packit Service c0f7c7
.\" Redistribution and use in source and binary forms, with or without
Packit Service c0f7c7
.\" modification, are permitted provided that: (1) source code distributions
Packit Service c0f7c7
.\" retain the above copyright notice and this paragraph in its entirety, (2)
Packit Service c0f7c7
.\" distributions including binary code include the above copyright notice and
Packit Service c0f7c7
.\" this paragraph in its entirety in the documentation or other materials
Packit Service c0f7c7
.\" provided with the distribution, and (3) all advertising materials mentioning
Packit Service c0f7c7
.\" features or use of this software display the following acknowledgement:
Packit Service c0f7c7
.\" ``This product includes software developed by the University of California,
Packit Service c0f7c7
.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
Packit Service c0f7c7
.\" the University nor the names of its contributors may be used to endorse
Packit Service c0f7c7
.\" or promote products derived from this software without specific prior
Packit Service c0f7c7
.\" written permission.
Packit Service c0f7c7
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
Packit Service c0f7c7
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
Packit Service c0f7c7
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Packit Service c0f7c7
.\"
Packit Service c0f7c7
.TH PCAP_SETFILTER 3PCAP "25 July 2018"
Packit Service c0f7c7
.SH NAME
Packit Service c0f7c7
pcap_setfilter \- set the filter
Packit Service c0f7c7
.SH SYNOPSIS
Packit Service c0f7c7
.nf
Packit Service c0f7c7
.ft B
Packit Service c0f7c7
#include <pcap/pcap.h>
Packit Service c0f7c7
.ft
Packit Service c0f7c7
.LP
Packit Service c0f7c7
.ft B
Packit Service c0f7c7
int pcap_setfilter(pcap_t *p, struct bpf_program *fp);
Packit Service c0f7c7
.ft
Packit Service c0f7c7
.fi
Packit Service c0f7c7
.SH DESCRIPTION
Packit Service c0f7c7
.B pcap_setfilter()
Packit Service c0f7c7
is used to specify a filter program.
Packit Service c0f7c7
.I fp
Packit Service c0f7c7
is a pointer to a
Packit Service c0f7c7
.I bpf_program
Packit Service c0f7c7
struct, usually the result of a call to
Packit Service c0f7c7
.BR \%pcap_compile(3PCAP) .
Packit Service c0f7c7
.SH RETURN VALUE
Packit Service c0f7c7
.B pcap_setfilter()
Packit Service c0f7c7
returns 0 on success and
Packit Service c0f7c7
.B PCAP_ERROR
Packit Service c0f7c7
on failure. If
Packit Service c0f7c7
.B PCAP_ERROR
Packit Service c0f7c7
is returned,
Packit Service c0f7c7
.B pcap_geterr(3PCAP)
Packit Service c0f7c7
or
Packit Service c0f7c7
.B pcap_perror(3PCAP)
Packit Service c0f7c7
may be called with
Packit Service c0f7c7
.I p
Packit Service c0f7c7
as an argument to fetch or display the error text.
Packit Service c0f7c7
.SH SEE ALSO
Packit Service c0f7c7
pcap(3PCAP)