tcpdump mailing list archives

BPF_COP support for libpcap


From: Mindaugas Rasiukevicius <rmind () noxt eu>
Date: Thu, 7 May 2015 20:52:52 +0100

Hi,

A while ago NetBSD gained support for BPF_COP instruction, see [1] for
more details.  However, now there are use cases of it outside the NetBSD
kernel, e.g. standalone NPF packet filter running as a program on Linux.
Hence I would like to add the support for the BPF_COP instruction to the
pcap_compile() and pcap_dump() of the libpcap library.

Here is the preliminary patch:

http://www.netbsd.org/~rmind/libpcap_bpf_cop.diff

- Is that something we could include into the mainstream repository?
  Please note that it does not add BPF coprocessor support to the
  byte-code interpreter itself.  If that seems desirable, I can easily
  add NetBSD's bpf_filter_ext() API.

- As there are users who want to pcap_compile() an expression with BPF_COP
  on Linux, can we expose BPF_COP or make it otherwise available for the
  systems where this instruction would not be in the net/bpf.h header?

Thanks.

[1] http://mail-index.netbsd.org/tech-net/2013/08/22/msg004197.html

-- 
Mindaugas
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Current thread: