summaryrefslogtreecommitdiff
path: root/lib/libpcap
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2016-04-02 08:49:50 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2016-04-02 08:49:50 +0000
commite5a0d0d70b99ccd066229eef52ecb6861bdc7f8e (patch)
tree467c8ba025beabaae6fe3b4d2c4c3eed8c4a3523 /lib/libpcap
parent1205b031a9ad9ffbd73b76f455e3bcf03051352d (diff)
refactor bpf_filter a bit.
the code was confusing around how it dealt with packets in mbufs vs plain memory buffers with a lenght. this renames bpf_filter to _bpf_filter, and changes it so the packet memory is referred to by an opaque pointer, and callers have to provide a set of operations to extra values from that opaque pointer. bpf_filter is now provided as a wrapper around _bpf_filter. it provides a set of operators that work on a straight buffer with a lenght. this also adds a bpf_mfilter function which takes an mbuf instead of a buffer, and it provides explicit operations for extracting values from mbufs. if we want to use bpf filters against other data structures (usb or scsi packets maybe?) we are able to provide functions for extracting payloads from them and use _bpf_filter as is. ok canacar@
Diffstat (limited to 'lib/libpcap')
-rw-r--r--lib/libpcap/pcap.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libpcap/pcap.h b/lib/libpcap/pcap.h
index 68706e82c5e..f2b15b56c63 100644
--- a/lib/libpcap/pcap.h
+++ b/lib/libpcap/pcap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcap.h,v 1.16 2014/04/11 04:08:58 lteo Exp $ */
+/* $OpenBSD: pcap.h,v 1.17 2016/04/02 08:49:49 dlg Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996, 1997
@@ -226,8 +226,6 @@ void pcap_freealldevs(pcap_if_t *);
const char *pcap_lib_version(void);
-/* XXX this guy lives in the bpf tree */
-u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int);
char *bpf_image(struct bpf_insn *, int);
int pcap_get_selectable_fd(pcap_t *);