2 * Copyright (c) 2016-2018 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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #include <netinet/in.h>
18 #include <vlib/vlib.h>
19 #include <vnet/vnet.h>
20 #include <vnet/pg/pg.h>
21 #include <vppinfra/error.h>
25 #include <vnet/ip/icmp46_packet.h>
27 #include <plugins/acl/fa_node.h>
28 #include <plugins/acl/acl.h>
29 #include <plugins/acl/lookup_context.h>
30 #include <plugins/acl/public_inlines.h>
31 #include <plugins/acl/session_inlines.h>
33 #include <vppinfra/bihash_40_8.h>
34 #include <vppinfra/bihash_template.h>
41 u32 match_acl_in_index;
49 #define foreach_acl_fa_error \
50 _(ACL_DROP, "ACL deny packets") \
51 _(ACL_PERMIT, "ACL permit packets") \
52 _(ACL_NEW_SESSION, "new sessions added") \
53 _(ACL_EXIST_SESSION, "existing session packets") \
54 _(ACL_CHECK, "checked packets") \
55 _(ACL_RESTART_SESSION_TIMER, "restart session timer") \
56 _(ACL_TOO_MANY_SESSIONS, "too many sessions to add new") \
61 #define _(sym,str) ACL_FA_ERROR_##sym,
71 acl_fa_node_fn (vlib_main_t * vm,
72 vlib_node_runtime_t * node, vlib_frame_t * frame, int is_ip6,
73 int is_input, int is_l2_path, u32 * l2_feat_next_node_index,
74 vlib_node_registration_t * acl_fa_node)
76 u32 n_left_from, *from, *to_next;
77 acl_fa_next_t next_index;
78 u32 pkts_acl_checked = 0;
79 u32 pkts_new_session = 0;
80 u32 pkts_exist_session = 0;
81 u32 pkts_acl_permit = 0;
82 u32 pkts_restart_session_timer = 0;
84 acl_main_t *am = &acl_main;
85 fa_5tuple_t fa_5tuple;
86 clib_bihash_kv_40_8_t value_sess;
87 vlib_node_runtime_t *error_node;
88 u64 now = clib_cpu_time_now ();
89 uword thread_index = os_get_thread_index ();
90 acl_fa_per_worker_data_t *pw = &am->per_worker_data[thread_index];
92 from = vlib_frame_vector_args (frame);
93 n_left_from = frame->n_vectors;
94 next_index = node->cached_next_index;
96 error_node = vlib_node_get_runtime (vm, acl_fa_node->index);
98 while (n_left_from > 0)
102 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
104 while (n_left_from > 0 && n_left_to_next > 0)
112 int acl_check_needed = 1;
113 u32 match_acl_in_index = ~0;
114 u32 match_acl_pos = ~0;
115 u32 match_rule_index = ~0;
118 /* speculatively enqueue b0 to the current next frame */
126 b0 = vlib_get_buffer (vm, bi0);
129 sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
131 sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_TX];
134 lc_index0 = am->input_lc_index_by_sw_if_index[sw_if_index0];
136 lc_index0 = am->output_lc_index_by_sw_if_index[sw_if_index0];
139 is_input ? &am->input_policy_epoch_by_sw_if_index :
140 &am->output_policy_epoch_by_sw_if_index;
141 u16 current_policy_epoch =
142 sw_if_index0 < vec_len (*p_epoch_vec) ? vec_elt (*p_epoch_vec,
144 : (is_input * FA_POLICY_EPOCH_IS_INPUT);
146 * Extract the L3/L4 matching info into a 5-tuple structure.
149 acl_plugin_fill_5tuple_inline (lc_index0, b0, is_ip6, is_input,
151 (fa_5tuple_opaque_t *) & fa_5tuple);
152 fa_5tuple.l4.lsb_of_sw_if_index = sw_if_index0 & 0xffff;
153 fa_5tuple.pkt.mask_type_index_lsb = ~0;
154 #ifdef FA_NODE_VERBOSE_DEBUG
156 ("ACL_FA_NODE_DBG: packet 5-tuple %016llx %016llx %016llx %016llx %016llx %016llx",
157 fa_5tuple.kv.key[0], fa_5tuple.kv.key[1], fa_5tuple.kv.key[2],
158 fa_5tuple.kv.key[3], fa_5tuple.kv.key[4], fa_5tuple.kv.value);
161 /* Try to match an existing session first */
163 if (acl_fa_ifc_has_sessions (am, sw_if_index0))
165 if (acl_fa_find_session
166 (am, sw_if_index0, &fa_5tuple, &value_sess))
168 trace_bitmap |= 0x80000000;
169 error0 = ACL_FA_ERROR_ACL_EXIST_SESSION;
170 fa_full_session_id_t f_sess_id;
172 f_sess_id.as_u64 = value_sess.value;
173 ASSERT (f_sess_id.thread_index < vec_len (vlib_mains));
176 get_session_ptr (am, f_sess_id.thread_index,
177 f_sess_id.session_index);
178 int old_timeout_type =
179 fa_session_get_timeout_type (am, sess);
181 acl_fa_track_session (am, is_input, sw_if_index0, now,
183 /* expose the session id to the tracer */
184 match_rule_index = f_sess_id.session_index;
185 int new_timeout_type =
186 fa_session_get_timeout_type (am, sess);
187 acl_check_needed = 0;
188 pkts_exist_session += 1;
189 /* Tracking might have changed the session timeout type, e.g. from transient to established */
190 if (PREDICT_FALSE (old_timeout_type != new_timeout_type))
192 acl_fa_restart_timer_for_session (am, now, f_sess_id);
193 pkts_restart_session_timer++;
195 0x00010000 + ((0xff & old_timeout_type) << 8) +
196 (0xff & new_timeout_type);
199 * I estimate the likelihood to be very low - the VPP needs
200 * to have >64K interfaces to start with and then on
201 * exactly 64K indices apart needs to be exactly the same
202 * 5-tuple... Anyway, since this probability is nonzero -
203 * print an error and drop the unlucky packet.
204 * If this shows up in real world, we would need to bump
205 * the hash key length.
207 if (PREDICT_FALSE (sess->sw_if_index != sw_if_index0))
210 ("BUG: session LSB16(sw_if_index) and 5-tuple collision!");
211 acl_check_needed = 0;
214 if (PREDICT_FALSE (am->reclassify_sessions))
216 /* if the MSB of policy epoch matches but not the LSB means it is a stale session */
218 ((current_policy_epoch ^
219 f_sess_id.intf_policy_epoch) &
220 FA_POLICY_EPOCH_IS_INPUT))
221 && (current_policy_epoch !=
222 f_sess_id.intf_policy_epoch))
224 /* delete session and increment the counter */
226 (pw->fa_session_epoch_change_by_sw_if_index,
228 vec_elt (pw->fa_session_epoch_change_by_sw_if_index,
230 if (acl_fa_conn_list_delete_session (am, f_sess_id))
232 /* delete the session only if we were able to unlink it */
233 acl_fa_delete_session (am, sw_if_index0,
236 acl_check_needed = 1;
237 trace_bitmap |= 0x40000000;
243 if (acl_check_needed)
245 action = 0; /* deny by default */
246 acl_plugin_match_5tuple_inline (lc_index0,
247 (fa_5tuple_opaque_t *) &
248 fa_5tuple, is_ip6, &action,
255 pkts_acl_permit += 1;
258 if (!acl_fa_can_add_session (am, is_input, sw_if_index0))
259 acl_fa_try_recycle_session (am, is_input, thread_index,
262 if (acl_fa_can_add_session (am, is_input, sw_if_index0))
265 acl_fa_add_session (am, is_input, is_ip6,
268 current_policy_epoch);
269 acl_fa_track_session (am, is_input, sw_if_index0,
270 now, sess, &fa_5tuple);
271 pkts_new_session += 1;
276 error0 = ACL_FA_ERROR_ACL_TOO_MANY_SESSIONS;
286 next0 = vnet_l2_feature_next (b0, l2_feat_next_node_index, 0);
288 vnet_feature_next (sw_if_index0, &next0, b0);
290 #ifdef FA_NODE_VERBOSE_DEBUG
292 ("ACL_FA_NODE_DBG: sw_if_index %d lc_index %d action %d acl_index %d rule_index %d",
293 sw_if_index0, lc_index0, action, match_acl_in_index,
297 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
298 && (b0->flags & VLIB_BUFFER_IS_TRACED)))
300 acl_fa_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t));
301 t->sw_if_index = sw_if_index0;
302 t->lc_index = lc_index0;
303 t->next_index = next0;
304 t->match_acl_in_index = match_acl_in_index;
305 t->match_rule_index = match_rule_index;
306 t->packet_info[0] = fa_5tuple.kv.key[0];
307 t->packet_info[1] = fa_5tuple.kv.key[1];
308 t->packet_info[2] = fa_5tuple.kv.key[2];
309 t->packet_info[3] = fa_5tuple.kv.key[3];
310 t->packet_info[4] = fa_5tuple.kv.key[4];
311 t->packet_info[5] = fa_5tuple.kv.value;
313 t->trace_bitmap = trace_bitmap;
316 next0 = next0 < node->n_next_nodes ? next0 : 0;
318 b0->error = error_node->errors[error0];
320 pkts_acl_checked += 1;
322 /* verify speculative enqueue, maybe switch current next frame */
323 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
324 to_next, n_left_to_next, bi0,
328 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
331 vlib_node_increment_counter (vm, acl_fa_node->index,
332 ACL_FA_ERROR_ACL_CHECK, pkts_acl_checked);
333 vlib_node_increment_counter (vm, acl_fa_node->index,
334 ACL_FA_ERROR_ACL_PERMIT, pkts_acl_permit);
335 vlib_node_increment_counter (vm, acl_fa_node->index,
336 ACL_FA_ERROR_ACL_NEW_SESSION,
338 vlib_node_increment_counter (vm, acl_fa_node->index,
339 ACL_FA_ERROR_ACL_EXIST_SESSION,
341 vlib_node_increment_counter (vm, acl_fa_node->index,
342 ACL_FA_ERROR_ACL_RESTART_SESSION_TIMER,
343 pkts_restart_session_timer);
344 return frame->n_vectors;
347 vlib_node_function_t __clib_weak acl_in_ip4_l2_node_fn_avx512;
348 vlib_node_function_t __clib_weak acl_in_ip4_l2_node_fn_avx2;
350 vlib_node_function_t __clib_weak acl_out_ip4_l2_node_fn_avx512;
351 vlib_node_function_t __clib_weak acl_out_ip4_l2_node_fn_avx2;
353 vlib_node_function_t __clib_weak acl_in_ip6_l2_node_fn_avx512;
354 vlib_node_function_t __clib_weak acl_in_ip6_l2_node_fn_avx2;
356 vlib_node_function_t __clib_weak acl_out_ip6_l2_node_fn_avx512;
357 vlib_node_function_t __clib_weak acl_out_ip6_l2_node_fn_avx2;
359 vlib_node_function_t __clib_weak acl_in_ip4_fa_node_fn_avx512;
360 vlib_node_function_t __clib_weak acl_in_ip4_fa_node_fn_avx2;
362 vlib_node_function_t __clib_weak acl_out_ip4_fa_node_fn_avx512;
363 vlib_node_function_t __clib_weak acl_out_ip4_fa_node_fn_avx2;
365 vlib_node_function_t __clib_weak acl_in_ip6_fa_node_fn_avx512;
366 vlib_node_function_t __clib_weak acl_in_ip6_fa_node_fn_avx2;
368 vlib_node_function_t __clib_weak acl_out_ip6_fa_node_fn_avx512;
369 vlib_node_function_t __clib_weak acl_out_ip6_fa_node_fn_avx2;
372 vlib_node_registration_t acl_in_l2_ip6_node;
373 uword CLIB_CPU_OPTIMIZED
374 CLIB_MULTIARCH_FN (acl_in_ip6_l2_node_fn) (vlib_main_t * vm,
375 vlib_node_runtime_t * node,
376 vlib_frame_t * frame)
378 acl_main_t *am = &acl_main;
379 return acl_fa_node_fn (vm, node, frame, 1, 1, 1,
380 am->fa_acl_in_ip6_l2_node_feat_next_node_index,
381 &acl_in_l2_ip6_node);
384 vlib_node_registration_t acl_in_l2_ip4_node;
385 uword CLIB_CPU_OPTIMIZED
386 CLIB_MULTIARCH_FN (acl_in_ip4_l2_node_fn) (vlib_main_t * vm,
387 vlib_node_runtime_t * node,
388 vlib_frame_t * frame)
390 acl_main_t *am = &acl_main;
391 return acl_fa_node_fn (vm, node, frame, 0, 1, 1,
392 am->fa_acl_in_ip4_l2_node_feat_next_node_index,
393 &acl_in_l2_ip4_node);
396 vlib_node_registration_t acl_out_l2_ip6_node;
397 uword CLIB_CPU_OPTIMIZED
398 CLIB_MULTIARCH_FN (acl_out_ip6_l2_node_fn) (vlib_main_t * vm,
399 vlib_node_runtime_t * node,
400 vlib_frame_t * frame)
402 acl_main_t *am = &acl_main;
403 return acl_fa_node_fn (vm, node, frame, 1, 0, 1,
404 am->fa_acl_out_ip6_l2_node_feat_next_node_index,
405 &acl_out_l2_ip6_node);
408 vlib_node_registration_t acl_out_l2_ip4_node;
409 uword CLIB_CPU_OPTIMIZED
410 CLIB_MULTIARCH_FN (acl_out_ip4_l2_node_fn) (vlib_main_t * vm,
411 vlib_node_runtime_t * node,
412 vlib_frame_t * frame)
414 acl_main_t *am = &acl_main;
415 return acl_fa_node_fn (vm, node, frame, 0, 0, 1,
416 am->fa_acl_out_ip4_l2_node_feat_next_node_index,
417 &acl_out_l2_ip4_node);
420 /**** L3 processing path nodes ****/
422 vlib_node_registration_t acl_in_fa_ip6_node;
423 uword CLIB_CPU_OPTIMIZED
424 CLIB_MULTIARCH_FN (acl_in_ip6_fa_node_fn) (vlib_main_t * vm,
425 vlib_node_runtime_t * node,
426 vlib_frame_t * frame)
428 return acl_fa_node_fn (vm, node, frame, 1, 1, 0, 0, &acl_in_fa_ip6_node);
431 vlib_node_registration_t acl_in_fa_ip4_node;
432 uword CLIB_CPU_OPTIMIZED
433 CLIB_MULTIARCH_FN (acl_in_ip4_fa_node_fn) (vlib_main_t * vm,
434 vlib_node_runtime_t * node,
435 vlib_frame_t * frame)
437 return acl_fa_node_fn (vm, node, frame, 0, 1, 0, 0, &acl_in_fa_ip4_node);
440 vlib_node_registration_t acl_out_fa_ip6_node;
441 uword CLIB_CPU_OPTIMIZED
442 CLIB_MULTIARCH_FN (acl_out_ip6_fa_node_fn) (vlib_main_t * vm,
443 vlib_node_runtime_t * node,
444 vlib_frame_t * frame)
446 return acl_fa_node_fn (vm, node, frame, 1, 0, 0, 0, &acl_out_fa_ip6_node);
449 vlib_node_registration_t acl_out_fa_ip4_node;
450 uword CLIB_CPU_OPTIMIZED
451 CLIB_MULTIARCH_FN (acl_out_ip4_fa_node_fn) (vlib_main_t * vm,
452 vlib_node_runtime_t * node,
453 vlib_frame_t * frame)
455 return acl_fa_node_fn (vm, node, frame, 0, 0, 0, 0, &acl_out_fa_ip4_node);
461 static void __clib_constructor
462 acl_plugin_multiarch_select (void)
464 if (acl_in_ip4_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
465 acl_in_l2_ip4_node.function = acl_in_ip4_l2_node_fn_avx512;
466 else if (acl_in_ip4_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
467 acl_in_l2_ip4_node.function = acl_in_ip4_l2_node_fn_avx2;
469 if (acl_out_ip4_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
470 acl_out_l2_ip4_node.function = acl_out_ip4_l2_node_fn_avx512;
471 else if (acl_out_ip4_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
472 acl_out_l2_ip4_node.function = acl_out_ip4_l2_node_fn_avx2;
474 if (acl_in_ip6_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
475 acl_in_l2_ip6_node.function = acl_in_ip6_l2_node_fn_avx512;
476 else if (acl_in_ip6_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
477 acl_in_l2_ip6_node.function = acl_in_ip6_l2_node_fn_avx2;
479 if (acl_out_ip6_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
480 acl_out_l2_ip6_node.function = acl_out_ip6_l2_node_fn_avx512;
481 else if (acl_out_ip6_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
482 acl_out_l2_ip6_node.function = acl_out_ip6_l2_node_fn_avx2;
484 if (acl_in_ip4_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
485 acl_in_fa_ip4_node.function = acl_in_ip4_fa_node_fn_avx512;
486 else if (acl_in_ip4_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
487 acl_in_fa_ip4_node.function = acl_in_ip4_fa_node_fn_avx2;
489 if (acl_out_ip4_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
490 acl_out_fa_ip4_node.function = acl_out_ip4_fa_node_fn_avx512;
491 else if (acl_out_ip4_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
492 acl_out_fa_ip4_node.function = acl_out_ip4_fa_node_fn_avx2;
494 if (acl_in_ip6_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
495 acl_in_fa_ip6_node.function = acl_in_ip6_fa_node_fn_avx512;
496 else if (acl_in_ip6_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
497 acl_in_fa_ip6_node.function = acl_in_ip6_fa_node_fn_avx2;
499 if (acl_out_ip6_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
500 acl_out_fa_ip6_node.function = acl_out_ip6_fa_node_fn_avx512;
501 else if (acl_out_ip6_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
502 acl_out_fa_ip6_node.function = acl_out_ip6_fa_node_fn_avx2;
509 #ifndef CLIB_MULTIARCH_VARIANT
511 format_fa_5tuple (u8 * s, va_list * args)
513 fa_5tuple_t *p5t = va_arg (*args, fa_5tuple_t *);
515 return format (s, "lc_index %d (lsb16 of sw_if_index %d) l3 %s%s %U -> %U"
516 " l4 proto %d l4_valid %d port %d -> %d tcp flags (%s) %02x rsvd %x",
517 p5t->pkt.lc_index, p5t->l4.lsb_of_sw_if_index,
518 p5t->pkt.is_ip6 ? "ip6" : "ip4",
519 p5t->pkt.is_nonfirst_fragment ? " non-initial fragment" : "",
520 format_ip46_address, &p5t->addr[0],
521 p5t->pkt.is_ip6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4,
522 format_ip46_address, &p5t->addr[1],
523 p5t->pkt.is_ip6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4,
524 p5t->l4.proto, p5t->pkt.l4_valid, p5t->l4.port[0],
526 p5t->pkt.tcp_flags_valid ? "valid" : "invalid",
527 p5t->pkt.tcp_flags, p5t->pkt.flags_reserved);
531 format_acl_plugin_5tuple (u8 * s, va_list * args)
533 return format_fa_5tuple (s, args);
536 /* packet trace format function */
538 format_acl_plugin_trace (u8 * s, va_list * args)
540 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
541 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
542 acl_fa_trace_t *t = va_arg (*args, acl_fa_trace_t *);
546 "acl-plugin: lc_index: %d, sw_if_index %d, next index %d, action: %d, match: acl %d rule %d trace_bits %08x\n"
547 " pkt info %016llx %016llx %016llx %016llx %016llx %016llx",
548 t->lc_index, t->sw_if_index, t->next_index, t->action,
549 t->match_acl_in_index, t->match_rule_index, t->trace_bitmap,
550 t->packet_info[0], t->packet_info[1], t->packet_info[2],
551 t->packet_info[3], t->packet_info[4], t->packet_info[5]);
553 /* Now also print out the packet_info in a form usable by humans */
554 s = format (s, "\n %U", format_fa_5tuple, t->packet_info);
561 static char *acl_fa_error_strings[] = {
562 #define _(sym,string) string,
567 VLIB_REGISTER_NODE (acl_in_l2_ip6_node) =
569 .function = acl_in_ip6_l2_node_fn,
570 .name = "acl-plugin-in-ip6-l2",
571 .vector_size = sizeof (u32),
572 .format_trace = format_acl_plugin_trace,
573 .type = VLIB_NODE_TYPE_INTERNAL,
574 .n_errors = ARRAY_LEN (acl_fa_error_strings),
575 .error_strings = acl_fa_error_strings,
576 .n_next_nodes = ACL_FA_N_NEXT,
579 [ACL_FA_ERROR_DROP] = "error-drop",
583 VLIB_REGISTER_NODE (acl_in_l2_ip4_node) =
585 .function = acl_in_ip4_l2_node_fn,
586 .name = "acl-plugin-in-ip4-l2",
587 .vector_size = sizeof (u32),
588 .format_trace = format_acl_plugin_trace,
589 .type = VLIB_NODE_TYPE_INTERNAL,
590 .n_errors = ARRAY_LEN (acl_fa_error_strings),
591 .error_strings = acl_fa_error_strings,
592 .n_next_nodes = ACL_FA_N_NEXT,
595 [ACL_FA_ERROR_DROP] = "error-drop",
599 VLIB_REGISTER_NODE (acl_out_l2_ip6_node) =
601 .function = acl_out_ip6_l2_node_fn,
602 .name = "acl-plugin-out-ip6-l2",
603 .vector_size = sizeof (u32),
604 .format_trace = format_acl_plugin_trace,
605 .type = VLIB_NODE_TYPE_INTERNAL,
606 .n_errors = ARRAY_LEN (acl_fa_error_strings),
607 .error_strings = acl_fa_error_strings,
608 .n_next_nodes = ACL_FA_N_NEXT,
611 [ACL_FA_ERROR_DROP] = "error-drop",
615 VLIB_REGISTER_NODE (acl_out_l2_ip4_node) =
617 .function = acl_out_ip4_l2_node_fn,
618 .name = "acl-plugin-out-ip4-l2",
619 .vector_size = sizeof (u32),
620 .format_trace = format_acl_plugin_trace,
621 .type = VLIB_NODE_TYPE_INTERNAL,
622 .n_errors = ARRAY_LEN (acl_fa_error_strings),
623 .error_strings = acl_fa_error_strings,
624 .n_next_nodes = ACL_FA_N_NEXT,
627 [ACL_FA_ERROR_DROP] = "error-drop",
632 VLIB_REGISTER_NODE (acl_in_fa_ip6_node) =
634 .function = acl_in_ip6_fa_node_fn,
635 .name = "acl-plugin-in-ip6-fa",
636 .vector_size = sizeof (u32),
637 .format_trace = format_acl_plugin_trace,
638 .type = VLIB_NODE_TYPE_INTERNAL,
639 .n_errors = ARRAY_LEN (acl_fa_error_strings),
640 .error_strings = acl_fa_error_strings,
641 .n_next_nodes = ACL_FA_N_NEXT,
644 [ACL_FA_ERROR_DROP] = "error-drop",
648 VNET_FEATURE_INIT (acl_in_ip6_fa_feature, static) =
650 .arc_name = "ip6-unicast",
651 .node_name = "acl-plugin-in-ip6-fa",
652 .runs_before = VNET_FEATURES ("ip6-flow-classify"),
655 VLIB_REGISTER_NODE (acl_in_fa_ip4_node) =
657 .function = acl_in_ip4_fa_node_fn,
658 .name = "acl-plugin-in-ip4-fa",
659 .vector_size = sizeof (u32),
660 .format_trace = format_acl_plugin_trace,
661 .type = VLIB_NODE_TYPE_INTERNAL,
662 .n_errors = ARRAY_LEN (acl_fa_error_strings),
663 .error_strings = acl_fa_error_strings,
664 .n_next_nodes = ACL_FA_N_NEXT,
667 [ACL_FA_ERROR_DROP] = "error-drop",
671 VNET_FEATURE_INIT (acl_in_ip4_fa_feature, static) =
673 .arc_name = "ip4-unicast",
674 .node_name = "acl-plugin-in-ip4-fa",
675 .runs_before = VNET_FEATURES ("ip4-flow-classify"),
679 VLIB_REGISTER_NODE (acl_out_fa_ip6_node) =
681 .function = acl_out_ip6_fa_node_fn,
682 .name = "acl-plugin-out-ip6-fa",
683 .vector_size = sizeof (u32),
684 .format_trace = format_acl_plugin_trace,
685 .type = VLIB_NODE_TYPE_INTERNAL,
686 .n_errors = ARRAY_LEN (acl_fa_error_strings),
687 .error_strings = acl_fa_error_strings,
688 .n_next_nodes = ACL_FA_N_NEXT,
691 [ACL_FA_ERROR_DROP] = "error-drop",
695 VNET_FEATURE_INIT (acl_out_ip6_fa_feature, static) =
697 .arc_name = "ip6-output",
698 .node_name = "acl-plugin-out-ip6-fa",
699 .runs_before = VNET_FEATURES ("interface-output"),
702 VLIB_REGISTER_NODE (acl_out_fa_ip4_node) =
704 .function = acl_out_ip4_fa_node_fn,
705 .name = "acl-plugin-out-ip4-fa",
706 .vector_size = sizeof (u32),
707 .format_trace = format_acl_plugin_trace,
708 .type = VLIB_NODE_TYPE_INTERNAL,
709 .n_errors = ARRAY_LEN (acl_fa_error_strings),
710 .error_strings = acl_fa_error_strings,
711 .n_next_nodes = ACL_FA_N_NEXT,
712 /* edit / add dispositions here */
715 [ACL_FA_ERROR_DROP] = "error-drop",
719 VNET_FEATURE_INIT (acl_out_ip4_fa_feature, static) =
721 .arc_name = "ip4-output",
722 .node_name = "acl-plugin-out-ip4-fa",
723 .runs_before = VNET_FEATURES ("interface-output"),
730 * fd.io coding-style-patch-verification: ON
733 * eval: (c-set-style "gnu")