]> err.no Git - linux-2.6/blobdiff - include/linux/if_packet.h
packet: add PACKET_RESERVE sockopt
[linux-2.6] / include / linux / if_packet.h
index b92558549d27b847901b08ae10bf0ba3b6f73ae2..18db0668065a61c6e5af363f3db50ddd1d5b629a 100644 (file)
@@ -1,17 +1,19 @@
 #ifndef __LINUX_IF_PACKET_H
 #define __LINUX_IF_PACKET_H
 
+#include <linux/types.h>
+
 struct sockaddr_pkt
 {
        unsigned short spkt_family;
        unsigned char spkt_device[14];
-       unsigned short spkt_protocol;
+       __be16 spkt_protocol;
 };
 
 struct sockaddr_ll
 {
        unsigned short  sll_family;
-       unsigned short  sll_protocol;
+       __be16          sll_protocol;
        int             sll_ifindex;
        unsigned short  sll_hatype;
        unsigned char   sll_pkttype;
@@ -39,6 +41,11 @@ struct sockaddr_ll
 #define PACKET_RX_RING                 5
 #define PACKET_STATISTICS              6
 #define PACKET_COPY_THRESH             7
+#define PACKET_AUXDATA                 8
+#define PACKET_ORIGDEV                 9
+#define PACKET_VERSION                 10
+#define PACKET_HDRLEN                  11
+#define PACKET_RESERVE                 12
 
 struct tpacket_stats
 {
@@ -46,6 +53,16 @@ struct tpacket_stats
        unsigned int    tp_drops;
 };
 
+struct tpacket_auxdata
+{
+       __u32           tp_status;
+       __u32           tp_len;
+       __u32           tp_snaplen;
+       __u16           tp_mac;
+       __u16           tp_net;
+       __u16           tp_vlan_tci;
+};
+
 struct tpacket_hdr
 {
        unsigned long   tp_status;
@@ -66,6 +83,26 @@ struct tpacket_hdr
 #define TPACKET_ALIGN(x)       (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
 #define TPACKET_HDRLEN         (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
 
+struct tpacket2_hdr
+{
+       __u32           tp_status;
+       __u32           tp_len;
+       __u32           tp_snaplen;
+       __u16           tp_mac;
+       __u16           tp_net;
+       __u32           tp_sec;
+       __u32           tp_nsec;
+       __u16           tp_vlan_tci;
+};
+
+#define TPACKET2_HDRLEN                (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
+
+enum tpacket_versions
+{
+       TPACKET_V1,
+       TPACKET_V2,
+};
+
 /*
    Frame structure: