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, kv_sess;
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;
119 /* speculatively enqueue b0 to the current next frame */
127 b0 = vlib_get_buffer (vm, bi0);
130 sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
132 sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_TX];
135 lc_index0 = am->input_lc_index_by_sw_if_index[sw_if_index0];
137 lc_index0 = am->output_lc_index_by_sw_if_index[sw_if_index0];
140 is_input ? &am->input_policy_epoch_by_sw_if_index :
141 &am->output_policy_epoch_by_sw_if_index;
142 u16 current_policy_epoch =
143 sw_if_index0 < vec_len (*p_epoch_vec) ? vec_elt (*p_epoch_vec,
145 : (is_input * FA_POLICY_EPOCH_IS_INPUT);
147 * Extract the L3/L4 matching info into a 5-tuple structure,
148 * then create a session key whose layout is independent on forward or reverse
149 * direction of the packet.
152 acl_plugin_fill_5tuple_inline (lc_index0, b0, is_ip6, is_input,
154 (fa_5tuple_opaque_t *) & fa_5tuple);
155 fa_5tuple.l4.lsb_of_sw_if_index = sw_if_index0 & 0xffff;
157 acl_make_5tuple_session_key (am, is_input, is_ip6, sw_if_index0,
158 &fa_5tuple, &kv_sess);
159 // XXDEL fa_5tuple.pkt.is_input = is_input;
160 fa_5tuple.pkt.mask_type_index_lsb = ~0;
161 #ifdef FA_NODE_VERBOSE_DEBUG
163 ("ACL_FA_NODE_DBG: session 5-tuple %016llx %016llx %016llx %016llx %016llx %016llx",
164 kv_sess.kv.key[0], kv_sess.kv.key[1], kv_sess.kv.key[2],
165 kv_sess.kv.key[3], kv_sess.kv.key[4], kv_sess.kv.value);
167 ("ACL_FA_NODE_DBG: packet 5-tuple %016llx %016llx %016llx %016llx %016llx %016llx",
168 fa_5tuple.kv.key[0], fa_5tuple.kv.key[1], fa_5tuple.kv.key[2],
169 fa_5tuple.kv.key[3], fa_5tuple.kv.key[4], fa_5tuple.kv.value);
172 /* Try to match an existing session first */
174 if (acl_fa_ifc_has_sessions (am, sw_if_index0))
176 if (acl_fa_find_session
177 (am, sw_if_index0, &kv_sess, &value_sess))
179 trace_bitmap |= 0x80000000;
180 error0 = ACL_FA_ERROR_ACL_EXIST_SESSION;
181 fa_full_session_id_t f_sess_id;
183 f_sess_id.as_u64 = value_sess.value;
184 ASSERT (f_sess_id.thread_index < vec_len (vlib_mains));
187 get_session_ptr (am, f_sess_id.thread_index,
188 f_sess_id.session_index);
189 int old_timeout_type =
190 fa_session_get_timeout_type (am, sess);
192 acl_fa_track_session (am, is_input, sw_if_index0, now,
194 /* expose the session id to the tracer */
195 match_rule_index = f_sess_id.session_index;
196 int new_timeout_type =
197 fa_session_get_timeout_type (am, sess);
198 acl_check_needed = 0;
199 pkts_exist_session += 1;
200 /* Tracking might have changed the session timeout type, e.g. from transient to established */
201 if (PREDICT_FALSE (old_timeout_type != new_timeout_type))
203 acl_fa_restart_timer_for_session (am, now, f_sess_id);
204 pkts_restart_session_timer++;
206 0x00010000 + ((0xff & old_timeout_type) << 8) +
207 (0xff & new_timeout_type);
210 * I estimate the likelihood to be very low - the VPP needs
211 * to have >64K interfaces to start with and then on
212 * exactly 64K indices apart needs to be exactly the same
213 * 5-tuple... Anyway, since this probability is nonzero -
214 * print an error and drop the unlucky packet.
215 * If this shows up in real world, we would need to bump
216 * the hash key length.
218 if (PREDICT_FALSE (sess->sw_if_index != sw_if_index0))
221 ("BUG: session LSB16(sw_if_index) and 5-tuple collision!");
222 acl_check_needed = 0;
225 if (PREDICT_FALSE (am->reclassify_sessions))
227 /* if the MSB of policy epoch matches but not the LSB means it is a stale session */
229 ((current_policy_epoch ^
230 f_sess_id.intf_policy_epoch) &
231 FA_POLICY_EPOCH_IS_INPUT))
232 && (current_policy_epoch !=
233 f_sess_id.intf_policy_epoch))
235 /* delete session and increment the counter */
237 (pw->fa_session_epoch_change_by_sw_if_index,
239 vec_elt (pw->fa_session_epoch_change_by_sw_if_index,
241 if (acl_fa_conn_list_delete_session (am, f_sess_id))
243 /* delete the session only if we were able to unlink it */
244 acl_fa_delete_session (am, sw_if_index0,
247 acl_check_needed = 1;
248 trace_bitmap |= 0x40000000;
254 if (acl_check_needed)
256 action = 0; /* deny by default */
257 acl_plugin_match_5tuple_inline (lc_index0,
258 (fa_5tuple_opaque_t *) &
259 fa_5tuple, is_ip6, &action,
266 pkts_acl_permit += 1;
269 if (!acl_fa_can_add_session (am, is_input, sw_if_index0))
270 acl_fa_try_recycle_session (am, is_input, thread_index,
273 if (acl_fa_can_add_session (am, is_input, sw_if_index0))
275 if (PREDICT_TRUE (valid_new_sess))
278 acl_fa_add_session (am, is_input,
281 current_policy_epoch);
282 acl_fa_track_session (am, is_input, sw_if_index0,
283 now, sess, &fa_5tuple);
284 pkts_new_session += 1;
289 * ICMP packets with non-icmp_valid_new type will be
290 * forwared without being dropped.
293 pkts_acl_permit += 1;
299 error0 = ACL_FA_ERROR_ACL_TOO_MANY_SESSIONS;
309 next0 = vnet_l2_feature_next (b0, l2_feat_next_node_index, 0);
311 vnet_feature_next (sw_if_index0, &next0, b0);
313 #ifdef FA_NODE_VERBOSE_DEBUG
315 ("ACL_FA_NODE_DBG: sw_if_index %d lc_index %d action %d acl_index %d rule_index %d",
316 sw_if_index0, lc_index0, action, match_acl_in_index,
320 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
321 && (b0->flags & VLIB_BUFFER_IS_TRACED)))
323 acl_fa_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t));
324 t->sw_if_index = sw_if_index0;
325 t->lc_index = lc_index0;
326 t->next_index = next0;
327 t->match_acl_in_index = match_acl_in_index;
328 t->match_rule_index = match_rule_index;
329 t->packet_info[0] = fa_5tuple.kv.key[0];
330 t->packet_info[1] = fa_5tuple.kv.key[1];
331 t->packet_info[2] = fa_5tuple.kv.key[2];
332 t->packet_info[3] = fa_5tuple.kv.key[3];
333 t->packet_info[4] = fa_5tuple.kv.key[4];
334 t->packet_info[5] = fa_5tuple.kv.value;
336 t->trace_bitmap = trace_bitmap;
339 next0 = next0 < node->n_next_nodes ? next0 : 0;
341 b0->error = error_node->errors[error0];
343 pkts_acl_checked += 1;
345 /* verify speculative enqueue, maybe switch current next frame */
346 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
347 to_next, n_left_to_next, bi0,
351 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
354 vlib_node_increment_counter (vm, acl_fa_node->index,
355 ACL_FA_ERROR_ACL_CHECK, pkts_acl_checked);
356 vlib_node_increment_counter (vm, acl_fa_node->index,
357 ACL_FA_ERROR_ACL_PERMIT, pkts_acl_permit);
358 vlib_node_increment_counter (vm, acl_fa_node->index,
359 ACL_FA_ERROR_ACL_NEW_SESSION,
361 vlib_node_increment_counter (vm, acl_fa_node->index,
362 ACL_FA_ERROR_ACL_EXIST_SESSION,
364 vlib_node_increment_counter (vm, acl_fa_node->index,
365 ACL_FA_ERROR_ACL_RESTART_SESSION_TIMER,
366 pkts_restart_session_timer);
367 return frame->n_vectors;
370 vlib_node_function_t __clib_weak acl_in_ip4_l2_node_fn_avx512;
371 vlib_node_function_t __clib_weak acl_in_ip4_l2_node_fn_avx2;
373 vlib_node_function_t __clib_weak acl_out_ip4_l2_node_fn_avx512;
374 vlib_node_function_t __clib_weak acl_out_ip4_l2_node_fn_avx2;
376 vlib_node_function_t __clib_weak acl_in_ip6_l2_node_fn_avx512;
377 vlib_node_function_t __clib_weak acl_in_ip6_l2_node_fn_avx2;
379 vlib_node_function_t __clib_weak acl_out_ip6_l2_node_fn_avx512;
380 vlib_node_function_t __clib_weak acl_out_ip6_l2_node_fn_avx2;
382 vlib_node_function_t __clib_weak acl_in_ip4_fa_node_fn_avx512;
383 vlib_node_function_t __clib_weak acl_in_ip4_fa_node_fn_avx2;
385 vlib_node_function_t __clib_weak acl_out_ip4_fa_node_fn_avx512;
386 vlib_node_function_t __clib_weak acl_out_ip4_fa_node_fn_avx2;
388 vlib_node_function_t __clib_weak acl_in_ip6_fa_node_fn_avx512;
389 vlib_node_function_t __clib_weak acl_in_ip6_fa_node_fn_avx2;
391 vlib_node_function_t __clib_weak acl_out_ip6_fa_node_fn_avx512;
392 vlib_node_function_t __clib_weak acl_out_ip6_fa_node_fn_avx2;
395 vlib_node_registration_t acl_in_l2_ip6_node;
396 uword CLIB_CPU_OPTIMIZED
397 CLIB_MULTIARCH_FN (acl_in_ip6_l2_node_fn) (vlib_main_t * vm,
398 vlib_node_runtime_t * node,
399 vlib_frame_t * frame)
401 acl_main_t *am = &acl_main;
402 return acl_fa_node_fn (vm, node, frame, 1, 1, 1,
403 am->fa_acl_in_ip6_l2_node_feat_next_node_index,
404 &acl_in_l2_ip6_node);
407 vlib_node_registration_t acl_in_l2_ip4_node;
408 uword CLIB_CPU_OPTIMIZED
409 CLIB_MULTIARCH_FN (acl_in_ip4_l2_node_fn) (vlib_main_t * vm,
410 vlib_node_runtime_t * node,
411 vlib_frame_t * frame)
413 acl_main_t *am = &acl_main;
414 return acl_fa_node_fn (vm, node, frame, 0, 1, 1,
415 am->fa_acl_in_ip4_l2_node_feat_next_node_index,
416 &acl_in_l2_ip4_node);
419 vlib_node_registration_t acl_out_l2_ip6_node;
420 uword CLIB_CPU_OPTIMIZED
421 CLIB_MULTIARCH_FN (acl_out_ip6_l2_node_fn) (vlib_main_t * vm,
422 vlib_node_runtime_t * node,
423 vlib_frame_t * frame)
425 acl_main_t *am = &acl_main;
426 return acl_fa_node_fn (vm, node, frame, 1, 0, 1,
427 am->fa_acl_out_ip6_l2_node_feat_next_node_index,
428 &acl_out_l2_ip6_node);
431 vlib_node_registration_t acl_out_l2_ip4_node;
432 uword CLIB_CPU_OPTIMIZED
433 CLIB_MULTIARCH_FN (acl_out_ip4_l2_node_fn) (vlib_main_t * vm,
434 vlib_node_runtime_t * node,
435 vlib_frame_t * frame)
437 acl_main_t *am = &acl_main;
438 return acl_fa_node_fn (vm, node, frame, 0, 0, 1,
439 am->fa_acl_out_ip4_l2_node_feat_next_node_index,
440 &acl_out_l2_ip4_node);
443 /**** L3 processing path nodes ****/
445 vlib_node_registration_t acl_in_fa_ip6_node;
446 uword CLIB_CPU_OPTIMIZED
447 CLIB_MULTIARCH_FN (acl_in_ip6_fa_node_fn) (vlib_main_t * vm,
448 vlib_node_runtime_t * node,
449 vlib_frame_t * frame)
451 return acl_fa_node_fn (vm, node, frame, 1, 1, 0, 0, &acl_in_fa_ip6_node);
454 vlib_node_registration_t acl_in_fa_ip4_node;
455 uword CLIB_CPU_OPTIMIZED
456 CLIB_MULTIARCH_FN (acl_in_ip4_fa_node_fn) (vlib_main_t * vm,
457 vlib_node_runtime_t * node,
458 vlib_frame_t * frame)
460 return acl_fa_node_fn (vm, node, frame, 0, 1, 0, 0, &acl_in_fa_ip4_node);
463 vlib_node_registration_t acl_out_fa_ip6_node;
464 uword CLIB_CPU_OPTIMIZED
465 CLIB_MULTIARCH_FN (acl_out_ip6_fa_node_fn) (vlib_main_t * vm,
466 vlib_node_runtime_t * node,
467 vlib_frame_t * frame)
469 return acl_fa_node_fn (vm, node, frame, 1, 0, 0, 0, &acl_out_fa_ip6_node);
472 vlib_node_registration_t acl_out_fa_ip4_node;
473 uword CLIB_CPU_OPTIMIZED
474 CLIB_MULTIARCH_FN (acl_out_ip4_fa_node_fn) (vlib_main_t * vm,
475 vlib_node_runtime_t * node,
476 vlib_frame_t * frame)
478 return acl_fa_node_fn (vm, node, frame, 0, 0, 0, 0, &acl_out_fa_ip4_node);
484 static void __clib_constructor
485 acl_plugin_multiarch_select (void)
487 if (acl_in_ip4_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
488 acl_in_l2_ip4_node.function = acl_in_ip4_l2_node_fn_avx512;
489 else if (acl_in_ip4_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
490 acl_in_l2_ip4_node.function = acl_in_ip4_l2_node_fn_avx2;
492 if (acl_out_ip4_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
493 acl_out_l2_ip4_node.function = acl_out_ip4_l2_node_fn_avx512;
494 else if (acl_out_ip4_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
495 acl_out_l2_ip4_node.function = acl_out_ip4_l2_node_fn_avx2;
497 if (acl_in_ip6_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
498 acl_in_l2_ip6_node.function = acl_in_ip6_l2_node_fn_avx512;
499 else if (acl_in_ip6_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
500 acl_in_l2_ip6_node.function = acl_in_ip6_l2_node_fn_avx2;
502 if (acl_out_ip6_l2_node_fn_avx512 && clib_cpu_supports_avx512f ())
503 acl_out_l2_ip6_node.function = acl_out_ip6_l2_node_fn_avx512;
504 else if (acl_out_ip6_l2_node_fn_avx2 && clib_cpu_supports_avx2 ())
505 acl_out_l2_ip6_node.function = acl_out_ip6_l2_node_fn_avx2;
507 if (acl_in_ip4_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
508 acl_in_fa_ip4_node.function = acl_in_ip4_fa_node_fn_avx512;
509 else if (acl_in_ip4_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
510 acl_in_fa_ip4_node.function = acl_in_ip4_fa_node_fn_avx2;
512 if (acl_out_ip4_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
513 acl_out_fa_ip4_node.function = acl_out_ip4_fa_node_fn_avx512;
514 else if (acl_out_ip4_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
515 acl_out_fa_ip4_node.function = acl_out_ip4_fa_node_fn_avx2;
517 if (acl_in_ip6_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
518 acl_in_fa_ip6_node.function = acl_in_ip6_fa_node_fn_avx512;
519 else if (acl_in_ip6_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
520 acl_in_fa_ip6_node.function = acl_in_ip6_fa_node_fn_avx2;
522 if (acl_out_ip6_fa_node_fn_avx512 && clib_cpu_supports_avx512f ())
523 acl_out_fa_ip6_node.function = acl_out_ip6_fa_node_fn_avx512;
524 else if (acl_out_ip6_fa_node_fn_avx2 && clib_cpu_supports_avx2 ())
525 acl_out_fa_ip6_node.function = acl_out_ip6_fa_node_fn_avx2;
532 #ifndef CLIB_MULTIARCH_VARIANT
534 format_fa_5tuple (u8 * s, va_list * args)
536 fa_5tuple_t *p5t = va_arg (*args, fa_5tuple_t *);
538 return format (s, "lc_index %d (lsb16 of sw_if_index %d) l3 %s%s %U -> %U"
539 " l4 proto %d l4_valid %d port %d -> %d tcp flags (%s) %02x rsvd %x",
540 p5t->pkt.lc_index, p5t->l4.lsb_of_sw_if_index,
541 p5t->pkt.is_ip6 ? "ip6" : "ip4",
542 p5t->pkt.is_nonfirst_fragment ? " non-initial fragment" : "",
543 format_ip46_address, &p5t->addr[0],
544 p5t->pkt.is_ip6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4,
545 format_ip46_address, &p5t->addr[1],
546 p5t->pkt.is_ip6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4,
547 p5t->l4.proto, p5t->pkt.l4_valid, p5t->l4.port[0],
549 p5t->pkt.tcp_flags_valid ? "valid" : "invalid",
550 p5t->pkt.tcp_flags, p5t->pkt.flags_reserved);
554 format_acl_plugin_5tuple (u8 * s, va_list * args)
556 return format_fa_5tuple (s, args);
559 /* packet trace format function */
561 format_acl_plugin_trace (u8 * s, va_list * args)
563 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
564 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
565 acl_fa_trace_t *t = va_arg (*args, acl_fa_trace_t *);
569 "acl-plugin: lc_index: %d, sw_if_index %d, next index %d, action: %d, match: acl %d rule %d trace_bits %08x\n"
570 " pkt info %016llx %016llx %016llx %016llx %016llx %016llx",
571 t->lc_index, t->sw_if_index, t->next_index, t->action,
572 t->match_acl_in_index, t->match_rule_index, t->trace_bitmap,
573 t->packet_info[0], t->packet_info[1], t->packet_info[2],
574 t->packet_info[3], t->packet_info[4], t->packet_info[5]);
576 /* Now also print out the packet_info in a form usable by humans */
577 s = format (s, "\n %U", format_fa_5tuple, t->packet_info);
584 static char *acl_fa_error_strings[] = {
585 #define _(sym,string) string,
590 VLIB_REGISTER_NODE (acl_in_l2_ip6_node) =
592 .function = acl_in_ip6_l2_node_fn,
593 .name = "acl-plugin-in-ip6-l2",
594 .vector_size = sizeof (u32),
595 .format_trace = format_acl_plugin_trace,
596 .type = VLIB_NODE_TYPE_INTERNAL,
597 .n_errors = ARRAY_LEN (acl_fa_error_strings),
598 .error_strings = acl_fa_error_strings,
599 .n_next_nodes = ACL_FA_N_NEXT,
602 [ACL_FA_ERROR_DROP] = "error-drop",
606 VLIB_REGISTER_NODE (acl_in_l2_ip4_node) =
608 .function = acl_in_ip4_l2_node_fn,
609 .name = "acl-plugin-in-ip4-l2",
610 .vector_size = sizeof (u32),
611 .format_trace = format_acl_plugin_trace,
612 .type = VLIB_NODE_TYPE_INTERNAL,
613 .n_errors = ARRAY_LEN (acl_fa_error_strings),
614 .error_strings = acl_fa_error_strings,
615 .n_next_nodes = ACL_FA_N_NEXT,
618 [ACL_FA_ERROR_DROP] = "error-drop",
622 VLIB_REGISTER_NODE (acl_out_l2_ip6_node) =
624 .function = acl_out_ip6_l2_node_fn,
625 .name = "acl-plugin-out-ip6-l2",
626 .vector_size = sizeof (u32),
627 .format_trace = format_acl_plugin_trace,
628 .type = VLIB_NODE_TYPE_INTERNAL,
629 .n_errors = ARRAY_LEN (acl_fa_error_strings),
630 .error_strings = acl_fa_error_strings,
631 .n_next_nodes = ACL_FA_N_NEXT,
634 [ACL_FA_ERROR_DROP] = "error-drop",
638 VLIB_REGISTER_NODE (acl_out_l2_ip4_node) =
640 .function = acl_out_ip4_l2_node_fn,
641 .name = "acl-plugin-out-ip4-l2",
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",
655 VLIB_REGISTER_NODE (acl_in_fa_ip6_node) =
657 .function = acl_in_ip6_fa_node_fn,
658 .name = "acl-plugin-in-ip6-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_ip6_fa_feature, static) =
673 .arc_name = "ip6-unicast",
674 .node_name = "acl-plugin-in-ip6-fa",
675 .runs_before = VNET_FEATURES ("ip6-flow-classify"),
678 VLIB_REGISTER_NODE (acl_in_fa_ip4_node) =
680 .function = acl_in_ip4_fa_node_fn,
681 .name = "acl-plugin-in-ip4-fa",
682 .vector_size = sizeof (u32),
683 .format_trace = format_acl_plugin_trace,
684 .type = VLIB_NODE_TYPE_INTERNAL,
685 .n_errors = ARRAY_LEN (acl_fa_error_strings),
686 .error_strings = acl_fa_error_strings,
687 .n_next_nodes = ACL_FA_N_NEXT,
690 [ACL_FA_ERROR_DROP] = "error-drop",
694 VNET_FEATURE_INIT (acl_in_ip4_fa_feature, static) =
696 .arc_name = "ip4-unicast",
697 .node_name = "acl-plugin-in-ip4-fa",
698 .runs_before = VNET_FEATURES ("ip4-flow-classify"),
702 VLIB_REGISTER_NODE (acl_out_fa_ip6_node) =
704 .function = acl_out_ip6_fa_node_fn,
705 .name = "acl-plugin-out-ip6-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,
714 [ACL_FA_ERROR_DROP] = "error-drop",
718 VNET_FEATURE_INIT (acl_out_ip6_fa_feature, static) =
720 .arc_name = "ip6-output",
721 .node_name = "acl-plugin-out-ip6-fa",
722 .runs_before = VNET_FEATURES ("interface-output"),
725 VLIB_REGISTER_NODE (acl_out_fa_ip4_node) =
727 .function = acl_out_ip4_fa_node_fn,
728 .name = "acl-plugin-out-ip4-fa",
729 .vector_size = sizeof (u32),
730 .format_trace = format_acl_plugin_trace,
731 .type = VLIB_NODE_TYPE_INTERNAL,
732 .n_errors = ARRAY_LEN (acl_fa_error_strings),
733 .error_strings = acl_fa_error_strings,
734 .n_next_nodes = ACL_FA_N_NEXT,
735 /* edit / add dispositions here */
738 [ACL_FA_ERROR_DROP] = "error-drop",
742 VNET_FEATURE_INIT (acl_out_ip4_fa_feature, static) =
744 .arc_name = "ip4-output",
745 .node_name = "acl-plugin-out-ip4-fa",
746 .runs_before = VNET_FEATURES ("interface-output"),
753 * fd.io coding-style-patch-verification: ON
756 * eval: (c-set-style "gnu")