summaryrefslogtreecommitdiff
path: root/include/uapi/linux/if_packet.h
diff options
context:
space:
mode:
authorAtzm Watanabe <atzm@stratosphere.co.jp>2013-12-17 22:53:40 +0900
committerDavid S. Miller <davem@davemloft.net>2013-12-18 00:36:16 -0500
commita0cdfcf39362410d5ea983f4daf67b38de129408 (patch)
tree31de8d8010bafd58bade0701fb3f501bd6e4c0a7 /include/uapi/linux/if_packet.h
parente4d26f4b080f55e9577b45e6b51a04971eb459e9 (diff)
packet: deliver VLAN TPID to userspace
This enables userspace to get VLAN TPID as well as the VLAN TCI. Signed-off-by: Atzm Watanabe <atzm@stratosphere.co.jp> Acked-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/if_packet.h')
-rw-r--r--include/uapi/linux/if_packet.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index 9185dc9a4485..e9d844c80c11 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -84,17 +84,18 @@ struct tpacket_auxdata {
__u16 tp_mac;
__u16 tp_net;
__u16 tp_vlan_tci;
- __u16 tp_padding;
+ __u16 tp_vlan_tpid;
};
/* Rx ring - header status */
-#define TP_STATUS_KERNEL 0
-#define TP_STATUS_USER (1 << 0)
-#define TP_STATUS_COPY (1 << 1)
-#define TP_STATUS_LOSING (1 << 2)
-#define TP_STATUS_CSUMNOTREADY (1 << 3)
-#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */
-#define TP_STATUS_BLK_TMO (1 << 5)
+#define TP_STATUS_KERNEL 0
+#define TP_STATUS_USER (1 << 0)
+#define TP_STATUS_COPY (1 << 1)
+#define TP_STATUS_LOSING (1 << 2)
+#define TP_STATUS_CSUMNOTREADY (1 << 3)
+#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */
+#define TP_STATUS_BLK_TMO (1 << 5)
+#define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */
/* Tx ring - header status */
#define TP_STATUS_AVAILABLE 0
@@ -133,12 +134,15 @@ struct tpacket2_hdr {
__u32 tp_sec;
__u32 tp_nsec;
__u16 tp_vlan_tci;
- __u8 tp_padding[6];
+ __u16 tp_vlan_tpid;
+ __u8 tp_padding[4];
};
struct tpacket_hdr_variant1 {
__u32 tp_rxhash;
__u32 tp_vlan_tci;
+ __u16 tp_vlan_tpid;
+ __u16 tp_padding;
};
struct tpacket3_hdr {
@@ -154,7 +158,7 @@ struct tpacket3_hdr {
union {
struct tpacket_hdr_variant1 hv1;
};
- __u8 tp_padding[12];
+ __u8 tp_padding[8];
};
struct tpacket_bd_ts {