FD.io VPP  v19.04.2-12-g66b1689
Vector Packet Processing
classify.api
Go to the documentation of this file.
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 option version = "2.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_len - length of match mask, should be equal to match_n_vectors * sizeof (u32x4)
41  @param mask - match mask
42 */
43 define classify_add_del_table
44 {
59  u8 mask[mask_len];
60 };
61 
62 /** \brief Add/Delete classification table response
63  @param context - sender context, to match reply w/ request
64  @param retval - return code for the table add/del requst
65  @param new_table_index - for add, returned index of the new table
66  @param skip_n_vectors - for add, returned value of skip_n_vectors in table
67  @param match_n_vectors -for add, returned value of match_n_vectors in table
68 */
69 define classify_add_del_table_reply
70 {
76 };
77 
78 /** \brief Classify add / del session request
79  @param client_index - opaque cookie to identify the sender
80  @param context - sender context, to match reply w/ request
81  @param is_add - add session if non-zero, else delete
82  @param table_index - index of the table to add/del the session, required
83  @param hit_next_index - for add, hit_next_index of new session, required
84  @param opaque_index - for add, opaque_index of new session
85  @param advance -for add, advance value for session
86  @param action -
87  0: no action (by default)
88  metadata is not used.
89  1: Classified IP packets will be looked up from the
90  specified ipv4 fib table (configured by metadata as VRF id).
91  Only valid for L3 input ACL node
92  2: Classified IP packets will be looked up from the
93  specified ipv6 fib table (configured by metadata as VRF id).
94  Only valid for L3 input ACL node
95  3: Classified packet will be steered to source routig policy
96  of given index (in metadata).
97  This is only valid for IPv6 packets redirected to a source
98  routing node.
99  @param metadata - valid only if action != 0
100  VRF id if action is 1 or 2.
101  sr policy index if action is 3.
102  @param match_len - length of match, should be equal to skip_n_vectors plus match_n_vectors
103  of target table times sizeof (u32x4)
104  @param match - for add, match value for session, required,
105  needs to include bytes in front
106  with length of skip_n_vectors of target table times sizeof (u32x4)
107  (values of those bytes will be ignored)
108 */
109 autoreply define classify_add_del_session
110 {
121  u8 match[match_len];
122 };
123 
124 /** \brief Set/unset policer classify interface
125  @param client_index - opaque cookie to identify the sender
126  @param context - sender context, to match reply w/ request
127  @param sw_if_index - interface to set/unset policer classify
128  @param ip4_table_index - ip4 classify table index (~0 for skip)
129  @param ip6_table_index - ip6 classify table index (~0 for skip)
130  @param l2_table_index - l2 classify table index (~0 for skip)
131  @param is_add - Set if non-zero, else unset
132  Note: User is recommeneded to use just one valid table_index per call.
133  (ip4_table_index, ip6_table_index, or l2_table_index)
134 */
135 autoreply define policer_classify_set_interface
136 {
144 };
145 
146 /** \brief Get list of policer classify interfaces and tables
147  @param client_index - opaque cookie to identify the sender
148  @param context - sender context, to match reply w/ request
149  @param type - classify table type
150 */
151 define policer_classify_dump
152 {
156 };
157 
158 /** \brief Policer iclassify operational state response.
159  @param context - sender context, to match reply w/ request
160  @param sw_if_index - software interface index
161  @param table_index - classify table index
162 */
163 define policer_classify_details
164 {
168 };
169 
170 /** \brief Classify get table IDs request
171  @param client_index - opaque cookie to identify the sender
172  @param context - sender context, to match reply w/ request
173 */
174 define classify_table_ids
175 {
178 };
179 
180 /** \brief Reply for classify get table IDs request
181  @param context - sender context which was passed in the request
182  @param count - number of ids returned in response
183  @param ids - array of classify table ids
184 */
185 define classify_table_ids_reply
186 {
190  u32 ids[count];
191 };
192 
193 /** \brief Classify table ids by interface index request
194  @param client_index - opaque cookie to identify the sender
195  @param context - sender context, to match reply w/ request
196  @param sw_if_index - index of the interface
197 */
198 define classify_table_by_interface
199 {
203 };
204 
205 /** \brief Reply for classify table id by interface index request
206  @param context - sender context which was passed in the request
207  @param count - number of ids returned in response
208  @param sw_if_index - index of the interface
209  @param l2_table_id - l2 classify table index
210  @param ip4_table_id - ip4 classify table index
211  @param ip6_table_id - ip6 classify table index
212 */
213 define classify_table_by_interface_reply
214 {
221 };
222 
223 /** \brief Classify table info
224  @param client_index - opaque cookie to identify the sender
225  @param context - sender context, to match reply w/ request
226  @param table_id - classify table index
227 */
228 define classify_table_info
229 {
233 };
234 
235 /** \brief Reply for classify table info request
236  @param context - sender context which was passed in the request
237  @param count - number of ids returned in response
238  @param table_id - classify table index
239  @param nbuckets - number of buckets when adding a table
240  @param match_n_vectors - number of match vectors
241  @param skip_n_vectors - number of skip_n_vectors
242  @param active_sessions - number of sessions (active entries)
243  @param next_table_index - index of next table
244  @param miss_next_index - index of miss table
245  @param mask[] - match mask
246 */
247 define classify_table_info_reply
248 {
259  u8 mask[mask_length];
260 };
261 
262 /** \brief Classify sessions dump request
263  @param client_index - opaque cookie to identify the sender
264  @param context - sender context, to match reply w/ request
265  @param table_id - classify table index
266 */
267 define classify_session_dump
268 {
272 };
273 
274 /** \brief Reply for classify table session dump request
275  @param context - sender context which was passed in the request
276  @param count - number of ids returned in response
277  @param table_id - classify table index
278  @param hit_next_index - hit_next_index of session
279  @param opaque_index - for add, opaque_index of session
280  @param advance - advance value of session
281  @param match[] - match value for session
282 */
283 define classify_session_details
284 {
292  u8 match[match_length];
293 };
294 
295 /** \brief Set/unset flow classify interface
296  @param client_index - opaque cookie to identify the sender
297  @param context - sender context, to match reply w/ request
298  @param sw_if_index - interface to set/unset flow classify
299  @param ip4_table_index - ip4 classify table index (~0 for skip)
300  @param ip6_table_index - ip6 classify table index (~0 for skip)
301  @param l2_table_index - l2 classify table index (~0 for skip)
302  @param is_add - Set if non-zero, else unset
303  Note: User is recommeneded to use just one valid table_index per call.
304  (ip4_table_index, ip6_table_index, or l2_table_index)
305 */
306 autoreply define flow_classify_set_interface {
313 };
314 
315 /** \brief Get list of flow classify interfaces and tables
316  @param client_index - opaque cookie to identify the sender
317  @param context - sender context, to match reply w/ request
318  @param type - classify table type
319 */
320 define flow_classify_dump {
324 };
325 
326 /** \brief Flow classify operational state response.
327  @param context - sender context, to match reply w/ request
328  @param sw_if_index - software interface index
329  @param table_index - classify table index
330 */
331 define flow_classify_details {
335 };
336 
337 /** \brief Set/unset the classification table for an interface request
338  @param client_index - opaque cookie to identify the sender
339  @param context - sender context, to match reply w/ request
340  @param is_ipv6 - ipv6 if non-zero, else ipv4
341  @param sw_if_index - interface to associate with the table
342  @param table_index - index of the table, if ~0 unset the table
343 */
344 autoreply define classify_set_interface_ip_table
345 {
350  u32 table_index; /* ~0 => off */
351 };
352 
353 /** \brief Set/unset l2 classification tables for an interface request
354  @param client_index - opaque cookie to identify the sender
355  @param context - sender context, to match reply w/ request
356  @param sw_if_index - interface to set/unset tables for
357  @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
358  @param ip6_table_index - ip6 index
359  @param other_table_index - other index
360 */
361 autoreply define classify_set_interface_l2_tables
362 {
366  /* 3 x ~0 => off */
371 };
372 
373 /** \brief Set/unset input ACL interface
374  @param client_index - opaque cookie to identify the sender
375  @param context - sender context, to match reply w/ request
376  @param sw_if_index - interface to set/unset input ACL
377  @param ip4_table_index - ip4 classify table index (~0 for skip)
378  @param ip6_table_index - ip6 classify table index (~0 for skip)
379  @param l2_table_index - l2 classify table index (~0 for skip)
380  @param is_add - Set input ACL if non-zero, else unset
381  Note: User is recommeneded to use just one valid table_index per call.
382  (ip4_table_index, ip6_table_index, or l2_table_index)
383 */
384 autoreply define input_acl_set_interface
385 {
393 };
394 
395 /** \brief Set/unset output ACL interface
396  @param client_index - opaque cookie to identify the sender
397  @param context - sender context, to match reply w/ request
398  @param sw_if_index - interface to set/unset output ACL
399  @param ip4_table_index - ip4 classify table index (~0 for skip)
400  @param ip6_table_index - ip6 classify table index (~0 for skip)
401  @param l2_table_index - l2 classify table index (~0 for skip)
402  @param is_add - Set output ACL if non-zero, else unset
403  Note: User is recommeneded to use just one valid table_index per call.
404  (ip4_table_index, ip6_table_index, or l2_table_index)
405 */
406 autoreply define output_acl_set_interface
407 {
415 };
416 
417 /*
418  * Local Variables:
419  * eval: (c-set-style "gnu")
420  * End:
421  */
422 
option version
Definition: classify.api:16
unsigned char u8
Definition: types.h:56
unsigned int u32
Definition: types.h:88
signed int i32
Definition: types.h:77
size_t count
Definition: vapi.c:47