the-tcpdump-group/libpcap — pull request #296 by darkjames (2013-05-02 10:52:31+00:00)
Title: Experimental support for TPACKET v3 (v2)

Code based on sample code of minimal AF_PACKET TPACKET_V3 code
http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/Documentation/networking/packet_mmap.txt?id=4eb06148250f92e1e58bf069c309dac173e8b5f7

The most ugly part of patch is bp-pointer substraction:
callback(user, &pcaphdr, bp - (pcaphdr.caplen - tp_snaplen));

No benchmarks done, sorry.

changes from v1:
- mention me and original Daniel in file copyright
- just in case fix possible compilation problem if HAVE_TPACKET3 is defined, but not HAVE_TPACKET2
- test for handle->break_loop in loop