History

packet: deliver VLAN TPID to userspace

This enables userspace to get VLAN TPID as well as the VLAN TCI.

Atzm Watanabe committed 12 years ago

Commit a0cdfcf1 parent e4d26f42 files · +24 −14Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/if_packet.h+14−10
@@ -84,17 +84,18 @@ struct tpacket_auxdata { · 83 unmodified lines
84 __u16 tp_mac;84 __u16 tp_mac;
85 __u16 tp_net;85 __u16 tp_net;
86 __u16 tp_vlan_tci;86 __u16 tp_vlan_tci;
87 __u16 tp_padding;87 __u16 tp_vlan_tpid;
88};88};
89 89
90/* Rx ring - header status */90/* Rx ring - header status */
91#define TP_STATUS_KERNEL 091#define TP_STATUS_KERNEL 0
92#define TP_STATUS_USER (1 << 0)92#define TP_STATUS_USER (1 << 0)
93#define TP_STATUS_COPY (1 << 1)93#define TP_STATUS_COPY (1 << 1)
94#define TP_STATUS_LOSING (1 << 2)94#define TP_STATUS_LOSING (1 << 2)
95#define TP_STATUS_CSUMNOTREADY (1 << 3)95#define TP_STATUS_CSUMNOTREADY (1 << 3)
96#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */96#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */
97#define TP_STATUS_BLK_TMO (1 << 5)97#define TP_STATUS_BLK_TMO (1 << 5)
98#define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */
98 99
99/* Tx ring - header status */100/* Tx ring - header status */
100#define TP_STATUS_AVAILABLE 0101#define TP_STATUS_AVAILABLE 0
@@ -133,12 +134,15 @@ struct tpacket2_hdr { · 32 unmodified lines
133 __u32 tp_sec;134 __u32 tp_sec;
134 __u32 tp_nsec;135 __u32 tp_nsec;
135 __u16 tp_vlan_tci;136 __u16 tp_vlan_tci;
136 __u8 tp_padding[6];137 __u16 tp_vlan_tpid;
138 __u8 tp_padding[4];
137};139};
138 140
139struct tpacket_hdr_variant1 {141struct tpacket_hdr_variant1 {
140 __u32 tp_rxhash;142 __u32 tp_rxhash;
141 __u32 tp_vlan_tci;143 __u32 tp_vlan_tci;
144 __u16 tp_vlan_tpid;
145 __u16 tp_padding;
142};146};
143 147
144struct tpacket3_hdr {148struct tpacket3_hdr {
@@ -154,7 +158,7 @@ struct tpacket3_hdr { · 9 unmodified lines
154 union {158 union {
155 struct tpacket_hdr_variant1 hv1;159 struct tpacket_hdr_variant1 hv1;
156 };160 };
157 __u8 tp_padding[12];161 __u8 tp_padding[8];
158};162};
159 163
160struct tpacket_bd_ts {164struct tpacket_bd_ts {