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