authorgravatar for jens.goldberg@gmail.comJens Goldberg <jens.goldberg@gmail.com> 2024-08-20 10:10:14+02:00
committergravatar for jens.goldberg@gmail.comJens Goldberg <jens.goldberg@gmail.com> 2024-08-20 10:10:14+02:00
log6f24c4485ca76c7e8b1b573addd7effb2c7a9bf4
treea7717535f724e09be5f93c9f8e741414c0c29903
parent1950e52c6cbc8321bdc986278bcb1cc510552b15

Add tpacket_hdr and tpacket_block variant unions


1 files changed, 24 insertions(+), 7 deletions(-)

lib/std/os/linux.zig+24-7
...@@ -6915,9 +6915,7 @@ pub const TP_STATUS = extern union {...@@ -6915,9 +6915,7 @@ pub const TP_STATUS = extern union {
6915 },6915 },
6916};6916};
69176917
6918pub const tpacket_block_desc = extern struct {6918pub const tpacket_hdr_v1 = extern struct {
6919 version: u32,
6920 offset_to_priv: u32,
6921 block_status: TP_STATUS,6919 block_status: TP_STATUS,
6922 num_pkts: u32,6920 num_pkts: u32,
6923 offset_to_first_pkt: u32,6921 offset_to_first_pkt: u32,
...@@ -6927,6 +6925,27 @@ pub const tpacket_block_desc = extern struct {...@@ -6927,6 +6925,27 @@ pub const tpacket_block_desc = extern struct {
6927 ts_last_pkt: tpacket_bd_ts,6925 ts_last_pkt: tpacket_bd_ts,
6928};6926};
69296927
6928pub const tpacket_bd_header_u = extern union {
6929 bh1: tpacket_hdr_v1,
6930};
6931
6932pub const tpacket_block_desc = extern struct {
6933 version: u32,
6934 offset_to_priv: u32,
6935 hdr: tpacket_bd_header_u,
6936};
6937
6938pub const tpacket_hdr_variant1 = extern struct {
6939 rxhash: u32,
6940 vlan_tci: u32,
6941 vlan_tpid: u16,
6942 padding: u16,
6943};
6944
6945pub const tpacket3_hdr_variants = extern union {
6946 hv1: tpacket_hdr_variant1,
6947};
6948
6930pub const tpacket3_hdr = extern struct {6949pub const tpacket3_hdr = extern struct {
6931 next_offset: u32,6950 next_offset: u32,
6932 sec: u32,6951 sec: u32,
...@@ -6936,10 +6955,8 @@ pub const tpacket3_hdr = extern struct {...@@ -6936,10 +6955,8 @@ pub const tpacket3_hdr = extern struct {
6936 status: u32,6955 status: u32,
6937 mac: u16,6956 mac: u16,
6938 net: u16,6957 net: u16,
6939 rxhash: u32,6958 variant: tpacket3_hdr_variants,
6940 vlan_tci: u32,6959 padding: [8]u8,
6941 vlan_tpid: u16,
6942 padding: [10]u8,
6943};6960};
69446961
6945pub const tpacket_stats_v3 = extern struct {6962pub const tpacket_stats_v3 = extern struct {