Import 2.3.7pre7
[davej-history.git] / include / linux / pkt_cls.h
blob36935ed3a899dc16d40c29ec31f74477c2bc5cf1
1 #ifndef __LINUX_PKT_CLS_H
2 #define __LINUX_PKT_CLS_H
4 struct tc_police
6 __u32 index;
7 int action;
8 #define TC_POLICE_UNSPEC (-1)
9 #define TC_POLICE_OK 0
10 #define TC_POLICE_RECLASSIFY 1
11 #define TC_POLICE_SHOT 2
13 __u32 limit;
14 __u32 burst;
15 __u32 mtu;
16 struct tc_ratespec rate;
17 struct tc_ratespec peakrate;
20 enum
22 TCA_POLICE_UNSPEC,
23 TCA_POLICE_TBF,
24 TCA_POLICE_RATE,
25 TCA_POLICE_PEAKRATE,
26 TCA_POLICE_AVRATE,
27 TCA_POLICE_RESULT
28 #define TCA_POLICE_RESULT TCA_POLICE_RESULT
31 #define TCA_POLICE_MAX TCA_POLICE_RESULT
33 /* U32 filters */
35 #define TC_U32_HTID(h) ((h)&0xFFF00000)
36 #define TC_U32_USERHTID(h) (TC_U32_HTID(h)>>20)
37 #define TC_U32_HASH(h) (((h)>>12)&0xFF)
38 #define TC_U32_NODE(h) ((h)&0xFFF)
39 #define TC_U32_KEY(h) ((h)&0xFFFFF)
40 #define TC_U32_UNSPEC 0
41 #define TC_U32_ROOT (0xFFF00000)
43 enum
45 TCA_U32_UNSPEC,
46 TCA_U32_CLASSID,
47 TCA_U32_HASH,
48 TCA_U32_LINK,
49 TCA_U32_DIVISOR,
50 TCA_U32_SEL,
51 TCA_U32_POLICE,
54 #define TCA_U32_MAX TCA_U32_POLICE
56 struct tc_u32_key
58 __u32 mask;
59 __u32 val;
60 int off;
61 int offmask;
64 struct tc_u32_sel
66 unsigned char flags;
67 unsigned char offshift;
68 unsigned char nkeys;
70 __u16 offmask;
71 __u16 off;
72 short offoff;
74 short hoff;
75 __u32 hmask;
77 struct tc_u32_key keys[0];
80 /* Flags */
82 #define TC_U32_TERMINAL 1
83 #define TC_U32_OFFSET 2
84 #define TC_U32_VAROFFSET 4
85 #define TC_U32_EAT 8
87 #define TC_U32_MAXDEPTH 8
90 /* RSVP filter */
92 enum
94 TCA_RSVP_UNSPEC,
95 TCA_RSVP_CLASSID,
96 TCA_RSVP_DST,
97 TCA_RSVP_SRC,
98 TCA_RSVP_PINFO,
99 TCA_RSVP_POLICE,
102 #define TCA_RSVP_MAX TCA_RSVP_POLICE
104 struct tc_rsvp_gpi
106 __u32 key;
107 __u32 mask;
108 int offset;
111 struct tc_rsvp_pinfo
113 struct tc_rsvp_gpi dpi;
114 struct tc_rsvp_gpi spi;
115 __u8 protocol;
116 __u8 tunnelid;
117 __u8 tunnelhdr;
120 /* ROUTE filter */
122 enum
124 TCA_ROUTE4_UNSPEC,
125 TCA_ROUTE4_CLASSID,
126 TCA_ROUTE4_TO,
127 TCA_ROUTE4_FROM,
128 TCA_ROUTE4_IIF,
129 TCA_ROUTE4_POLICE,
132 #define TCA_ROUTE4_MAX TCA_ROUTE4_POLICE
135 /* FW filter */
137 enum
139 TCA_FW_UNSPEC,
140 TCA_FW_CLASSID,
141 TCA_FW_POLICE,
144 #define TCA_FW_MAX TCA_FW_POLICE
146 #endif