Merge branch 'viafb-next' of git://git.lwn.net/linux-2.6
[safe/jmp/linux-2.6] / include / linux / if_packet.h
index a630295..aa57a5f 100644 (file)
@@ -3,15 +3,13 @@
 
 #include <linux/types.h>
 
-struct sockaddr_pkt
-{
+struct sockaddr_pkt {
        unsigned short spkt_family;
        unsigned char spkt_device[14];
        __be16 spkt_protocol;
 };
 
-struct sockaddr_ll
-{
+struct sockaddr_ll {
        unsigned short  sll_family;
        __be16          sll_protocol;
        int             sll_ifindex;
@@ -45,15 +43,17 @@ struct sockaddr_ll
 #define PACKET_ORIGDEV                 9
 #define PACKET_VERSION                 10
 #define PACKET_HDRLEN                  11
+#define PACKET_RESERVE                 12
+#define PACKET_TX_RING                 13
+#define PACKET_LOSS                    14
+#define PACKET_VNET_HDR                        15
 
-struct tpacket_stats
-{
+struct tpacket_stats {
        unsigned int    tp_packets;
        unsigned int    tp_drops;
 };
 
-struct tpacket_auxdata
-{
+struct tpacket_auxdata {
        __u32           tp_status;
        __u32           tp_len;
        __u32           tp_snaplen;
@@ -62,14 +62,21 @@ struct tpacket_auxdata
        __u16           tp_vlan_tci;
 };
 
-struct tpacket_hdr
-{
+/* Rx ring - header status */
+#define TP_STATUS_KERNEL       0x0
+#define TP_STATUS_USER         0x1
+#define TP_STATUS_COPY         0x2
+#define TP_STATUS_LOSING       0x4
+#define TP_STATUS_CSUMNOTREADY 0x8
+
+/* Tx ring - header status */
+#define TP_STATUS_AVAILABLE    0x0
+#define TP_STATUS_SEND_REQUEST 0x1
+#define TP_STATUS_SENDING      0x2
+#define TP_STATUS_WRONG_FORMAT 0x4
+
+struct tpacket_hdr {
        unsigned long   tp_status;
-#define TP_STATUS_KERNEL       0
-#define TP_STATUS_USER         1
-#define TP_STATUS_COPY         2
-#define TP_STATUS_LOSING       4
-#define TP_STATUS_CSUMNOTREADY 8
        unsigned int    tp_len;
        unsigned int    tp_snaplen;
        unsigned short  tp_mac;
@@ -82,8 +89,7 @@ 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
-{
+struct tpacket2_hdr {
        __u32           tp_status;
        __u32           tp_len;
        __u32           tp_snaplen;
@@ -96,8 +102,7 @@ struct tpacket2_hdr
 
 #define TPACKET2_HDRLEN                (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
 
-enum tpacket_versions
-{
+enum tpacket_versions {
        TPACKET_V1,
        TPACKET_V2,
 };
@@ -115,16 +120,14 @@ enum tpacket_versions
    - Pad to align to TPACKET_ALIGNMENT=16
  */
 
-struct tpacket_req
-{
+struct tpacket_req {
        unsigned int    tp_block_size;  /* Minimal size of contiguous block */
        unsigned int    tp_block_nr;    /* Number of blocks */
        unsigned int    tp_frame_size;  /* Size of frame */
        unsigned int    tp_frame_nr;    /* Total number of frames */
 };
 
-struct packet_mreq
-{
+struct packet_mreq {
        int             mr_ifindex;
        unsigned short  mr_type;
        unsigned short  mr_alen;
@@ -134,5 +137,6 @@ struct packet_mreq
 #define PACKET_MR_MULTICAST    0
 #define PACKET_MR_PROMISC      1
 #define PACKET_MR_ALLMULTI     2
+#define PACKET_MR_UNICAST      3
 
 #endif