/* Given a BPF program, a pcap_pkthdr structure for a packet, and the raw data for the packet, check whether the packet passes the filter. Returns the return value of the filter program, which will be zero if the packet doesn't pass and non-zero if the packet does pass.  */
int pcap_offline_filter(const struct bpf_program *fp, const struct pcap_pkthdr *h, const u_char *pkt)
/* Given a BPF program, a pcap_pkthdr structure for a packet, and the raw data for the packet, check whether the packet passes the filter. Returns the return value of the filter program, which will be zero if the packet doesn't pass and non-zero if the packet does pass.  */
int pcap_offline_filter(const struct bpf_program *fp, const struct pcap_pkthdr *h, const u_char *pkt)
{
	const struct bpf_insn *fcode = fp->bf_insns;
	if (fcode != NULL)
		return (bpf_filter(fcode, pkt, h->len, h->caplen));
	else
		return (0);
}