Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
internal.h
Go to the documentation of this file.
1 #ifndef __PACKET_INTERNAL_H__
2 #define __PACKET_INTERNAL_H__
3 
4 struct packet_mclist {
5  struct packet_mclist *next;
6  int ifindex;
7  int count;
8  unsigned short type;
9  unsigned short alen;
10  unsigned char addr[MAX_ADDR_LEN];
11 };
12 
13 /* kbdq - kernel block descriptor queue */
15  struct pgv *pkbdq;
16  unsigned int feature_req_word;
17  unsigned int hdrlen;
19  unsigned char delete_blk_timer;
20  unsigned short kactive_blk_num;
21  unsigned short blk_sizeof_priv;
22 
23  /* last_kactive_blk_num:
24  * trick to see if user-space has caught up
25  * in order to avoid refreshing timer when every single pkt arrives.
26  */
27  unsigned short last_kactive_blk_num;
28 
29  char *pkblk_start;
30  char *pkblk_end;
31  int kblk_size;
32  unsigned int knum_blocks;
34  char *prev;
35  char *nxt_offset;
36  struct sk_buff *skb;
37 
39 
40  /* Default is set to 8ms */
41 #define DEFAULT_PRB_RETIRE_TOV (8)
42 
43  unsigned short retire_blk_tov;
44  unsigned short version;
45  unsigned long tov_in_jiffies;
46 
47  /* timer to retire an outstanding block */
49 };
50 
51 struct pgv {
52  char *buffer;
53 };
54 
56  struct pgv *pg_vec;
57  unsigned int head;
58  unsigned int frames_per_block;
59  unsigned int frame_size;
60  unsigned int frame_max;
61 
62  unsigned int pg_vec_order;
63  unsigned int pg_vec_pages;
64  unsigned int pg_vec_len;
65 
68 };
69 
70 extern struct mutex fanout_mutex;
71 #define PACKET_FANOUT_MAX 256
72 
73 struct packet_fanout {
74 #ifdef CONFIG_NET_NS
75  struct net *net;
76 #endif
77  unsigned int num_members;
82  struct list_head list;
87 };
88 
89 struct packet_sock {
90  /* struct sock has to be the first member of packet_sock */
91  struct sock sk;
100  unsigned int running:1, /* prot_hook is attached*/
101  auxdata:1,
102  origdev:1,
103  has_vnet_hdr:1;
104  int ifindex; /* bound device */
109  unsigned int tp_hdrlen;
110  unsigned int tp_reserve;
111  unsigned int tp_loss:1;
112  unsigned int tp_tstamp;
114 };
115 
116 static struct packet_sock *pkt_sk(struct sock *sk)
117 {
118  return (struct packet_sock *)sk;
119 }
120 
121 #endif