The API was confusing that it uses the length parameter to
distinguish between mbufs and plain memory buffers.
The existing bpf_filter is renamed to _bpf_filter and modified
so that the packet memory is referred to by an opaque pointer,
and callers have to provide a set of operators to extract values
from that opaque pointer.
bpf_filter is converted to a wrapper around _bpf_filter with
a set of operators that work on a plain memory buffer.
A new function, bpf_mfilter is added, which is a wrapper around
_bpf_filter with operators for extracting values from mbufs.
In-tree consumers of bpf_filter(9) are modified to use
bpf_mfilter(9) when appropriate.
Obtained from: OpenBSD