PCAP_SETFILTER(3)
π NAME π
okay so bestie, welcome to PCAP_SETFILTER(3) from the Library Functions Manual β the whole vibe is literally just set the filter. Thatβs it. Thatβs the name. π
β¨ SYNOPSIS β¨
#include <pcap/pcap.h>
int pcap_setfilter(pcap_t *p, struct bpf_program *fp);
π¦ DESCRIPTION π¦
pcap_setfilter() is the function you use to specify a filter program. The fp argument is a pointer to a bpf_program struct, and itβs usually the result of calling pcap_compile(3). iykyk π«Ά
π RETURN VALUE π
pcap_setfilter() returns 0 on success β slay β¨.
It returns PCAP_ERROR_NOT_ACTIVATED if you call it on a capture handle that has been created but not activated. Like, the handle is not ready yet, bestie, no cap.
Or it returns PCAP_ERROR on other errors. If PCAP_ERROR gets returned, you can call pcap_geterr(3) or pcap_perror(3) with p as an argument to fetch or display the error text. Very demure, very helpful. π
π SEE ALSO π
kisses bestie, thatβs the PCAP_SETFILTER(3) page from the Library Functions Manual, dated 5 March 2022 ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 1994, 1996, 1997 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms