vppapigen: support per-file (major,minor,patch) version stamps
[vpp.git] / src / vnet / classify / classify.api
1 /*
2  * Copyright (c) 2015-2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 vl_api_version 1.0.0
17
18 /** \brief Add/Delete classification table request
19     @param client_index - opaque cookie to identify the sender
20     @param context - sender context, to match reply w/ request
21     @param is_add- if non-zero add the table, else delete it
22     @param del_chain - if non-zero delete the whole chain of tables
23     @param table_index - if add, reuturns index of the created table, else specifies the table to delete  
24     @param nbuckets - number of buckets when adding a table
25     @param memory_size - memory size when adding a table
26     @param match_n_vectors - number of match vectors
27     @param next_table_index - index of next table
28     @param miss_next_index - index of miss table
29     @param current_data_flag - option to use current node's packet payload
30             as the starting point from where packets are classified,
31             This option is only valid for L2/L3 input ACL for now.
32             0: by default, classify data from the buffer's start location
33             1: classify packets from VPP node’s current data pointer
34     @param current_data_offset - a signed value to shift the start location of
35             the packet to be classified
36             For example, if input IP ACL node is used, L2 header’s first byte
37             can be accessible by configuring current_data_offset to -14
38             if there is no vlan tag.
39             This is valid only if current_data_flag is set to 1.
40     @param mask[] - match mask
41 */
42 define classify_add_del_table
43 {
44   u32 client_index;
45   u32 context;
46   u8 is_add;
47   u8 del_chain;
48   u32 table_index;
49   u32 nbuckets;
50   u32 memory_size;
51   u32 skip_n_vectors;
52   u32 match_n_vectors;
53   u32 next_table_index;
54   u32 miss_next_index;
55   u32 current_data_flag;
56   i32 current_data_offset;
57   u8 mask[0];
58 };
59
60 /** \brief Add/Delete classification table response
61     @param context - sender context, to match reply w/ request
62     @param retval - return code for the table add/del requst
63     @param new_table_index - for add, returned index of the new table
64     @param skip_n_vectors - for add, returned value of skip_n_vectors in table
65     @param match_n_vectors -for add, returned value of match_n_vectors in table
66 */
67 define classify_add_del_table_reply
68 {
69   u32 context;
70   i32 retval;
71   u32 new_table_index;
72   u32 skip_n_vectors;
73   u32 match_n_vectors;
74 };
75
76 /** \brief Classify add / del session request
77     @param client_index - opaque cookie to identify the sender
78     @param context - sender context, to match reply w/ request
79     @param is_add - add session if non-zero, else delete
80     @param table_index - index of the table to add/del the session, required
81     @param hit_next_index - for add, hit_next_index of new session, required
82     @param opaque_index - for add, opaque_index of new session
83     @param advance -for add, advance value for session
84     @param action -
85            0: no action (by default)
86               metadata is not used.
87            1: Classified IP packets will be looked up from the
88               specified ipv4 fib table (configured by metadata as VRF id).
89               Only valid for L3 input ACL node
90            2: Classified IP packets will be looked up from the
91               specified ipv6 fib table (configured by metadata as VRF id).
92               Only valid for L3 input ACL node
93     @param metadata - valid only if action != 0
94            VRF id if action is 1 or 2.
95     @param match[] - for add, match value for session, required
96 */
97 autoreply define classify_add_del_session
98 {
99   u32 client_index;
100   u32 context;
101   u8 is_add;
102   u32 table_index;
103   u32 hit_next_index;
104   u32 opaque_index;
105   i32 advance;
106   u8 action;
107   u32 metadata;
108   u8 match[0];
109 };
110
111 /** \brief Set/unset policer classify interface
112     @param client_index - opaque cookie to identify the sender
113     @param context - sender context, to match reply w/ request
114     @param sw_if_index - interface to set/unset policer classify
115     @param ip4_table_index - ip4 classify table index (~0 for skip)
116     @param ip6_table_index - ip6 classify table index (~0 for skip)
117     @param l2_table_index  -  l2 classify table index (~0 for skip)
118     @param is_add - Set if non-zero, else unset
119     Note: User is recommeneded to use just one valid table_index per call.
120           (ip4_table_index, ip6_table_index, or l2_table_index)
121 */
122 autoreply define policer_classify_set_interface
123 {
124   u32 client_index;
125   u32 context;
126   u32 sw_if_index;
127   u32 ip4_table_index;
128   u32 ip6_table_index;
129   u32 l2_table_index;
130   u8 is_add;
131 };
132
133 /** \brief Get list of policer classify interfaces and tables
134     @param client_index - opaque cookie to identify the sender
135     @param context - sender context, to match reply w/ request
136     @param type - classify table type
137 */
138 define policer_classify_dump
139 {
140   u32 client_index;
141   u32 context;
142   u8 type;
143 };
144
145 /** \brief Policer iclassify operational state response.
146     @param context - sender context, to match reply w/ request
147     @param sw_if_index - software interface index
148     @param table_index - classify table index
149 */
150 define policer_classify_details
151 {
152   u32 context;
153   u32 sw_if_index;
154   u32 table_index;
155 };
156
157 /** \brief Classify get table IDs request
158     @param client_index - opaque cookie to identify the sender
159     @param context - sender context, to match reply w/ request
160 */
161 define classify_table_ids
162 {
163   u32 client_index;
164   u32 context;
165 };
166
167 /** \brief Reply for classify get table IDs request
168     @param context - sender context which was passed in the request
169     @param count - number of ids returned in response
170     @param ids - array of classify table ids
171 */
172 define classify_table_ids_reply
173 {
174   u32 context;
175   i32 retval;
176   u32 count;
177   u32 ids[count];
178 };
179
180 /** \brief Classify table ids by interface index request
181     @param client_index - opaque cookie to identify the sender
182     @param context - sender context, to match reply w/ request
183     @param sw_if_index - index of the interface
184 */
185 define classify_table_by_interface
186 {
187   u32 client_index;
188   u32 context;
189   u32 sw_if_index;
190 };
191
192 /** \brief Reply for classify table id by interface index request
193     @param context - sender context which was passed in the request
194     @param count - number of ids returned in response
195     @param sw_if_index - index of the interface
196     @param l2_table_id - l2 classify table index
197     @param ip4_table_id - ip4 classify table index
198     @param ip6_table_id - ip6 classify table index
199 */
200 define classify_table_by_interface_reply
201 {
202   u32 context;
203   i32 retval;
204   u32 sw_if_index;
205   u32 l2_table_id;
206   u32 ip4_table_id;
207   u32 ip6_table_id;
208 };
209
210 /** \brief Classify table info
211     @param client_index - opaque cookie to identify the sender
212     @param context - sender context, to match reply w/ request
213     @param table_id - classify table index
214 */
215 define classify_table_info
216 {
217   u32 client_index;
218   u32 context;
219   u32 table_id;
220 };
221
222 /** \brief Reply for classify table info request
223     @param context - sender context which was passed in the request
224     @param count - number of ids returned in response
225     @param table_id - classify table index
226     @param nbuckets - number of buckets when adding a table
227     @param match_n_vectors - number of match vectors
228     @param skip_n_vectors - number of skip_n_vectors
229     @param active_sessions - number of sessions (active entries)
230     @param next_table_index - index of next table
231     @param miss_next_index - index of miss table
232     @param mask[] - match mask
233 */
234 define classify_table_info_reply
235 {
236   u32 context;
237   i32 retval;
238   u32 table_id;
239   u32 nbuckets;
240   u32 match_n_vectors;
241   u32 skip_n_vectors;
242   u32 active_sessions;
243   u32 next_table_index;
244   u32 miss_next_index;
245   u32 mask_length;
246   u8 mask[mask_length];
247 };
248
249 /** \brief Classify sessions dump request
250     @param client_index - opaque cookie to identify the sender
251     @param context - sender context, to match reply w/ request
252     @param table_id - classify table index
253 */
254 define classify_session_dump
255 {
256   u32 client_index;
257   u32 context;
258   u32 table_id;
259 };
260
261 /** \brief Reply for classify table session dump request
262     @param context - sender context which was passed in the request
263     @param count - number of ids returned in response
264     @param table_id - classify table index
265     @param hit_next_index - hit_next_index of session
266     @param opaque_index - for add, opaque_index of session
267     @param advance - advance value of session
268     @param match[] - match value for session
269 */
270 define classify_session_details
271 {
272   u32 context;
273   i32 retval;
274   u32 table_id;
275   u32 hit_next_index;
276   i32 advance;
277   u32 opaque_index;
278   u32 match_length;
279   u8 match[match_length];
280 };
281
282 /** \brief Set/unset flow classify interface
283     @param client_index - opaque cookie to identify the sender
284     @param context - sender context, to match reply w/ request
285     @param sw_if_index - interface to set/unset flow classify
286     @param ip4_table_index - ip4 classify table index (~0 for skip)
287     @param ip6_table_index - ip6 classify table index (~0 for skip)
288     @param l2_table_index  -  l2 classify table index (~0 for skip)
289     @param is_add - Set if non-zero, else unset
290     Note: User is recommeneded to use just one valid table_index per call.
291           (ip4_table_index, ip6_table_index, or l2_table_index)
292 */
293 autoreply define flow_classify_set_interface {
294     u32 client_index;
295     u32 context;
296     u32 sw_if_index;
297     u32 ip4_table_index;
298     u32 ip6_table_index;
299     u8  is_add;
300 };
301
302 /** \brief Get list of flow classify interfaces and tables
303     @param client_index - opaque cookie to identify the sender
304     @param context - sender context, to match reply w/ request
305     @param type - classify table type
306 */
307 define flow_classify_dump {
308     u32 client_index;
309     u32 context;
310     u8 type;
311 };
312
313 /** \brief Flow classify operational state response.
314     @param context - sender context, to match reply w/ request
315     @param sw_if_index - software interface index
316     @param table_index - classify table index
317 */
318 define flow_classify_details {
319     u32 context;
320     u32 sw_if_index;
321     u32 table_index;
322 };
323
324 /*
325  * Local Variables:
326  * eval: (c-set-style "gnu")
327  * End:
328  */
329