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 {
69156915 },
69166916};
69176917
6918pub const tpacket_block_desc = extern struct {
6919 version: u32,
6920 offset_to_priv: u32,
6918pub const tpacket_hdr_v1 = extern struct {
69216919 block_status: TP_STATUS,
69226920 num_pkts: u32,
69236921 offset_to_first_pkt: u32,
......@@ -6927,6 +6925,27 @@ pub const tpacket_block_desc = extern struct {
69276925 ts_last_pkt: tpacket_bd_ts,
69286926};
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
69306949pub const tpacket3_hdr = extern struct {
69316950 next_offset: u32,
69326951 sec: u32,
......@@ -6936,10 +6955,8 @@ pub const tpacket3_hdr = extern struct {
69366955 status: u32,
69376956 mac: u16,
69386957 net: u16,
6939 rxhash: u32,
6940 vlan_tci: u32,
6941 vlan_tpid: u16,
6942 padding: [10]u8,
6958 variant: tpacket3_hdr_variants,
6959 padding: [8]u8,
69436960};
69446961
69456962pub const tpacket_stats_v3 = extern struct {