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 = "2.0.0";
24 import "plugins/acl/acl_types.api";
25 import "vnet/interface_types.api";
27 /** \brief Get the plugin version
28 @param client_index - opaque cookie to identify the sender
29 @param context - sender context, to match reply w/ request
32 define acl_plugin_get_version
38 /** \brief Reply to get the plugin version
39 @param context - returned sender context, to match reply w/ request
40 @param major - Incremented every time a known breaking behavior change is introduced
41 @param minor - Incremented with small changes, may be used to avoid buggy versions
44 define acl_plugin_get_version_reply
51 /** \brief Control ping from client to api server request
52 @param client_index - opaque cookie to identify the sender
53 @param context - sender context, to match reply w/ request
55 define acl_plugin_control_ping
61 /** \brief Control ping from the client to the server response
62 @param client_index - opaque cookie to identify the sender
63 @param context - sender context, to match reply w/ request
64 @param retval - return code for the request
65 @param vpe_pid - the pid of the vpe, returned by the server
67 define acl_plugin_control_ping_reply
75 /** \brief Get Connection table max entries
76 @param client_index - opaque cookie to identify the sender
77 @param context - sender context, to match reply w/ request
80 define acl_plugin_get_conn_table_max_entries
86 /** \brief Reply to get connection table max entries
87 @param context - sender context, to match reply w/ request
88 @param conn_table_max_entries - the value of maximum entries of connection table
90 define acl_plugin_get_conn_table_max_entries_reply
93 u64 conn_table_max_entries;
96 /** \brief Replace an existing ACL in-place or create a new ACL
97 @param client_index - opaque cookie to identify the sender
98 @param context - sender context, to match reply w/ request
99 @param acl_index - an existing ACL entry (0..0xfffffffe) to replace, or 0xffffffff to make new ACL
100 @param tag - a string value stored along with the ACL, for descriptive purposes
101 @param count - number of ACL rules
102 @r - Rules for this access-list
105 manual_print manual_endian define acl_add_replace
109 u32 acl_index; /* ~0 to add, existing ACL# to replace */
110 string tag[64]; /* What gets in here gets out in the corresponding tag field when dumping the ACLs. */
112 vl_api_acl_rule_t r[count];
113 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], ... , ...";
116 /** \brief Reply to add/replace ACL
117 @param context - returned sender context, to match reply w/ request
118 @param acl_index - index of the updated or newly created ACL
119 @param retval 0 - no error
122 define acl_add_replace_reply
129 /** \brief Delete an ACL
130 @param client_index - opaque cookie to identify the sender
131 @param context - sender context, to match reply w/ request
132 @param acl_index - ACL index to delete
135 autoreply manual_print define acl_del
140 option vat_help = "<acl-idx>";
143 /* acl_interface_add_del(_reply) to be deprecated in lieu of acl_interface_set_acl_list */
144 /** \brief Use acl_interface_set_acl_list instead
145 Append/remove an ACL index to/from the list of ACLs checked for an interface
146 @param client_index - opaque cookie to identify the sender
147 @param context - sender context, to match reply w/ request
148 @param is_add - add or delete the ACL index from the list
149 @param is_input - check the ACL on input (1) or output (0)
150 @param sw_if_index - the interface to alter the list of ACLs on
151 @param acl_index - index of ACL for the operation
154 autoreply manual_print define acl_interface_add_del
158 bool is_add [default=true];
160 * is_input = 0 => ACL applied on interface egress
161 * is_input = 1 => ACL applied on interface ingress
164 vl_api_interface_index_t sw_if_index;
166 option vat_help = "<intfc> | sw_if_index <if-idx> [add|del] [input|output] acl <acl-idx>";
169 /** \brief Set the vector of input/output ACLs checked for an interface
170 @param client_index - opaque cookie to identify the sender
171 @param context - sender context, to match reply w/ request
172 @param sw_if_index - the interface to alter the list of ACLs on
173 @param count - total number of ACL indices in the vector
174 @param n_input - this many first elements correspond to input ACLs, the rest - output
175 @param acls - vector of ACL indices
178 autoreply manual_print define acl_interface_set_acl_list
182 vl_api_interface_index_t sw_if_index;
184 u8 n_input; /* First n_input ACLs are set as a list of input ACLs, the rest are applied as output */
186 option vat_help = "<intfc> | sw_if_index <if-idx> input [acl-idx list] output [acl-idx list]";
189 /** \brief Reply to set the ACL list on an interface
190 @param context - returned sender context, to match reply w/ request
191 @param retval 0 - no error
194 /** \brief Dump the specific ACL contents or all of the ACLs' contents
195 @param client_index - opaque cookie to identify the sender
196 @param context - sender context, to match reply w/ request
197 @param acl_index - ACL index to dump, ~0 to dump all ACLs
204 u32 acl_index; /* ~0 for all ACLs */
205 option vat_help = "[<acl-idx>]";
208 /** \brief Details about a single ACL contents
209 @param context - returned sender context, to match reply w/ request
210 @param acl_index - ACL index whose contents are being sent in this message
211 @param tag - Descriptive tag value which was supplied at ACL creation
212 @param count - Number of rules in this ACL
213 @param r - Array of rules within this ACL
216 manual_endian manual_print define acl_details
220 string tag[64]; /* Same blob that was supplied to us when creating the ACL, one hopes. */
222 vl_api_acl_rule_t r[count];
225 /** \brief Dump the list(s) of ACL applied to specific or all interfaces
226 @param client_index - opaque cookie to identify the sender
227 @param context - sender context, to match reply w/ request
228 @param sw_if_index - interface to dump the ACL list for
231 define acl_interface_list_dump
235 vl_api_interface_index_t sw_if_index; /* ~0 for all interfaces */
236 option vat_help = "[<intfc> | sw_if_index <if-idx>]";
239 /** \brief Details about a single ACL contents
240 @param context - returned sender context, to match reply w/ request
241 @param sw_if_index - interface for which the list of ACLs is applied
242 @param count - total length of acl indices vector
243 @param n_input - this many of indices in the beginning are input ACLs, the rest - output
244 @param acls - the vector of ACL indices
247 define acl_interface_list_details
250 vl_api_interface_index_t sw_if_index;
256 /** \brief Add a MACIP ACL
257 @param client_index - opaque cookie to identify the sender
258 @param context - sender context, to match reply w/ request
259 @param tag - descriptive value for this MACIP ACL
260 @param count - number of rules in this MACIP ACL
261 @param r - vector of MACIP ACL rules
264 manual_endian manual_print define macip_acl_add
270 vl_api_macip_acl_rule_t r[count];
271 option vat_help = "...";
274 /** \brief Reply to add MACIP ACL
275 @param context - returned sender context, to match reply w/ request
276 @param acl_index - index of the newly created MACIP ACL
277 @param retval 0 - no error
280 define macip_acl_add_reply
287 /** \brief Add/Replace a MACIP ACL
288 @param client_index - opaque cookie to identify the sender
289 @param context - sender context, to match reply w/ request
290 @param acl_index - an existing MACIP ACL entry (0..0xfffffffe) to replace, or 0xffffffff to make new MACIP ACL
291 @param tag - descriptive value for this MACIP ACL
292 @param count - number of rules in this MACIP ACL
293 @param r - vector of MACIP ACL rules
296 manual_endian manual_print define macip_acl_add_replace
300 u32 acl_index; /* ~0 to add, existing MACIP ACL# to replace */
303 vl_api_macip_acl_rule_t r[count];
304 option vat_help = "<acl-idx> [<ipv4|ipv6>] <permit|deny|action N> [count <count>] [src] ip <ipaddress/[plen]> mac <mac> mask <mac_mask>, ... , ...";
307 /** \brief Reply to add/replace MACIP ACL
308 @param context - returned sender context, to match reply w/ request
309 @param acl_index - index of the newly created MACIP ACL
310 @param retval 0 - no error
313 define macip_acl_add_replace_reply
320 /** \brief Delete a MACIP ACL
321 @param client_index - opaque cookie to identify the sender
322 @param context - sender context, to match reply w/ request
323 @param acl_index - MACIP ACL index to delete
326 autoreply manual_print define macip_acl_del
331 option vat_help = "<acl-idx>";
334 /** \brief Add or delete a MACIP ACL to/from interface
335 @param client_index - opaque cookie to identify the sender
336 @param context - sender context, to match reply w/ request
337 @param is_add - add (1) or delete (0) MACIP ACL from being used on an interface
338 @param sw_if_index - interface to apply the action to
339 @param acl_index - MACIP ACL index
342 autoreply manual_print define macip_acl_interface_add_del
346 bool is_add [default=true];
347 /* MACIP ACLs are always input */
348 vl_api_interface_index_t sw_if_index;
350 option vat_help = "<intfc> | sw_if_index <if-idx> [add|del] acl <acl-idx>";
353 /** \brief Dump one or all defined MACIP ACLs
354 @param client_index - opaque cookie to identify the sender
355 @param context - sender context, to match reply w/ request
356 @param acl_index - MACIP ACL index or ~0 to dump all MACIP ACLs
359 define macip_acl_dump
363 u32 acl_index; /* ~0 for all ACLs */
364 option vat_help = "[<acl-idx>]";
367 /** \brief Details about one MACIP ACL
368 @param context - returned sender context, to match reply w/ request
369 @param acl_index - index of this MACIP ACL
370 @param tag - descriptive tag which was supplied during the creation
371 @param count - length of the vector of MACIP ACL rules
372 @param r - rules comprising this MACIP ACL
375 manual_endian manual_print define macip_acl_details
381 vl_api_macip_acl_rule_t r[count];
384 /** \brief Get the vector of MACIP ACL IDs applied to the interfaces
385 @param client_index - opaque cookie to identify the sender
386 @param context - sender context, to match reply w/ request
389 define macip_acl_interface_get
395 /** \brief Reply with the vector of MACIP ACLs by sw_if_index
396 @param context - returned sender context, to match reply w/ request
397 @param count - total number of elements in the vector
398 @param acls - the vector of active MACIP ACL indices per sw_if_index
401 define macip_acl_interface_get_reply
408 /** \brief Dump the list(s) of MACIP ACLs applied to specific or all interfaces
409 @param client_index - opaque cookie to identify the sender
410 @param context - sender context, to match reply w/ request
411 @param sw_if_index - interface to dump the MACIP ACL list for
414 define macip_acl_interface_list_dump
418 vl_api_interface_index_t sw_if_index; /* ~0 for all interfaces */
421 /** \brief Details about a single MACIP ACL contents
422 @param context - returned sender context, to match reply w/ request
423 @param sw_if_index - interface for which the list of MACIP ACLs is applied
424 @param count - total length of acl indices vector
425 @param acls - the vector of MACIP ACL indices
428 define macip_acl_interface_list_details
431 vl_api_interface_index_t sw_if_index;
436 /** \brief Set the ethertype whitelists on an interface. Takes effect when applying ACLs on the interface, so must be given prior.
437 @param client_index - opaque cookie to identify the sender
438 @param context - sender context, to match reply w/ request
439 @param sw_if_index - the interface to alter the list of ACLs on
440 @param count - total number of whitelisted ethertypes in the vector
441 @param n_input - this many first elements correspond to input whitelisted ethertypes, the rest - output
442 @param whitelist - vector of whitelisted ethertypes
445 autoreply manual_print define acl_interface_set_etype_whitelist
449 vl_api_interface_index_t sw_if_index;
450 u8 count; /* Total number of ethertypes in the whitelist */
451 u8 n_input; /* first n_input ethertypes are input, the rest - output */
452 u16 whitelist[count];
453 option vat_help = "<intfc> | sw_if_index <if-idx> input [ethertype list] output [ethertype list]";
456 /** \brief Dump the list(s) of Ethertype whitelists applied to specific or all interfaces
457 @param client_index - opaque cookie to identify the sender
458 @param context - sender context, to match reply w/ request
459 @param sw_if_index - interface to dump the ethertype whitelist for
462 define acl_interface_etype_whitelist_dump
466 vl_api_interface_index_t sw_if_index; /* ~0 for all interfaces */
467 option vat_help = "[<intfc> | sw_if_index <if-idx>]";
470 /** \brief Details about ethertype whitelist on a single interface
471 @param context - returned sender context, to match reply w/ request
472 @param sw_if_index - interface for which the list of MACIP ACLs is applied
473 @param count - total number of whitelisted ethertypes in the vector
474 @param n_input - this many first elements correspond to input whitelisted ethertypes, the rest - output
475 @param whitelist - vector of whitelisted ethertypes
478 define acl_interface_etype_whitelist_details
481 vl_api_interface_index_t sw_if_index;
483 u8 n_input; /* first n_input ethertypes are input, the rest - output */
484 u16 whitelist[count];
487 /** \brief Enable or disable incrementing ACL counters in stats segment by interface processing
488 @param client_index - opaque cookie to identify the sender
489 @param context - sender context, to match reply w/ request
490 @param enable - whether to enable or disable incrementing the counters
493 autoreply define acl_stats_intf_counters_enable
498 option vat_help = "[disable]";