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.0";
24 /** \brief Get the plugin version
25 @param client_index - opaque cookie to identify the sender
26 @param context - sender context, to match reply w/ request
29 define acl_plugin_get_version
35 /** \brief Reply to get the plugin version
36 @param context - returned sender context, to match reply w/ request
37 @param major - Incremented every time a known breaking behavior change is introduced
38 @param minor - Incremented with small changes, may be used to avoid buggy versions
41 define acl_plugin_get_version_reply
48 /** \brief Control ping from client to api server request
49 @param client_index - opaque cookie to identify the sender
50 @param context - sender context, to match reply w/ request
52 define acl_plugin_control_ping
58 /** \brief Control ping from the client to the server response
59 @param client_index - opaque cookie to identify the sender
60 @param context - sender context, to match reply w/ request
61 @param retval - return code for the request
62 @param vpe_pid - the pid of the vpe, returned by the server
64 define acl_plugin_control_ping_reply
72 /** \brief Access List Rule entry
73 @param is_permit - deny (0), permit (1), or permit+reflect(2) action on this rule.
74 @param is_ipv6 - IP addresses in this rule are IPv6 (1) or IPv4 (0)
75 @param src_ip_addr - Source prefix value
76 @param src_ip_prefix_len - Source prefix length
77 @param dst_ip_addr - Destination prefix value
78 @param dst_ip_prefix_len - Destination prefix length
79 @param proto - L4 protocol (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)
80 @param srcport_or_icmptype_first - beginning of source port or ICMP4/6 type range
81 @param srcport_or_icmptype_last - end of source port or ICMP4/6 type range
82 @param dstport_or_icmpcode_first - beginning of destination port or ICMP4/6 code range
83 @param dstport_or_icmpcode_last - end of destination port or ICMP4/6 code range
84 @param tcp_flags_mask - if proto==6, match masked TCP flags with this value
85 @param tcp_flags_value - if proto==6, mask to AND the TCP flags in the packet with
88 typeonly manual_print define acl_rule
97 * L4 protocol. IANA number. 1 = ICMP, 58 = ICMPv6, 6 = TCP, 17 = UDP.
98 * 0 => ignore L4 and ignore the ports/tcpflags when matching.
102 * If the L4 protocol is TCP or UDP, the below
103 * hold ranges of ports, else if the L4 is ICMP/ICMPv6
104 * they hold ranges of ICMP(v6) types/codes.
106 * Ranges are inclusive, i.e. to match "any" TCP/UDP port,
107 * use first=0,last=65535. For ICMP(v6),
108 * use first=0,last=255.
110 u16 srcport_or_icmptype_first;
111 u16 srcport_or_icmptype_last;
112 u16 dstport_or_icmpcode_first;
113 u16 dstport_or_icmpcode_last;
115 * for proto = 6, this matches if the
116 * TCP flags in the packet, ANDed with tcp_flags_mask,
117 * is equal to tcp_flags_value.
123 /** \brief MACIP Access List Rule entry
124 @param is_permit - deny (0), permit (1) action on this rule.
125 @param is_ipv6 - IP addresses in this rule are IPv6 (1) or IPv4 (0)
126 @param src_mac - match masked source MAC address against this value
127 @param src_mac_mask - AND source MAC address with this value before matching
128 @param src_ip_addr - Source prefix value
129 @param src_ip_prefix_len - Source prefix length
132 typeonly manual_print define macip_acl_rule
137 * The source mac of the packet ANDed with src_mac_mask.
138 * The source ip[46] address in the packet is matched
139 * against src_ip_addr, with src_ip_prefix_len set to 0.
141 * For better performance, minimize the number of
142 * (src_mac_mask, src_ip_prefix_len) combinations
148 u8 src_ip_prefix_len;
151 /** \brief Replace an existing ACL in-place or create a new ACL
152 @param client_index - opaque cookie to identify the sender
153 @param context - sender context, to match reply w/ request
154 @param acl_index - an existing ACL entry (0..0xfffffffe) to replace, or 0xffffffff to make new ACL
155 @param tag - a string value stored along with the ACL, for descriptive purposes
156 @param count - number of ACL rules
157 @r - Rules for this access-list
160 manual_print manual_endian define acl_add_replace
164 u32 acl_index; /* ~0 to add, existing ACL# to replace */
165 u8 tag[64]; /* What gets in here gets out in the corresponding tag field when dumping the ACLs. */
167 vl_api_acl_rule_t r[count];
170 /** \brief Reply to add/replace ACL
171 @param context - returned sender context, to match reply w/ request
172 @param acl_index - index of the updated or newly created ACL
173 @param retval 0 - no error
176 define acl_add_replace_reply
183 /** \brief Delete an ACL
184 @param client_index - opaque cookie to identify the sender
185 @param context - sender context, to match reply w/ request
186 @param acl_index - ACL index to delete
189 autoreply manual_print define acl_del
196 /* acl_interface_add_del(_reply) to be deprecated in lieu of acl_interface_set_acl_list */
197 /** \brief Use acl_interface_set_acl_list instead
198 Append/remove an ACL index to/from the list of ACLs checked for an interface
199 @param client_index - opaque cookie to identify the sender
200 @param context - sender context, to match reply w/ request
201 @param is_add - add or delete the ACL index from the list
202 @param is_input - check the ACL on input (1) or output (0)
203 @param sw_if_index - the interface to alter the list of ACLs on
204 @param acl_index - index of ACL for the operation
207 autoreply manual_print define acl_interface_add_del
213 * is_input = 0 => ACL applied on interface egress
214 * is_input = 1 => ACL applied on interface ingress
221 /** \brief Set the vector of input/output ACLs checked for an interface
222 @param client_index - opaque cookie to identify the sender
223 @param context - sender context, to match reply w/ request
224 @param sw_if_index - the interface to alter the list of ACLs on
225 @param count - total number of ACL indices in the vector
226 @param n_input - this many first elements correspond to input ACLs, the rest - output
227 @param acls - vector of ACL indices
230 autoreply manual_print define acl_interface_set_acl_list
236 u8 n_input; /* First n_input ACLs are set as a list of input ACLs, the rest are applied as output */
240 /** \brief Reply to set the ACL list on an interface
241 @param context - returned sender context, to match reply w/ request
242 @param retval 0 - no error
245 /** \brief Dump the specific ACL contents or all of the ACLs' contents
246 @param client_index - opaque cookie to identify the sender
247 @param context - sender context, to match reply w/ request
248 @param acl_index - ACL index to dump, ~0 to dump all ACLs
255 u32 acl_index; /* ~0 for all ACLs */
258 /** \brief Details about a single ACL contents
259 @param context - returned sender context, to match reply w/ request
260 @param acl_index - ACL index whose contents are being sent in this message
261 @param tag - Descriptive tag value which was supplied at ACL creation
262 @param count - Number of rules in this ACL
263 @param r - Array of rules within this ACL
266 manual_endian manual_print define acl_details
270 u8 tag[64]; /* Same blob that was supplied to us when creating the ACL, one hopes. */
272 vl_api_acl_rule_t r[count];
275 /** \brief Dump the list(s) of ACL applied to specific or all interfaces
276 @param client_index - opaque cookie to identify the sender
277 @param context - sender context, to match reply w/ request
278 @param sw_if_index - interface to dump the ACL list for
281 define acl_interface_list_dump
285 u32 sw_if_index; /* ~0 for all interfaces */
288 /** \brief Details about a single ACL contents
289 @param context - returned sender context, to match reply w/ request
290 @param sw_if_index - interface for which the list of ACLs is applied
291 @param count - total length of acl indices vector
292 @param n_input - this many of indices in the beginning are input ACLs, the rest - output
293 @param acls - the vector of ACL indices
296 define acl_interface_list_details
305 /** \brief Add a MACIP ACL
306 @param client_index - opaque cookie to identify the sender
307 @param context - sender context, to match reply w/ request
308 @param tag - descriptive value for this MACIP ACL
309 @param count - number of rules in this MACIP ACL
310 @param r - vector of MACIP ACL rules
313 manual_endian manual_print define macip_acl_add
319 vl_api_macip_acl_rule_t r[count];
322 /** \brief Reply to add MACIP ACL
323 @param context - returned sender context, to match reply w/ request
324 @param acl_index - index of the newly created MACIP ACL
325 @param retval 0 - no error
328 define macip_acl_add_reply
335 /** \brief Add/Replace a MACIP ACL
336 @param client_index - opaque cookie to identify the sender
337 @param context - sender context, to match reply w/ request
338 @param acl_index - an existing MACIP ACL entry (0..0xfffffffe) to replace, or 0xffffffff to make new MACIP ACL
339 @param tag - descriptive value for this MACIP ACL
340 @param count - number of rules in this MACIP ACL
341 @param r - vector of MACIP ACL rules
344 manual_endian manual_print define macip_acl_add_replace
348 u32 acl_index; /* ~0 to add, existing MACIP ACL# to replace */
351 vl_api_macip_acl_rule_t r[count];
354 /** \brief Reply to add/replace MACIP ACL
355 @param context - returned sender context, to match reply w/ request
356 @param acl_index - index of the newly created MACIP ACL
357 @param retval 0 - no error
360 define macip_acl_add_replace_reply
367 /** \brief Delete a MACIP ACL
368 @param client_index - opaque cookie to identify the sender
369 @param context - sender context, to match reply w/ request
370 @param acl_index - MACIP ACL index to delete
373 autoreply manual_print define macip_acl_del
380 /** \brief Add or delete a MACIP ACL to/from interface
381 @param client_index - opaque cookie to identify the sender
382 @param context - sender context, to match reply w/ request
383 @param is_add - add (1) or delete (0) MACIP ACL from being used on an interface
384 @param sw_if_index - interface to apply the action to
385 @param acl_index - MACIP ACL index
388 autoreply manual_print define macip_acl_interface_add_del
393 /* MACIP ACLs are always input */
398 /** \brief Dump one or all defined MACIP ACLs
399 @param client_index - opaque cookie to identify the sender
400 @param context - sender context, to match reply w/ request
401 @param acl_index - MACIP ACL index or ~0 to dump all MACIP ACLs
404 define macip_acl_dump
408 u32 acl_index; /* ~0 for all ACLs */
411 /** \brief Details about one MACIP ACL
412 @param context - returned sender context, to match reply w/ request
413 @param acl_index - index of this MACIP ACL
414 @param tag - descriptive tag which was supplied during the creation
415 @param count - length of the vector of MACIP ACL rules
416 @param r - rules comprising this MACIP ACL
419 manual_endian manual_print define macip_acl_details
425 vl_api_macip_acl_rule_t r[count];
428 /** \brief Get the vector of MACIP ACL IDs applied to the interfaces
429 @param client_index - opaque cookie to identify the sender
430 @param context - sender context, to match reply w/ request
433 define macip_acl_interface_get
439 /** \brief Reply with the vector of MACIP ACLs by sw_if_index
440 @param context - returned sender context, to match reply w/ request
441 @param count - total number of elements in the vector
442 @param acls - the vector of active MACIP ACL indices per sw_if_index
445 define macip_acl_interface_get_reply
452 /** \brief Dump the list(s) of MACIP ACLs applied to specific or all interfaces
453 @param client_index - opaque cookie to identify the sender
454 @param context - sender context, to match reply w/ request
455 @param sw_if_index - interface to dump the MACIP ACL list for
458 define macip_acl_interface_list_dump
462 u32 sw_if_index; /* ~0 for all interfaces */
465 /** \brief Details about a single MACIP ACL contents
466 @param context - returned sender context, to match reply w/ request
467 @param sw_if_index - interface for which the list of MACIP ACLs is applied
468 @param count - total length of acl indices vector
469 @param acls - the vector of MACIP ACL indices
472 define macip_acl_interface_list_details
480 /** \brief Set the ethertype whitelists on an interface. Takes effect when applying ACLs on the interface, so must be given prior.
481 @param client_index - opaque cookie to identify the sender
482 @param context - sender context, to match reply w/ request
483 @param sw_if_index - the interface to alter the list of ACLs on
484 @param count - total number of whitelisted ethertypes in the vector
485 @param n_input - this many first elements correspond to input whitelisted ethertypes, the rest - output
486 @param whitelist - vector of whitelisted ethertypes
489 autoreply manual_print define acl_interface_set_etype_whitelist
494 u8 count; /* Total number of ethertypes in the whitelist */
495 u8 n_input; /* first n_input ethertypes are input, the rest - output */
496 u16 whitelist[count];