Commit 7c87d13f authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

unix: add tpacket types and constants on Linux

Change-Id: I4f2fd8a7c899403f545d8dc73fec2ebbb0b322c0
Reviewed-on: https://go-review.googlesource.com/113035
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent d0faeb53
......@@ -22,7 +22,6 @@ package unix
#include <dirent.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netpacket/packet.h>
#include <poll.h>
#include <sched.h>
#include <signal.h>
......@@ -62,6 +61,7 @@ package unix
#include <utime.h>
#include <linux/can.h>
#include <linux/if_alg.h>
#include <linux/if_packet.h>
#include <linux/fs.h>
#include <linux/vm_sockets.h>
#include <linux/random.h>
......@@ -987,3 +987,37 @@ const (
ST_RELATIME = C.ST_RELATIME
ST_SYNCHRONOUS = C.ST_SYNCHRONOUS
)
// TPacket
type TpacketHdr C.struct_tpacket_hdr
type Tpacket2Hdr C.struct_tpacket2_hdr
type Tpacket3Hdr C.struct_tpacket3_hdr
type TpacketHdrVariant1 C.struct_tpacket_hdr_variant1
type TpacketBlockDesc C.struct_tpacket_block_desc
type TpacketReq C.struct_tpacket_req
type TpacketReq3 C.struct_tpacket_req3
type TpacketStats C.struct_tpacket_stats
type TpacketStatsV3 C.struct_tpacket_stats_v3
type TpacketAuxdata C.struct_tpacket_auxdata
const (
TPACKET_V1 = C.TPACKET_V1
TPACKET_V2 = C.TPACKET_V2
TPACKET_V3 = C.TPACKET_V3
)
const (
SizeofTpacketHdr = C.sizeof_struct_tpacket_hdr
SizeofTpacket2Hdr = C.sizeof_struct_tpacket2_hdr
SizeofTpacket3Hdr = C.sizeof_struct_tpacket3_hdr
)
......@@ -385,7 +385,8 @@ ccflags="$@"
$2 ~ /^TC[IO](ON|OFF)$/ ||
$2 ~ /^IN_/ ||
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ ||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ ||
$2 ~ /^TP_STATUS_/ ||
$2 ~ /^FALLOC_/ ||
$2 == "ICMPV6_FILTER" ||
$2 == "SOMAXCONN" ||
......
......@@ -74,7 +74,7 @@ func main() {
b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_"))
// Remove padding, hidden, or unused fields
removeFieldsRegex = regexp.MustCompile(`\bX_\S+`)
removeFieldsRegex = regexp.MustCompile(`\b(X_\S+|Padding)`)
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
// Remove the first line of warning from cgo
......
......@@ -1993,6 +1993,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x100
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x400854d5
......
......@@ -1994,6 +1994,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x100
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x401054d5
......
......@@ -2000,6 +2000,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x100
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x400854d5
......
......@@ -1985,6 +1985,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x100
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x401054d5
......
......@@ -1996,6 +1996,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x8000
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x800854d5
......
......@@ -1996,6 +1996,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x8000
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x801054d5
......
......@@ -1996,6 +1996,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x8000
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x801054d5
......
......@@ -1996,6 +1996,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x8000
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x800854d5
......
......@@ -2054,6 +2054,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x400000
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x801054d5
......
......@@ -2054,6 +2054,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x400000
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x801054d5
......
......@@ -2054,6 +2054,24 @@ const (
TIOCVHANGUP = 0x5437
TMPFS_MAGIC = 0x1021994
TOSTOP = 0x100
TPACKET_ALIGNMENT = 0x10
TPACKET_HDRLEN = 0x34
TP_STATUS_AVAILABLE = 0x0
TP_STATUS_BLK_TMO = 0x20
TP_STATUS_COPY = 0x2
TP_STATUS_CSUMNOTREADY = 0x8
TP_STATUS_CSUM_VALID = 0x80
TP_STATUS_KERNEL = 0x0
TP_STATUS_LOSING = 0x4
TP_STATUS_SENDING = 0x2
TP_STATUS_SEND_REQUEST = 0x1
TP_STATUS_TS_RAW_HARDWARE = -0x80000000
TP_STATUS_TS_SOFTWARE = 0x20000000
TP_STATUS_TS_SYS_HARDWARE = 0x40000000
TP_STATUS_USER = 0x1
TP_STATUS_VLAN_TPID_VALID = 0x40
TP_STATUS_VLAN_VALID = 0x10
TP_STATUS_WRONG_FORMAT = 0x4
TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x401054d5
......
......@@ -1256,3 +1256,102 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x18
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
......@@ -1275,3 +1275,103 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint64
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
_ [4]byte
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x20
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
......@@ -1245,3 +1245,102 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x18
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
......@@ -1254,3 +1254,103 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint64
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
_ [4]byte
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x20
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
......@@ -1250,3 +1250,102 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x18
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
......@@ -1256,3 +1256,103 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint64
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
_ [4]byte
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x20
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
......@@ -1256,3 +1256,103 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint64
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
_ [4]byte
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x20
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
......@@ -1250,3 +1250,102 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x18
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
......@@ -1264,3 +1264,103 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint64
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
_ [4]byte
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x20
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
......@@ -1264,3 +1264,103 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint64
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
_ [4]byte
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x20
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
......@@ -1281,3 +1281,103 @@ const (
ST_RELATIME = 0x1000
ST_SYNCHRONOUS = 0x10
)
type TpacketHdr struct {
Status uint64
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
_ [4]byte
}
type Tpacket2Hdr struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Nsec uint32
Vlan_tci uint16
Vlan_tpid uint16
_ [4]uint8
}
type Tpacket3Hdr struct {
Next_offset uint32
Sec uint32
Nsec uint32
Snaplen uint32
Len uint32
Status uint32
Mac uint16
Net uint16
Hv1 TpacketHdrVariant1
_ [8]uint8
}
type TpacketHdrVariant1 struct {
Rxhash uint32
Vlan_tci uint32
Vlan_tpid uint16
_ uint16
}
type TpacketBlockDesc struct {
Version uint32
To_priv uint32
Hdr [40]byte
}
type TpacketReq struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
}
type TpacketReq3 struct {
Block_size uint32
Block_nr uint32
Frame_size uint32
Frame_nr uint32
Retire_blk_tov uint32
Sizeof_priv uint32
Feature_req_word uint32
}
type TpacketStats struct {
Packets uint32
Drops uint32
}
type TpacketStatsV3 struct {
Packets uint32
Drops uint32
Freeze_q_cnt uint32
}
type TpacketAuxdata struct {
Status uint32
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Vlan_tci uint16
Vlan_tpid uint16
}
const (
TPACKET_V1 = 0x0
TPACKET_V2 = 0x1
TPACKET_V3 = 0x2
)
const (
SizeofTpacketHdr = 0x20
SizeofTpacket2Hdr = 0x20
SizeofTpacket3Hdr = 0x30
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment