unix: add functions to get/set tpacket socket options

Add GetsockoptTpacketStats and GetsockoptTpacketStatsV3 to get tpacket
statistics (for TPACKET_V2 and TPACKET_V3).

Add SetsockoptTpacketReq and SetsockoptTpacketReq3 to set up tpacket
v2/v3 ring buffers.

Change-Id: Ic2870be22be7d74141f682e515a682df28e1c814
Reviewed-on: https://go-review.googlesource.com/c/sys/+/165558
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Tobias Klauser
2019-03-06 15:53:19 +00:00
committed by Tobias Klauser
parent a98ae47d97
commit 3e9a981b8d
15 changed files with 64 additions and 0 deletions
+3
View File
@@ -1115,6 +1115,9 @@ const (
SizeofTpacketHdr = C.sizeof_struct_tpacket_hdr
SizeofTpacket2Hdr = C.sizeof_struct_tpacket2_hdr
SizeofTpacket3Hdr = C.sizeof_struct_tpacket3_hdr
SizeofTpacketStats = C.sizeof_struct_tpacket_stats
SizeofTpacketStatsV3 = C.sizeof_struct_tpacket_stats_v3
)
// netfilter