1 /* Hey Emacs use -*- mode: C -*- */
3 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 This file defines the vpp control-plane API messages
19 used to control the ACL plugin
22 option version = "1.0.1";
24 import "plugins/acl/acl_types.api";
26 /** \brief Get the plugin version
27 @param client_index - opaque cookie to identify the sender
28 @param context - sender context, to match reply w/ request
31 define acl_plugin_get_version
37 /** \brief Reply to get the plugin version
38 @param context - returned sender context, to match reply w/ request
39 @param major - Incremented every time a known breaking behavior change is introduced
40 @param minor - Incremented with small changes, may be used to avoid buggy versions
43 define acl_plugin_get_version_reply
50 /** \brief Control ping from client to api server request
51 @param client_index - opaque cookie to identify the sender
52 @param context - sender context, to match reply w/ request
54 define acl_plugin_control_ping
60 /** \brief Control ping from the client to the server response
61 @param client_index - opaque cookie to identify the sender
62 @param context - sender context, to match reply w/ request
63 @param retval - return code for the request
64 @param vpe_pid - the pid of the vpe, returned by the server
66 define acl_plugin_control_ping_reply
74 /** \brief Get Connection table max entries
75 @param client_index - opaque cookie to identify the sender
76 @param context - sender context, to match reply w/ request
79 define acl_plugin_get_conn_table_max_entries
85 /** \brief Reply to get connection table max entries
86 @param context - sender context, to match reply w/ request
87 @param conn_table_max_entries - the value of maximum entries of connection table
89 define acl_plugin_get_conn_table_max_entries_reply
92 u64 conn_table_max_entries;
95 /** \brief Replace an existing ACL in-place or create a new ACL
96 @param client_index - opaque cookie to identify the sender
97 @param context - sender context, to match reply w/ request
98 @param acl_index - an existing ACL entry (0..0xfffffffe) to replace, or 0xffffffff to make new ACL
99 @param tag - a string value stored along with the ACL, for descriptive purposes
100 @param count - number of ACL rules
101 @r - Rules for this access-list
104 manual_print manual_endian define acl_add_replace
108 u32 acl_index; /* ~0 to add, existing ACL# to replace */
109 u8 tag[64]; /* What gets in here gets out in the corresponding tag field when dumping the ACLs. */
111 vl_api_acl_rule_t r[count];
114 /** \brief Reply to add/replace ACL
115 @param context - returned sender context, to match reply w/ request
116 @param acl_index - index of the updated or newly created ACL
117 @param retval 0 - no error
120 define acl_add_replace_reply
127 /** \brief Delete an ACL
128 @param client_index - opaque cookie to identify the sender
129 @param context - sender context, to match reply w/ request
130 @param acl_index - ACL index to delete
133 autoreply manual_print define acl_del
140 /* acl_interface_add_del(_reply) to be deprecated in lieu of acl_interface_set_acl_list */
141 /** \brief Use acl_interface_set_acl_list instead
142 Append/remove an ACL index to/from the list of ACLs checked for an interface
143 @param client_index - opaque cookie to identify the sender
144 @param context - sender context, to match reply w/ request
145 @param is_add - add or delete the ACL index from the list
146 @param is_input - check the ACL on input (1) or output (0)
147 @param sw_if_index - the interface to alter the list of ACLs on
148 @param acl_index - index of ACL for the operation
151 autoreply manual_print define acl_interface_add_del
157 * is_input = 0 => ACL applied on interface egress
158 * is_input = 1 => ACL applied on interface ingress
165 /** \brief Set the vector of input/output ACLs checked for an interface
166 @param client_index - opaque cookie to identify the sender
167 @param context - sender context, to match reply w/ request
168 @param sw_if_index - the interface to alter the list of ACLs on
169 @param count - total number of ACL indices in the vector
170 @param n_input - this many first elements correspond to input ACLs, the rest - output
171 @param acls - vector of ACL indices
174 autoreply manual_print define acl_interface_set_acl_list
180 u8 n_input; /* First n_input ACLs are set as a list of input ACLs, the rest are applied as output */
184 /** \brief Reply to set the ACL list on an interface
185 @param context - returned sender context, to match reply w/ request
186 @param retval 0 - no error
189 /** \brief Dump the specific ACL contents or all of the ACLs' contents
190 @param client_index - opaque cookie to identify the sender
191 @param context - sender context, to match reply w/ request
192 @param acl_index - ACL index to dump, ~0 to dump all ACLs
199 u32 acl_index; /* ~0 for all ACLs */
202 /** \brief Details about a single ACL contents
203 @param context - returned sender context, to match reply w/ request
204 @param acl_index - ACL index whose contents are being sent in this message
205 @param tag - Descriptive tag value which was supplied at ACL creation
206 @param count - Number of rules in this ACL
207 @param r - Array of rules within this ACL
210 manual_endian manual_print define acl_details
214 u8 tag[64]; /* Same blob that was supplied to us when creating the ACL, one hopes. */
216 vl_api_acl_rule_t r[count];
219 /** \brief Dump the list(s) of ACL applied to specific or all interfaces
220 @param client_index - opaque cookie to identify the sender
221 @param context - sender context, to match reply w/ request
222 @param sw_if_index - interface to dump the ACL list for
225 define acl_interface_list_dump
229 u32 sw_if_index; /* ~0 for all interfaces */
232 /** \brief Details about a single ACL contents
233 @param context - returned sender context, to match reply w/ request
234 @param sw_if_index - interface for which the list of ACLs is applied
235 @param count - total length of acl indices vector
236 @param n_input - this many of indices in the beginning are input ACLs, the rest - output
237 @param acls - the vector of ACL indices
240 define acl_interface_list_details
249 /** \brief Add a MACIP ACL
250 @param client_index - opaque cookie to identify the sender
251 @param context - sender context, to match reply w/ request
252 @param tag - descriptive value for this MACIP ACL
253 @param count - number of rules in this MACIP ACL
254 @param r - vector of MACIP ACL rules
257 manual_endian manual_print define macip_acl_add
263 vl_api_macip_acl_rule_t r[count];
266 /** \brief Reply to add MACIP ACL
267 @param context - returned sender context, to match reply w/ request
268 @param acl_index - index of the newly created MACIP ACL
269 @param retval 0 - no error
272 define macip_acl_add_reply
279 /** \brief Add/Replace a MACIP ACL
280 @param client_index - opaque cookie to identify the sender
281 @param context - sender context, to match reply w/ request
282 @param acl_index - an existing MACIP ACL entry (0..0xfffffffe) to replace, or 0xffffffff to make new MACIP ACL
283 @param tag - descriptive value for this MACIP ACL
284 @param count - number of rules in this MACIP ACL
285 @param r - vector of MACIP ACL rules
288 manual_endian manual_print define macip_acl_add_replace
292 u32 acl_index; /* ~0 to add, existing MACIP ACL# to replace */
295 vl_api_macip_acl_rule_t r[count];
298 /** \brief Reply to add/replace MACIP ACL
299 @param context - returned sender context, to match reply w/ request
300 @param acl_index - index of the newly created MACIP ACL
301 @param retval 0 - no error
304 define macip_acl_add_replace_reply
311 /** \brief Delete a MACIP ACL
312 @param client_index - opaque cookie to identify the sender
313 @param context - sender context, to match reply w/ request
314 @param acl_index - MACIP ACL index to delete
317 autoreply manual_print define macip_acl_del
324 /** \brief Add or delete a MACIP ACL to/from interface
325 @param client_index - opaque cookie to identify the sender
326 @param context - sender context, to match reply w/ request
327 @param is_add - add (1) or delete (0) MACIP ACL from being used on an interface
328 @param sw_if_index - interface to apply the action to
329 @param acl_index - MACIP ACL index
332 autoreply manual_print define macip_acl_interface_add_del
337 /* MACIP ACLs are always input */
342 /** \brief Dump one or all defined MACIP ACLs
343 @param client_index - opaque cookie to identify the sender
344 @param context - sender context, to match reply w/ request
345 @param acl_index - MACIP ACL index or ~0 to dump all MACIP ACLs
348 define macip_acl_dump
352 u32 acl_index; /* ~0 for all ACLs */
355 /** \brief Details about one MACIP ACL
356 @param context - returned sender context, to match reply w/ request
357 @param acl_index - index of this MACIP ACL
358 @param tag - descriptive tag which was supplied during the creation
359 @param count - length of the vector of MACIP ACL rules
360 @param r - rules comprising this MACIP ACL
363 manual_endian manual_print define macip_acl_details
369 vl_api_macip_acl_rule_t r[count];
372 /** \brief Get the vector of MACIP ACL IDs applied to the interfaces
373 @param client_index - opaque cookie to identify the sender
374 @param context - sender context, to match reply w/ request
377 define macip_acl_interface_get
383 /** \brief Reply with the vector of MACIP ACLs by sw_if_index
384 @param context - returned sender context, to match reply w/ request
385 @param count - total number of elements in the vector
386 @param acls - the vector of active MACIP ACL indices per sw_if_index
389 define macip_acl_interface_get_reply
396 /** \brief Dump the list(s) of MACIP ACLs applied to specific or all interfaces
397 @param client_index - opaque cookie to identify the sender
398 @param context - sender context, to match reply w/ request
399 @param sw_if_index - interface to dump the MACIP ACL list for
402 define macip_acl_interface_list_dump
406 u32 sw_if_index; /* ~0 for all interfaces */
409 /** \brief Details about a single MACIP ACL contents
410 @param context - returned sender context, to match reply w/ request
411 @param sw_if_index - interface for which the list of MACIP ACLs is applied
412 @param count - total length of acl indices vector
413 @param acls - the vector of MACIP ACL indices
416 define macip_acl_interface_list_details
424 /** \brief Set the ethertype whitelists on an interface. Takes effect when applying ACLs on the interface, so must be given prior.
425 @param client_index - opaque cookie to identify the sender
426 @param context - sender context, to match reply w/ request
427 @param sw_if_index - the interface to alter the list of ACLs on
428 @param count - total number of whitelisted ethertypes in the vector
429 @param n_input - this many first elements correspond to input whitelisted ethertypes, the rest - output
430 @param whitelist - vector of whitelisted ethertypes
433 autoreply manual_print define acl_interface_set_etype_whitelist
438 u8 count; /* Total number of ethertypes in the whitelist */
439 u8 n_input; /* first n_input ethertypes are input, the rest - output */
440 u16 whitelist[count];
443 /** \brief Dump the list(s) of Ethertype whitelists applied to specific or all interfaces
444 @param client_index - opaque cookie to identify the sender
445 @param context - sender context, to match reply w/ request
446 @param sw_if_index - interface to dump the ethertype whitelist for
449 define acl_interface_etype_whitelist_dump
453 u32 sw_if_index; /* ~0 for all interfaces */
456 /** \brief Details about ethertype whitelist on a single interface
457 @param context - returned sender context, to match reply w/ request
458 @param sw_if_index - interface for which the list of MACIP ACLs is applied
459 @param count - total number of whitelisted ethertypes in the vector
460 @param n_input - this many first elements correspond to input whitelisted ethertypes, the rest - output
461 @param whitelist - vector of whitelisted ethertypes
464 define acl_interface_etype_whitelist_details
469 u8 n_input; /* first n_input ethertypes are input, the rest - output */
470 u16 whitelist[count];
473 /** \brief Enable or disable incrementing ACL counters in stats segment by interface processing
474 @param client_index - opaque cookie to identify the sender
475 @param context - sender context, to match reply w/ request
476 @param enable - whether to enable or disable incrementing the counters
479 autoreply define acl_stats_intf_counters_enable