1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef __LINUX_IF_PACKET_H
13 #define __LINUX_IF_PACKET_H
17 unsigned short spkt_family;
18 unsigned char spkt_device[14];
19 unsigned short spkt_protocol;
24 unsigned short sll_family;
25 unsigned short sll_protocol;
27 unsigned short sll_hatype;
28 unsigned char sll_pkttype;
29 unsigned char sll_halen;
30 unsigned char sll_addr[8];
34 #define PACKET_BROADCAST 1
35 #define PACKET_MULTICAST 2
36 #define PACKET_OTHERHOST 3
37 #define PACKET_OUTGOING 4
39 #define PACKET_LOOPBACK 5
40 #define PACKET_FASTROUTE 6
42 #define PACKET_ADD_MEMBERSHIP 1
43 #define PACKET_DROP_MEMBERSHIP 2
44 #define PACKET_RECV_OUTPUT 3
46 #define PACKET_RX_RING 5
47 #define PACKET_STATISTICS 6
48 #define PACKET_COPY_THRESH 7
52 unsigned int tp_packets;
53 unsigned int tp_drops;
58 unsigned long tp_status;
59 #define TP_STATUS_KERNEL 0
60 #define TP_STATUS_USER 1
61 #define TP_STATUS_COPY 2
62 #define TP_STATUS_LOSING 4
63 #define TP_STATUS_CSUMNOTREADY 8
65 unsigned int tp_snaplen;
66 unsigned short tp_mac;
67 unsigned short tp_net;
72 #define TPACKET_ALIGNMENT 16
73 #define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
74 #define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
78 unsigned int tp_block_size;
79 unsigned int tp_block_nr;
80 unsigned int tp_frame_size;
81 unsigned int tp_frame_nr;
87 unsigned short mr_type;
88 unsigned short mr_alen;
89 unsigned char mr_address[8];
92 #define PACKET_MR_MULTICAST 0
93 #define PACKET_MR_PROMISC 1
94 #define PACKET_MR_ALLMULTI 2