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)
77 u32 pkts_acl_checked = 0;
78 u32 pkts_new_session = 0;
79 u32 pkts_exist_session = 0;
80 u32 pkts_acl_permit = 0;
81 u32 pkts_restart_session_timer = 0;
83 acl_main_t *am = &acl_main;
84 fa_5tuple_t fa_5tuple;
85 clib_bihash_kv_40_8_t value_sess;
86 vlib_node_runtime_t *error_node;
87 u64 now = clib_cpu_time_now ();
88 uword thread_index = os_get_thread_index ();
89 acl_fa_per_worker_data_t *pw = &am->per_worker_data[thread_index];
91 u16 nexts[VLIB_FRAME_SIZE], *next;
92 vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
94 from = vlib_frame_vector_args (frame);
96 error_node = vlib_node_get_runtime (vm, acl_fa_node->index);
98 vlib_get_buffers (vm, from, bufs, frame->n_vectors);
99 /* set the initial values for the current buffer the next pointers */
103 n_left = frame->n_vectors;
110 int acl_check_needed = 1;
111 u32 match_acl_in_index = ~0;
112 u32 match_acl_pos = ~0;
113 u32 match_rule_index = ~0;
119 sw_if_index0 = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
121 sw_if_index0 = vnet_buffer (b[0])->sw_if_index[VLIB_TX];
124 lc_index0 = am->input_lc_index_by_sw_if_index[sw_if_index0];
126 lc_index0 = am->output_lc_index_by_sw_if_index[sw_if_index0];
130 is_input ? &am->input_policy_epoch_by_sw_if_index :
131 &am->output_policy_epoch_by_sw_if_index;
132 u16 current_policy_epoch =
133 sw_if_index0 < vec_len (*p_epoch_vec) ? vec_elt (*p_epoch_vec,
135 : (is_input * FA_POLICY_EPOCH_IS_INPUT);
137 * Extract the L3/L4 matching info into a 5-tuple structure.
140 acl_plugin_fill_5tuple_inline (lc_index0, b[0], is_ip6, is_input,
142 (fa_5tuple_opaque_t *) & fa_5tuple);
143 fa_5tuple.l4.lsb_of_sw_if_index = sw_if_index0 & 0xffff;
144 fa_5tuple.pkt.mask_type_index_lsb = ~0;
145 #ifdef FA_NODE_VERBOSE_DEBUG
147 ("ACL_FA_NODE_DBG: packet 5-tuple %016llx %016llx %016llx %016llx %016llx %016llx",
148 fa_5tuple.kv.key[0], fa_5tuple.kv.key[1], fa_5tuple.kv.key[2],
149 fa_5tuple.kv.key[3], fa_5tuple.kv.key[4], fa_5tuple.kv.value);
152 /* Try to match an existing session first */
154 if (acl_fa_ifc_has_sessions (am, sw_if_index0))
156 if (acl_fa_find_session (am, sw_if_index0, &fa_5tuple, &value_sess))
158 trace_bitmap |= 0x80000000;
159 error0 = ACL_FA_ERROR_ACL_EXIST_SESSION;
160 fa_full_session_id_t f_sess_id;
162 f_sess_id.as_u64 = value_sess.value;
163 ASSERT (f_sess_id.thread_index < vec_len (vlib_mains));
166 get_session_ptr (am, f_sess_id.thread_index,
167 f_sess_id.session_index);
168 int old_timeout_type = fa_session_get_timeout_type (am, sess);
170 acl_fa_track_session (am, is_input, sw_if_index0, now,
172 /* expose the session id to the tracer */
173 match_rule_index = f_sess_id.session_index;
174 int new_timeout_type = fa_session_get_timeout_type (am, sess);
175 acl_check_needed = 0;
176 pkts_exist_session += 1;
177 /* Tracking might have changed the session timeout type, e.g. from transient to established */
178 if (PREDICT_FALSE (old_timeout_type != new_timeout_type))
180 acl_fa_restart_timer_for_session (am, now, f_sess_id);
181 pkts_restart_session_timer++;
183 0x00010000 + ((0xff & old_timeout_type) << 8) +
184 (0xff & new_timeout_type);
187 * I estimate the likelihood to be very low - the VPP needs
188 * to have >64K interfaces to start with and then on
189 * exactly 64K indices apart needs to be exactly the same
190 * 5-tuple... Anyway, since this probability is nonzero -
191 * print an error and drop the unlucky packet.
192 * If this shows up in real world, we would need to bump
193 * the hash key length.
195 if (PREDICT_FALSE (sess->sw_if_index != sw_if_index0))
198 ("BUG: session LSB16(sw_if_index) and 5-tuple collision!");
199 acl_check_needed = 0;
202 if (PREDICT_FALSE (am->reclassify_sessions))
204 /* if the MSB of policy epoch matches but not the LSB means it is a stale session */
206 ((current_policy_epoch ^
207 f_sess_id.intf_policy_epoch) &
208 FA_POLICY_EPOCH_IS_INPUT))
209 && (current_policy_epoch !=
210 f_sess_id.intf_policy_epoch))
212 /* delete session and increment the counter */
214 (pw->fa_session_epoch_change_by_sw_if_index,
216 vec_elt (pw->fa_session_epoch_change_by_sw_if_index,
218 if (acl_fa_conn_list_delete_session (am, f_sess_id))
220 /* delete the session only if we were able to unlink it */
221 acl_fa_delete_session (am, sw_if_index0, f_sess_id);
223 acl_check_needed = 1;
224 trace_bitmap |= 0x40000000;
230 if (acl_check_needed)
232 action = 0; /* deny by default */
233 acl_plugin_match_5tuple_inline (lc_index0,
234 (fa_5tuple_opaque_t *) &
235 fa_5tuple, is_ip6, &action,
238 &match_rule_index, &trace_bitmap);
241 pkts_acl_permit += 1;
244 if (!acl_fa_can_add_session (am, is_input, sw_if_index0))
245 acl_fa_try_recycle_session (am, is_input, thread_index,
248 if (acl_fa_can_add_session (am, is_input, sw_if_index0))
251 acl_fa_add_session (am, is_input, is_ip6,
254 current_policy_epoch);
255 acl_fa_track_session (am, is_input, sw_if_index0,
256 now, sess, &fa_5tuple);
257 pkts_new_session += 1;
262 error0 = ACL_FA_ERROR_ACL_TOO_MANY_SESSIONS;
272 next0 = vnet_l2_feature_next (b[0], l2_feat_next_node_index, 0);
274 vnet_feature_next (sw_if_index0, &next0, b[0]);
276 #ifdef FA_NODE_VERBOSE_DEBUG
278 ("ACL_FA_NODE_DBG: sw_if_index %d lc_index %d action %d acl_index %d rule_index %d",
279 sw_if_index0, lc_index0, action, match_acl_in_index,
283 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
284 && (b[0]->flags & VLIB_BUFFER_IS_TRACED)))
286 acl_fa_trace_t *t = vlib_add_trace (vm, node, b[0], sizeof (*t));
287 t->sw_if_index = sw_if_index0;
288 t->lc_index = lc_index0;
289 t->next_index = next0;
290 t->match_acl_in_index = match_acl_in_index;
291 t->match_rule_index = match_rule_index;
292 t->packet_info[0] = fa_5tuple.kv.key[0];
293 t->packet_info[1] = fa_5tuple.kv.key[1];
294 t->packet_info[2] = fa_5tuple.kv.key[2];
295 t->packet_info[3] = fa_5tuple.kv.key[3];
296 t->packet_info[4] = fa_5tuple.kv.key[4];
297 t->packet_info[5] = fa_5tuple.kv.value;
299 t->trace_bitmap = trace_bitmap;
302 next0 = next0 < node->n_next_nodes ? next0 : 0;
304 b[0]->error = error_node->errors[error0];
309 pkts_acl_checked += 1;
312 vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors);
314 vlib_node_increment_counter (vm, acl_fa_node->index,
315 ACL_FA_ERROR_ACL_CHECK, pkts_acl_checked);
316 vlib_node_increment_counter (vm, acl_fa_node->index,
317 ACL_FA_ERROR_ACL_PERMIT, pkts_acl_permit);
318 vlib_node_increment_counter (vm, acl_fa_node->index,
319 ACL_FA_ERROR_ACL_NEW_SESSION,
321 vlib_node_increment_counter (vm, acl_fa_node->index,
322 ACL_FA_ERROR_ACL_EXIST_SESSION,
324 vlib_node_increment_counter (vm, acl_fa_node->index,
325 ACL_FA_ERROR_ACL_RESTART_SESSION_TIMER,
326 pkts_restart_session_timer);
327 return frame->n_vectors;
330 vlib_node_function_t __clib_weak acl_in_ip4_l2_node_fn_avx512;
331 vlib_node_function_t __clib_weak acl_in_ip4_l2_node_fn_avx2;
333 vlib_node_function_t __clib_weak acl_out_ip4_l2_node_fn_avx512;
334 vlib_node_function_t __clib_weak acl_out_ip4_l2_node_fn_avx2;
336 vlib_node_function_t __clib_weak acl_in_ip6_l2_node_fn_avx512;
337 vlib_node_function_t __clib_weak acl_in_ip6_l2_node_fn_avx2;
339 vlib_node_function_t __clib_weak acl_out_ip6_l2_node_fn_avx512;
340 vlib_node_function_t __clib_weak acl_out_ip6_l2_node_fn_avx2;
342 vlib_node_function_t __clib_weak acl_in_ip4_fa_node_fn_avx512;
343 vlib_node_function_t __clib_weak acl_in_ip4_fa_node_fn_avx2;
345 vlib_node_function_t __clib_weak acl_out_ip4_fa_node_fn_avx512;
346 vlib_node_function_t __clib_weak acl_out_ip4_fa_node_fn_avx2;
348 vlib_node_function_t __clib_weak acl_in_ip6_fa_node_fn_avx512;
349 vlib_node_function_t __clib_weak acl_in_ip6_fa_node_fn_avx2;
351 vlib_node_function_t __clib_weak acl_out_ip6_fa_node_fn_avx512;
352 vlib_node_function_t __clib_weak acl_out_ip6_fa_node_fn_avx2;
355 vlib_node_registration_t acl_in_l2_ip6_node;
356 uword CLIB_CPU_OPTIMIZED
357 CLIB_MULTIARCH_FN (acl_in_ip6_l2_node_fn) (vlib_main_t * vm,
358 vlib_node_runtime_t * node,
359 vlib_frame_t * frame)
361 acl_main_t *am = &acl_main;
362 return acl_fa_node_fn (vm, node, frame, 1, 1, 1,
363 am->fa_acl_in_ip6_l2_node_feat_next_node_index,
364 &acl_in_l2_ip6_node);
367 vlib_node_registration_t acl_in_l2_ip4_node;
368 uword CLIB_CPU_OPTIMIZED
369 CLIB_MULTIARCH_FN (acl_in_ip4_l2_node_fn) (vlib_main_t * vm,
370 vlib_node_runtime_t * node,
371 vlib_frame_t * frame)
373 acl_main_t *am = &acl_main;
374 return acl_fa_node_fn (vm, node, frame, 0, 1, 1,
375 am->fa_acl_in_ip4_l2_node_feat_next_node_index,
376 &acl_in_l2_ip4_node);
379 vlib_node_registration_t acl_out_l2_ip6_node;
380 uword CLIB_CPU_OPTIMIZED
381 CLIB_MULTIARCH_FN (acl_out_ip6_l2_node_fn) (vlib_main_t * vm,
382 vlib_node_runtime_t * node,
383 vlib_frame_t * frame)
385 acl_main_t *am = &acl_main;
386 return acl_fa_node_fn (vm, node, frame, 1, 0, 1,
387 am->fa_acl_out_ip6_l2_node_feat_next_node_index,
388 &acl_out_l2_ip6_node);
391 vlib_node_registration_t acl_out_l2_ip4_node;
392 uword CLIB_CPU_OPTIMIZED
393 CLIB_MULTIARCH_FN (acl_out_ip4_l2_node_fn) (vlib_main_t * vm,
394 vlib_node_runtime_t * node,
395 vlib_frame_t * frame)
397 acl_main_t *am = &acl_main;
398 return acl_fa_node_fn (vm, node, frame, 0, 0, 1,
399 am->fa_acl_out_ip4_l2_node_feat_next_node_index,
400 &acl_out_l2_ip4_node);
403 /**** L3 processing path nodes ****/
405 vlib_node_registration_t acl_in_fa_ip6_node;
406 uword CLIB_CPU_OPTIMIZED
407 CLIB_MULTIARCH_FN (acl_in_ip6_fa_node_fn) (vlib_main_t * vm,
408 vlib_node_runtime_t * node,
409 vlib_frame_t * frame)
411 return acl_fa_node_fn (vm, node, frame, 1, 1, 0, 0, &acl_in_fa_ip6_node);
414 vlib_node_registration_t acl_in_fa_ip4_node;
415 uword CLIB_CPU_OPTIMIZED
416 CLIB_MULTIARCH_FN (acl_in_ip4_fa_node_fn) (vlib_main_t * vm,
417 vlib_node_runtime_t * node,
418 vlib_frame_t * frame)
420 return acl_fa_node_fn (vm, node, frame, 0, 1, 0, 0, &acl_in_fa_ip4_node);
423 vlib_node_registration_t acl_out_fa_ip6_node;
424 uword CLIB_CPU_OPTIMIZED
425 CLIB_MULTIARCH_FN (acl_out_ip6_fa_node_fn) (vlib_main_t * vm,
426 vlib_node_runtime_t * node,
427 vlib_frame_t * frame)
429 return acl_fa_node_fn (vm, node, frame, 1, 0, 0, 0, &acl_out_fa_ip6_node);
432 vlib_node_registration_t acl_out_fa_ip4_node;
433 uword CLIB_CPU_OPTIMIZED
434 CLIB_MULTIARCH_FN (acl_out_ip4_fa_node_fn) (vlib_main_t * vm,
435 vlib_node_runtime_t * node,
436 vlib_frame_t * frame)
438 return acl_fa_node_fn (vm, node, frame, 0, 0, 0, 0, &acl_out_fa_ip4_node);
444 static void __clib_constructor
445 acl_plugin_multiarch_select (void)
447 if (acl_in_ip4_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
448 acl_in_l2_ip4_node.function = acl_in_ip4_l2_node_fn_avx512;
449 else if (acl_in_ip4_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
450 acl_in_l2_ip4_node.function = acl_in_ip4_l2_node_fn_avx2;
452 if (acl_out_ip4_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
453 acl_out_l2_ip4_node.function = acl_out_ip4_l2_node_fn_avx512;
454 else if (acl_out_ip4_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
455 acl_out_l2_ip4_node.function = acl_out_ip4_l2_node_fn_avx2;
457 if (acl_in_ip6_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
458 acl_in_l2_ip6_node.function = acl_in_ip6_l2_node_fn_avx512;
459 else if (acl_in_ip6_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
460 acl_in_l2_ip6_node.function = acl_in_ip6_l2_node_fn_avx2;
462 if (acl_out_ip6_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
463 acl_out_l2_ip6_node.function = acl_out_ip6_l2_node_fn_avx512;
464 else if (acl_out_ip6_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
465 acl_out_l2_ip6_node.function = acl_out_ip6_l2_node_fn_avx2;
467 if (acl_in_ip4_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
468 acl_in_fa_ip4_node.function = acl_in_ip4_fa_node_fn_avx512;
469 else if (acl_in_ip4_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
470 acl_in_fa_ip4_node.function = acl_in_ip4_fa_node_fn_avx2;
472 if (acl_out_ip4_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
473 acl_out_fa_ip4_node.function = acl_out_ip4_fa_node_fn_avx512;
474 else if (acl_out_ip4_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
475 acl_out_fa_ip4_node.function = acl_out_ip4_fa_node_fn_avx2;
477 if (acl_in_ip6_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
478 acl_in_fa_ip6_node.function = acl_in_ip6_fa_node_fn_avx512;
479 else if (acl_in_ip6_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
480 acl_in_fa_ip6_node.function = acl_in_ip6_fa_node_fn_avx2;
482 if (acl_out_ip6_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
483 acl_out_fa_ip6_node.function = acl_out_ip6_fa_node_fn_avx512;
484 else if (acl_out_ip6_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
485 acl_out_fa_ip6_node.function = acl_out_ip6_fa_node_fn_avx2;
492 #ifndef CLIB_MULTIARCH_VARIANT
494 format_fa_5tuple (u8 * s, va_list * args)
496 fa_5tuple_t *p5t = va_arg (*args, fa_5tuple_t *);
498 return format (s, "lc_index %d (lsb16 of sw_if_index %d) l3 %s%s %U -> %U"
499 " l4 proto %d l4_valid %d port %d -> %d tcp flags (%s) %02x rsvd %x",
500 p5t->pkt.lc_index, p5t->l4.lsb_of_sw_if_index,
501 p5t->pkt.is_ip6 ? "ip6" : "ip4",
502 p5t->pkt.is_nonfirst_fragment ? " non-initial fragment" : "",
503 format_ip46_address, &p5t->addr[0],
504 p5t->pkt.is_ip6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4,
505 format_ip46_address, &p5t->addr[1],
506 p5t->pkt.is_ip6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4,
507 p5t->l4.proto, p5t->pkt.l4_valid, p5t->l4.port[0],
509 p5t->pkt.tcp_flags_valid ? "valid" : "invalid",
510 p5t->pkt.tcp_flags, p5t->pkt.flags_reserved);
514 format_acl_plugin_5tuple (u8 * s, va_list * args)
516 return format_fa_5tuple (s, args);
519 /* packet trace format function */
521 format_acl_plugin_trace (u8 * s, va_list * args)
523 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
524 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
525 acl_fa_trace_t *t = va_arg (*args, acl_fa_trace_t *);
529 "acl-plugin: lc_index: %d, sw_if_index %d, next index %d, action: %d, match: acl %d rule %d trace_bits %08x\n"
530 " pkt info %016llx %016llx %016llx %016llx %016llx %016llx",
531 t->lc_index, t->sw_if_index, t->next_index, t->action,
532 t->match_acl_in_index, t->match_rule_index, t->trace_bitmap,
533 t->packet_info[0], t->packet_info[1], t->packet_info[2],
534 t->packet_info[3], t->packet_info[4], t->packet_info[5]);
536 /* Now also print out the packet_info in a form usable by humans */
537 s = format (s, "\n %U", format_fa_5tuple, t->packet_info);
544 static char *acl_fa_error_strings[] = {
545 #define _(sym,string) string,
550 VLIB_REGISTER_NODE (acl_in_l2_ip6_node) =
552 .function = acl_in_ip6_l2_node_fn,
553 .name = "acl-plugin-in-ip6-l2",
554 .vector_size = sizeof (u32),
555 .format_trace = format_acl_plugin_trace,
556 .type = VLIB_NODE_TYPE_INTERNAL,
557 .n_errors = ARRAY_LEN (acl_fa_error_strings),
558 .error_strings = acl_fa_error_strings,
559 .n_next_nodes = ACL_FA_N_NEXT,
562 [ACL_FA_ERROR_DROP] = "error-drop",
566 VLIB_REGISTER_NODE (acl_in_l2_ip4_node) =
568 .function = acl_in_ip4_l2_node_fn,
569 .name = "acl-plugin-in-ip4-l2",
570 .vector_size = sizeof (u32),
571 .format_trace = format_acl_plugin_trace,
572 .type = VLIB_NODE_TYPE_INTERNAL,
573 .n_errors = ARRAY_LEN (acl_fa_error_strings),
574 .error_strings = acl_fa_error_strings,
575 .n_next_nodes = ACL_FA_N_NEXT,
578 [ACL_FA_ERROR_DROP] = "error-drop",
582 VLIB_REGISTER_NODE (acl_out_l2_ip6_node) =
584 .function = acl_out_ip6_l2_node_fn,
585 .name = "acl-plugin-out-ip6-l2",
586 .vector_size = sizeof (u32),
587 .format_trace = format_acl_plugin_trace,
588 .type = VLIB_NODE_TYPE_INTERNAL,
589 .n_errors = ARRAY_LEN (acl_fa_error_strings),
590 .error_strings = acl_fa_error_strings,
591 .n_next_nodes = ACL_FA_N_NEXT,
594 [ACL_FA_ERROR_DROP] = "error-drop",
598 VLIB_REGISTER_NODE (acl_out_l2_ip4_node) =
600 .function = acl_out_ip4_l2_node_fn,
601 .name = "acl-plugin-out-ip4-l2",
602 .vector_size = sizeof (u32),
603 .format_trace = format_acl_plugin_trace,
604 .type = VLIB_NODE_TYPE_INTERNAL,
605 .n_errors = ARRAY_LEN (acl_fa_error_strings),
606 .error_strings = acl_fa_error_strings,
607 .n_next_nodes = ACL_FA_N_NEXT,
610 [ACL_FA_ERROR_DROP] = "error-drop",
615 VLIB_REGISTER_NODE (acl_in_fa_ip6_node) =
617 .function = acl_in_ip6_fa_node_fn,
618 .name = "acl-plugin-in-ip6-fa",
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",
631 VNET_FEATURE_INIT (acl_in_ip6_fa_feature, static) =
633 .arc_name = "ip6-unicast",
634 .node_name = "acl-plugin-in-ip6-fa",
635 .runs_before = VNET_FEATURES ("ip6-flow-classify"),
638 VLIB_REGISTER_NODE (acl_in_fa_ip4_node) =
640 .function = acl_in_ip4_fa_node_fn,
641 .name = "acl-plugin-in-ip4-fa",
642 .vector_size = sizeof (u32),
643 .format_trace = format_acl_plugin_trace,
644 .type = VLIB_NODE_TYPE_INTERNAL,
645 .n_errors = ARRAY_LEN (acl_fa_error_strings),
646 .error_strings = acl_fa_error_strings,
647 .n_next_nodes = ACL_FA_N_NEXT,
650 [ACL_FA_ERROR_DROP] = "error-drop",
654 VNET_FEATURE_INIT (acl_in_ip4_fa_feature, static) =
656 .arc_name = "ip4-unicast",
657 .node_name = "acl-plugin-in-ip4-fa",
658 .runs_before = VNET_FEATURES ("ip4-flow-classify"),
662 VLIB_REGISTER_NODE (acl_out_fa_ip6_node) =
664 .function = acl_out_ip6_fa_node_fn,
665 .name = "acl-plugin-out-ip6-fa",
666 .vector_size = sizeof (u32),
667 .format_trace = format_acl_plugin_trace,
668 .type = VLIB_NODE_TYPE_INTERNAL,
669 .n_errors = ARRAY_LEN (acl_fa_error_strings),
670 .error_strings = acl_fa_error_strings,
671 .n_next_nodes = ACL_FA_N_NEXT,
674 [ACL_FA_ERROR_DROP] = "error-drop",
678 VNET_FEATURE_INIT (acl_out_ip6_fa_feature, static) =
680 .arc_name = "ip6-output",
681 .node_name = "acl-plugin-out-ip6-fa",
682 .runs_before = VNET_FEATURES ("interface-output"),
685 VLIB_REGISTER_NODE (acl_out_fa_ip4_node) =
687 .function = acl_out_ip4_fa_node_fn,
688 .name = "acl-plugin-out-ip4-fa",
689 .vector_size = sizeof (u32),
690 .format_trace = format_acl_plugin_trace,
691 .type = VLIB_NODE_TYPE_INTERNAL,
692 .n_errors = ARRAY_LEN (acl_fa_error_strings),
693 .error_strings = acl_fa_error_strings,
694 .n_next_nodes = ACL_FA_N_NEXT,
695 /* edit / add dispositions here */
698 [ACL_FA_ERROR_DROP] = "error-drop",
702 VNET_FEATURE_INIT (acl_out_ip4_fa_feature, static) =
704 .arc_name = "ip4-output",
705 .node_name = "acl-plugin-out-ip4-fa",
706 .runs_before = VNET_FEATURES ("interface-output"),
713 * fd.io coding-style-patch-verification: ON
716 * eval: (c-set-style "gnu")