PCAP_OFFLINE_FILTER(3)
π pcap_offline_filter β bestie, does this packet match the filter or not?? π
okay so bestie, welcome to pcap_offline_filter(3) from the Library Functions Manual β this is the function you call when you literally just wanna know if a packet vibes with your filter. no cap. β¨
πΈ NAME πΈ
pcap_offline_filter β check whether a filter matches a packet π
π¦ SYNOPSIS π¦
#include <pcap/pcap.h>
int pcap_offline_filter(const struct bpf_program *fp,
const struct pcap_pkthdr *h, const u_char *pkt);
π DESCRIPTION π
okay so like, pcap_offline_filter() checks whether a filter matches a packet. that's the whole vibe. π«Ά
fpβ pointer to abpf_programstruct, usually the result of a call topcap_compile(3). it's giving "i was compiled just for this" energy πhβ points to thepcap_pkthdrstructure for the packet πpktβ points to the data in the packet, like the actual packet payload bestie π
π₯ RETURN VALUE π₯
pcap_offline_filter() returns the return value of the filter program, periodt. π
- zero β the packet doesn't match the filter π
- non-zero β the packet matches the filter π
literally that simple, no plot twist. β
π SEE ALSO π
pcap(3)β the main character of this whole ecosystem π
mwah β this lil page is from 7 April 2014, brought to you by the PCAP_OFFLINE_FILTER(3) manual, part of the Library Functions Manual. go forth and filter, bestie πβ¨
π¦ 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