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];
112 option vat_help = "<acl-idx> [<ipv4|ipv6>] <permit|permit+reflect|deny|action N> [src IP/plen] [dst IP/plen] [sport X-Y] [dport X-Y] [proto P] [tcpflags FL MASK], ... , ...";
115 /** \brief Reply to add/replace ACL
116 @param context - returned sender context, to match reply w/ request
117 @param acl_index - index of the updated or newly created ACL
118 @param retval 0 - no error
121 define acl_add_replace_reply
128 /** \brief Delete an ACL
129 @param client_index - opaque cookie to identify the sender
130 @param context - sender context, to match reply w/ request
131 @param acl_index - ACL index to delete
134 autoreply manual_print define acl_del
139 option vat_help = "<acl-idx>";
142 /* acl_interface_add_del(_reply) to be deprecated in lieu of acl_interface_set_acl_list */
143 /** \brief Use acl_interface_set_acl_list instead
144 Append/remove an ACL index to/from the list of ACLs checked for an interface
145 @param client_index - opaque cookie to identify the sender
146 @param context - sender context, to match reply w/ request
147 @param is_add - add or delete the ACL index from the list
148 @param is_input - check the ACL on input (1) or output (0)
149 @param sw_if_index - the interface to alter the list of ACLs on
150 @param acl_index - index of ACL for the operation
153 autoreply manual_print define acl_interface_add_del
159 * is_input = 0 => ACL applied on interface egress
160 * is_input = 1 => ACL applied on interface ingress
165 option vat_help = "<intfc> | sw_if_index <if-idx> [add|del] [input|output] acl <acl-idx>";
168 /** \brief Set the vector of input/output ACLs checked for an interface
169 @param client_index - opaque cookie to identify the sender
170 @param context - sender context, to match reply w/ request
171 @param sw_if_index - the interface to alter the list of ACLs on
172 @param count - total number of ACL indices in the vector
173 @param n_input - this many first elements correspond to input ACLs, the rest - output
174 @param acls - vector of ACL indices
177 autoreply manual_print define acl_interface_set_acl_list
183 u8 n_input; /* First n_input ACLs are set as a list of input ACLs, the rest are applied as output */
185 option vat_help = "<intfc> | sw_if_index <if-idx> input [acl-idx list] output [acl-idx list]";
188 /** \brief Reply to set the ACL list on an interface
189 @param context - returned sender context, to match reply w/ request
190 @param retval 0 - no error
193 /** \brief Dump the specific ACL contents or all of the ACLs' contents
194 @param client_index - opaque cookie to identify the sender
195 @param context - sender context, to match reply w/ request
196 @param acl_index - ACL index to dump, ~0 to dump all ACLs
203 u32 acl_index; /* ~0 for all ACLs */
204 option vat_help = "[<acl-idx>]";
207 /** \brief Details about a single ACL contents
208 @param context - returned sender context, to match reply w/ request
209 @param acl_index - ACL index whose contents are being sent in this message
210 @param tag - Descriptive tag value which was supplied at ACL creation
211 @param count - Number of rules in this ACL
212 @param r - Array of rules within this ACL
215 manual_endian manual_print define acl_details
219 u8 tag[64]; /* Same blob that was supplied to us when creating the ACL, one hopes. */
221 vl_api_acl_rule_t r[count];
224 /** \brief Dump the list(s) of ACL applied to specific or all interfaces
225 @param client_index - opaque cookie to identify the sender
226 @param context - sender context, to match reply w/ request
227 @param sw_if_index - interface to dump the ACL list for
230 define acl_interface_list_dump
234 u32 sw_if_index; /* ~0 for all interfaces */
235 option vat_help = "[<intfc> | sw_if_index <if-idx>]";
238 /** \brief Details about a single ACL contents
239 @param context - returned sender context, to match reply w/ request
240 @param sw_if_index - interface for which the list of ACLs is applied
241 @param count - total length of acl indices vector
242 @param n_input - this many of indices in the beginning are input ACLs, the rest - output
243 @param acls - the vector of ACL indices
246 define acl_interface_list_details
255 /** \brief Add a MACIP ACL
256 @param client_index - opaque cookie to identify the sender
257 @param context - sender context, to match reply w/ request
258 @param tag - descriptive value for this MACIP ACL
259 @param count - number of rules in this MACIP ACL
260 @param r - vector of MACIP ACL rules
263 manual_endian manual_print define macip_acl_add
269 vl_api_macip_acl_rule_t r[count];
270 option vat_help = "...";
273 /** \brief Reply to add MACIP ACL
274 @param context - returned sender context, to match reply w/ request
275 @param acl_index - index of the newly created MACIP ACL
276 @param retval 0 - no error
279 define macip_acl_add_reply
286 /** \brief Add/Replace a MACIP ACL
287 @param client_index - opaque cookie to identify the sender
288 @param context - sender context, to match reply w/ request
289 @param acl_index - an existing MACIP ACL entry (0..0xfffffffe) to replace, or 0xffffffff to make new MACIP ACL
290 @param tag - descriptive value for this MACIP ACL
291 @param count - number of rules in this MACIP ACL
292 @param r - vector of MACIP ACL rules
295 manual_endian manual_print define macip_acl_add_replace
299 u32 acl_index; /* ~0 to add, existing MACIP ACL# to replace */
302 vl_api_macip_acl_rule_t r[count];
303 option vat_help = "<acl-idx> [<ipv4|ipv6>] <permit|deny|action N> [count <count>] [src] ip <ipaddress/[plen]> mac <mac> mask <mac_mask>, ... , ...";
306 /** \brief Reply to add/replace MACIP ACL
307 @param context - returned sender context, to match reply w/ request
308 @param acl_index - index of the newly created MACIP ACL
309 @param retval 0 - no error
312 define macip_acl_add_replace_reply
319 /** \brief Delete a MACIP ACL
320 @param client_index - opaque cookie to identify the sender
321 @param context - sender context, to match reply w/ request
322 @param acl_index - MACIP ACL index to delete
325 autoreply manual_print define macip_acl_del
330 option vat_help = "<acl-idx>";
333 /** \brief Add or delete a MACIP ACL to/from interface
334 @param client_index - opaque cookie to identify the sender
335 @param context - sender context, to match reply w/ request
336 @param is_add - add (1) or delete (0) MACIP ACL from being used on an interface
337 @param sw_if_index - interface to apply the action to
338 @param acl_index - MACIP ACL index
341 autoreply manual_print define macip_acl_interface_add_del
346 /* MACIP ACLs are always input */
349 option vat_help = "<intfc> | sw_if_index <if-idx> [add|del] acl <acl-idx>";
352 /** \brief Dump one or all defined MACIP ACLs
353 @param client_index - opaque cookie to identify the sender
354 @param context - sender context, to match reply w/ request
355 @param acl_index - MACIP ACL index or ~0 to dump all MACIP ACLs
358 define macip_acl_dump
362 u32 acl_index; /* ~0 for all ACLs */
363 option vat_help = "[<acl-idx>]";
366 /** \brief Details about one MACIP ACL
367 @param context - returned sender context, to match reply w/ request
368 @param acl_index - index of this MACIP ACL
369 @param tag - descriptive tag which was supplied during the creation
370 @param count - length of the vector of MACIP ACL rules
371 @param r - rules comprising this MACIP ACL
374 manual_endian manual_print define macip_acl_details
380 vl_api_macip_acl_rule_t r[count];
383 /** \brief Get the vector of MACIP ACL IDs applied to the interfaces
384 @param client_index - opaque cookie to identify the sender
385 @param context - sender context, to match reply w/ request
388 define macip_acl_interface_get
394 /** \brief Reply with the vector of MACIP ACLs by sw_if_index
395 @param context - returned sender context, to match reply w/ request
396 @param count - total number of elements in the vector
397 @param acls - the vector of active MACIP ACL indices per sw_if_index
400 define macip_acl_interface_get_reply
407 /** \brief Dump the list(s) of MACIP ACLs applied to specific or all interfaces
408 @param client_index - opaque cookie to identify the sender
409 @param context - sender context, to match reply w/ request
410 @param sw_if_index - interface to dump the MACIP ACL list for
413 define macip_acl_interface_list_dump
417 u32 sw_if_index; /* ~0 for all interfaces */
420 /** \brief Details about a single MACIP ACL contents
421 @param context - returned sender context, to match reply w/ request
422 @param sw_if_index - interface for which the list of MACIP ACLs is applied
423 @param count - total length of acl indices vector
424 @param acls - the vector of MACIP ACL indices
427 define macip_acl_interface_list_details
435 /** \brief Set the ethertype whitelists on an interface. Takes effect when applying ACLs on the interface, so must be given prior.
436 @param client_index - opaque cookie to identify the sender
437 @param context - sender context, to match reply w/ request
438 @param sw_if_index - the interface to alter the list of ACLs on
439 @param count - total number of whitelisted ethertypes in the vector
440 @param n_input - this many first elements correspond to input whitelisted ethertypes, the rest - output
441 @param whitelist - vector of whitelisted ethertypes
444 autoreply manual_print define acl_interface_set_etype_whitelist
449 u8 count; /* Total number of ethertypes in the whitelist */
450 u8 n_input; /* first n_input ethertypes are input, the rest - output */
451 u16 whitelist[count];
452 option vat_help = "<intfc> | sw_if_index <if-idx> input [ethertype list] output [ethertype list]";
455 /** \brief Dump the list(s) of Ethertype whitelists applied to specific or all interfaces
456 @param client_index - opaque cookie to identify the sender
457 @param context - sender context, to match reply w/ request
458 @param sw_if_index - interface to dump the ethertype whitelist for
461 define acl_interface_etype_whitelist_dump
465 u32 sw_if_index; /* ~0 for all interfaces */
466 option vat_help = "[<intfc> | sw_if_index <if-idx>]";
469 /** \brief Details about ethertype whitelist on a single interface
470 @param context - returned sender context, to match reply w/ request
471 @param sw_if_index - interface for which the list of MACIP ACLs is applied
472 @param count - total number of whitelisted ethertypes in the vector
473 @param n_input - this many first elements correspond to input whitelisted ethertypes, the rest - output
474 @param whitelist - vector of whitelisted ethertypes
477 define acl_interface_etype_whitelist_details
482 u8 n_input; /* first n_input ethertypes are input, the rest - output */
483 u16 whitelist[count];
486 /** \brief Enable or disable incrementing ACL counters in stats segment by interface processing
487 @param client_index - opaque cookie to identify the sender
488 @param context - sender context, to match reply w/ request
489 @param enable - whether to enable or disable incrementing the counters
492 autoreply define acl_stats_intf_counters_enable
497 option vat_help = "[disable]";