aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/if_packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/if_packet.h')
-rw-r--r--include/linux/if_packet.h28
1 files changed, 10 insertions, 18 deletions
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index dea7d6b7cf98..aa57a5f993fc 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -3,15 +3,13 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct sockaddr_pkt 6struct sockaddr_pkt {
7{
8 unsigned short spkt_family; 7 unsigned short spkt_family;
9 unsigned char spkt_device[14]; 8 unsigned char spkt_device[14];
10 __be16 spkt_protocol; 9 __be16 spkt_protocol;
11}; 10};
12 11
13struct sockaddr_ll 12struct sockaddr_ll {
14{
15 unsigned short sll_family; 13 unsigned short sll_family;
16 __be16 sll_protocol; 14 __be16 sll_protocol;
17 int sll_ifindex; 15 int sll_ifindex;
@@ -48,15 +46,14 @@ struct sockaddr_ll
48#define PACKET_RESERVE 12 46#define PACKET_RESERVE 12
49#define PACKET_TX_RING 13 47#define PACKET_TX_RING 13
50#define PACKET_LOSS 14 48#define PACKET_LOSS 14
49#define PACKET_VNET_HDR 15
51 50
52struct tpacket_stats 51struct tpacket_stats {
53{
54 unsigned int tp_packets; 52 unsigned int tp_packets;
55 unsigned int tp_drops; 53 unsigned int tp_drops;
56}; 54};
57 55
58struct tpacket_auxdata 56struct tpacket_auxdata {
59{
60 __u32 tp_status; 57 __u32 tp_status;
61 __u32 tp_len; 58 __u32 tp_len;
62 __u32 tp_snaplen; 59 __u32 tp_snaplen;
@@ -78,8 +75,7 @@ struct tpacket_auxdata
78#define TP_STATUS_SENDING 0x2 75#define TP_STATUS_SENDING 0x2
79#define TP_STATUS_WRONG_FORMAT 0x4 76#define TP_STATUS_WRONG_FORMAT 0x4
80 77
81struct tpacket_hdr 78struct tpacket_hdr {
82{
83 unsigned long tp_status; 79 unsigned long tp_status;
84 unsigned int tp_len; 80 unsigned int tp_len;
85 unsigned int tp_snaplen; 81 unsigned int tp_snaplen;
@@ -93,8 +89,7 @@ struct tpacket_hdr
93#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) 89#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
94#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) 90#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
95 91
96struct tpacket2_hdr 92struct tpacket2_hdr {
97{
98 __u32 tp_status; 93 __u32 tp_status;
99 __u32 tp_len; 94 __u32 tp_len;
100 __u32 tp_snaplen; 95 __u32 tp_snaplen;
@@ -107,8 +102,7 @@ struct tpacket2_hdr
107 102
108#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) 103#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
109 104
110enum tpacket_versions 105enum tpacket_versions {
111{
112 TPACKET_V1, 106 TPACKET_V1,
113 TPACKET_V2, 107 TPACKET_V2,
114}; 108};
@@ -126,16 +120,14 @@ enum tpacket_versions
126 - Pad to align to TPACKET_ALIGNMENT=16 120 - Pad to align to TPACKET_ALIGNMENT=16
127 */ 121 */
128 122
129struct tpacket_req 123struct tpacket_req {
130{
131 unsigned int tp_block_size; /* Minimal size of contiguous block */ 124 unsigned int tp_block_size; /* Minimal size of contiguous block */
132 unsigned int tp_block_nr; /* Number of blocks */ 125 unsigned int tp_block_nr; /* Number of blocks */
133 unsigned int tp_frame_size; /* Size of frame */ 126 unsigned int tp_frame_size; /* Size of frame */
134 unsigned int tp_frame_nr; /* Total number of frames */ 127 unsigned int tp_frame_nr; /* Total number of frames */
135}; 128};
136 129
137struct packet_mreq 130struct packet_mreq {
138{
139 int mr_ifindex; 131 int mr_ifindex;
140 unsigned short mr_type; 132 unsigned short mr_type;
141 unsigned short mr_alen; 133 unsigned short mr_alen;