Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
422 | giacomo | 1 | #ifndef __LINUX_PKT_CLS_H |
2 | #define __LINUX_PKT_CLS_H |
||
3 | |||
4 | struct tc_police |
||
5 | { |
||
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 |
||
12 | |||
13 | __u32 limit; |
||
14 | __u32 burst; |
||
15 | __u32 mtu; |
||
16 | struct tc_ratespec rate; |
||
17 | struct tc_ratespec peakrate; |
||
18 | }; |
||
19 | |||
20 | enum |
||
21 | { |
||
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 |
||
29 | }; |
||
30 | |||
31 | #define TCA_POLICE_MAX TCA_POLICE_RESULT |
||
32 | |||
33 | /* U32 filters */ |
||
34 | |||
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) |
||
42 | |||
43 | enum |
||
44 | { |
||
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, |
||
52 | }; |
||
53 | |||
54 | #define TCA_U32_MAX TCA_U32_POLICE |
||
55 | |||
56 | struct tc_u32_key |
||
57 | { |
||
58 | __u32 mask; |
||
59 | __u32 val; |
||
60 | int off; |
||
61 | int offmask; |
||
62 | }; |
||
63 | |||
64 | struct tc_u32_sel |
||
65 | { |
||
66 | unsigned char flags; |
||
67 | unsigned char offshift; |
||
68 | unsigned char nkeys; |
||
69 | |||
70 | __u16 offmask; |
||
71 | __u16 off; |
||
72 | short offoff; |
||
73 | |||
74 | short hoff; |
||
75 | __u32 hmask; |
||
76 | |||
77 | struct tc_u32_key keys[0]; |
||
78 | }; |
||
79 | |||
80 | /* Flags */ |
||
81 | |||
82 | #define TC_U32_TERMINAL 1 |
||
83 | #define TC_U32_OFFSET 2 |
||
84 | #define TC_U32_VAROFFSET 4 |
||
85 | #define TC_U32_EAT 8 |
||
86 | |||
87 | #define TC_U32_MAXDEPTH 8 |
||
88 | |||
89 | |||
90 | /* RSVP filter */ |
||
91 | |||
92 | enum |
||
93 | { |
||
94 | TCA_RSVP_UNSPEC, |
||
95 | TCA_RSVP_CLASSID, |
||
96 | TCA_RSVP_DST, |
||
97 | TCA_RSVP_SRC, |
||
98 | TCA_RSVP_PINFO, |
||
99 | TCA_RSVP_POLICE, |
||
100 | }; |
||
101 | |||
102 | #define TCA_RSVP_MAX TCA_RSVP_POLICE |
||
103 | |||
104 | struct tc_rsvp_gpi |
||
105 | { |
||
106 | __u32 key; |
||
107 | __u32 mask; |
||
108 | int offset; |
||
109 | }; |
||
110 | |||
111 | struct tc_rsvp_pinfo |
||
112 | { |
||
113 | struct tc_rsvp_gpi dpi; |
||
114 | struct tc_rsvp_gpi spi; |
||
115 | __u8 protocol; |
||
116 | __u8 tunnelid; |
||
117 | __u8 tunnelhdr; |
||
118 | }; |
||
119 | |||
120 | /* ROUTE filter */ |
||
121 | |||
122 | enum |
||
123 | { |
||
124 | TCA_ROUTE4_UNSPEC, |
||
125 | TCA_ROUTE4_CLASSID, |
||
126 | TCA_ROUTE4_TO, |
||
127 | TCA_ROUTE4_FROM, |
||
128 | TCA_ROUTE4_IIF, |
||
129 | TCA_ROUTE4_POLICE, |
||
130 | }; |
||
131 | |||
132 | #define TCA_ROUTE4_MAX TCA_ROUTE4_POLICE |
||
133 | |||
134 | |||
135 | /* FW filter */ |
||
136 | |||
137 | enum |
||
138 | { |
||
139 | TCA_FW_UNSPEC, |
||
140 | TCA_FW_CLASSID, |
||
141 | TCA_FW_POLICE, |
||
142 | }; |
||
143 | |||
144 | #define TCA_FW_MAX TCA_FW_POLICE |
||
145 | |||
146 | /* TC index filter */ |
||
147 | |||
148 | enum |
||
149 | { |
||
150 | TCA_TCINDEX_UNSPEC, |
||
151 | TCA_TCINDEX_HASH, |
||
152 | TCA_TCINDEX_MASK, |
||
153 | TCA_TCINDEX_SHIFT, |
||
154 | TCA_TCINDEX_FALL_THROUGH, |
||
155 | TCA_TCINDEX_CLASSID, |
||
156 | TCA_TCINDEX_POLICE, |
||
157 | }; |
||
158 | |||
159 | #define TCA_TCINDEX_MAX TCA_TCINDEX_POLICE |
||
160 | |||
161 | #endif |