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,
74 } nonip_in_out_trace_t;
76 /* packet trace format function */
78 format_nonip_in_out_trace (u8 * s, u32 is_output, va_list * args)
80 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
81 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
82 nonip_in_out_trace_t *t = va_arg (*args, nonip_in_out_trace_t *);
84 s = format (s, "%s: sw_if_index %d next_index %x ethertype %x",
85 is_output ? "OUT-ETHER-WHITELIST" : "IN-ETHER-WHITELIST",
86 t->sw_if_index, t->next_index, t->ethertype);
91 format_l2_nonip_in_trace (u8 * s, va_list * args)
93 return format_nonip_in_out_trace (s, 0, args);
97 format_l2_nonip_out_trace (u8 * s, va_list * args)
99 return format_nonip_in_out_trace (s, 1, args);
102 #define foreach_nonip_in_error \
103 _(DROP, "dropped inbound non-whitelisted non-ip packets") \
104 _(PERMIT, "permitted inbound whitelisted non-ip packets") \
107 #define foreach_nonip_out_error \
108 _(DROP, "dropped outbound non-whitelisted non-ip packets") \
109 _(PERMIT, "permitted outbound whitelisted non-ip packets") \
116 #define _(sym,str) FA_IN_NONIP_ERROR_##sym,
117 foreach_nonip_in_error
120 } l2_in_feat_arc_error_t;
122 static char *fa_in_nonip_error_strings[] = {
123 #define _(sym,string) string,
124 foreach_nonip_in_error
130 #define _(sym,str) FA_OUT_NONIP_ERROR_##sym,
131 foreach_nonip_out_error
133 FA_OUT_NONIP_N_ERROR,
134 } l2_out_feat_arc_error_t;
136 static char *fa_out_nonip_error_strings[] = {
137 #define _(sym,string) string,
138 foreach_nonip_out_error
145 is_permitted_ethertype (acl_main_t * am, int sw_if_index0, int is_output,
149 ? am->output_etype_whitelist_by_sw_if_index
150 : am->input_etype_whitelist_by_sw_if_index;
151 u16 *whitelist = vec_elt (v, sw_if_index0);
154 if (vec_len (whitelist) == 0)
157 for (i = 0; i < vec_len (whitelist); i++)
158 if (whitelist[i] == ethertype)
163 #define get_u16(addr) ( *((u16 *)(addr)) )
166 nonip_in_out_node_fn (vlib_main_t * vm,
167 vlib_node_runtime_t * node, vlib_frame_t * frame,
170 acl_main_t *am = &acl_main;
172 u16 nexts[VLIB_FRAME_SIZE], *next;
173 vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
174 vlib_node_runtime_t *error_node;
176 from = vlib_frame_vector_args (frame);
177 error_node = vlib_node_get_runtime (vm, node->node_index);
178 vlib_get_buffers (vm, from, bufs, frame->n_vectors);
179 /* set the initial values for the current buffer the next pointers */
183 n_left = frame->n_vectors;
188 vnet_buffer (b[0])->sw_if_index[is_output ? VLIB_TX : VLIB_RX];
193 ethernet_header_t *h0 = vlib_buffer_get_current (b[0]);
194 u8 *l3h0 = (u8 *) h0 + vnet_buffer (b[0])->l2.l2_len;
195 ethertype = clib_net_to_host_u16 (get_u16 (l3h0 - 2));
197 if (is_permitted_ethertype (am, sw_if_index0, is_output, ethertype))
198 vnet_feature_next (&next_index, b[0]);
200 next[0] = next_index;
203 b[0]->error = error_node->errors[error0];
205 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
206 && (b[0]->flags & VLIB_BUFFER_IS_TRACED)))
208 nonip_in_out_trace_t *t =
209 vlib_add_trace (vm, node, b[0], sizeof (*t));
210 t->sw_if_index = sw_if_index0;
211 t->ethertype = ethertype;
212 t->next_index = next[0];
214 next[0] = next[0] < node->n_next_nodes ? next[0] : 0;
220 vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors);
222 return frame->n_vectors;
225 VLIB_NODE_FN (acl_in_nonip_node) (vlib_main_t * vm,
226 vlib_node_runtime_t * node,
227 vlib_frame_t * frame)
229 return nonip_in_out_node_fn (vm, node, frame, 0);
232 VLIB_NODE_FN (acl_out_nonip_node) (vlib_main_t * vm,
233 vlib_node_runtime_t * node,
234 vlib_frame_t * frame)
236 return nonip_in_out_node_fn (vm, node, frame, 1);
242 VLIB_REGISTER_NODE (acl_in_nonip_node) =
244 .name = "acl-plugin-in-nonip-l2",
245 .vector_size = sizeof (u32),
246 .format_trace = format_l2_nonip_in_trace,
247 .type = VLIB_NODE_TYPE_INTERNAL,
248 .n_errors = ARRAY_LEN (fa_in_nonip_error_strings),
249 .error_strings = fa_in_nonip_error_strings,
250 .n_next_nodes = ACL_FA_N_NEXT,
253 [ACL_FA_ERROR_DROP] = "error-drop",
257 VNET_FEATURE_INIT (acl_in_l2_nonip_fa_feature, static) =
259 .arc_name = "l2-input-nonip",
260 .node_name = "acl-plugin-in-nonip-l2",
261 .runs_before = VNET_FEATURES ("l2-input-feat-arc-end"),
264 VLIB_REGISTER_NODE (acl_out_nonip_node) =
266 .name = "acl-plugin-out-nonip-l2",
267 .vector_size = sizeof (u32),
268 .format_trace = format_l2_nonip_out_trace,
269 .type = VLIB_NODE_TYPE_INTERNAL,
270 .n_errors = ARRAY_LEN (fa_out_nonip_error_strings),
271 .error_strings = fa_out_nonip_error_strings,
272 .n_next_nodes = ACL_FA_N_NEXT,
275 [ACL_FA_ERROR_DROP] = "error-drop",
279 VNET_FEATURE_INIT (acl_out_l2_nonip_fa_feature, static) =
281 .arc_name = "l2-output-nonip",
282 .node_name = "acl-plugin-out-nonip-l2",
283 .runs_before = VNET_FEATURES ("l2-output-feat-arc-end"),
291 get_current_policy_epoch (acl_main_t * am, int is_input, u32 sw_if_index0)
294 is_input ? &am->input_policy_epoch_by_sw_if_index :
295 &am->output_policy_epoch_by_sw_if_index;
296 u16 current_policy_epoch =
297 sw_if_index0 < vec_len (*p_epoch_vec) ? vec_elt (*p_epoch_vec,
299 : (is_input * FA_POLICY_EPOCH_IS_INPUT);
300 return current_policy_epoch;
304 acl_fa_node_fn (vlib_main_t * vm,
305 vlib_node_runtime_t * node, vlib_frame_t * frame, int is_ip6,
306 int is_input, int is_l2_path)
309 u32 pkts_acl_checked = 0;
310 u32 pkts_new_session = 0;
311 u32 pkts_exist_session = 0;
312 u32 pkts_acl_permit = 0;
313 u32 pkts_restart_session_timer = 0;
314 u32 trace_bitmap = 0;
315 acl_main_t *am = &acl_main;
316 fa_5tuple_t fa_5tuple;
317 vlib_node_runtime_t *error_node;
318 u64 now = clib_cpu_time_now ();
319 uword thread_index = os_get_thread_index ();
320 acl_fa_per_worker_data_t *pw = &am->per_worker_data[thread_index];
322 u16 nexts[VLIB_FRAME_SIZE], *next;
323 vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
325 from = vlib_frame_vector_args (frame);
327 error_node = vlib_node_get_runtime (vm, node->node_index);
329 vlib_get_buffers (vm, from, bufs, frame->n_vectors);
330 /* set the initial values for the current buffer the next pointers */
334 n_left = frame->n_vectors;
341 int acl_check_needed = 1;
342 u32 match_acl_in_index = ~0;
343 u32 match_acl_pos = ~0;
344 u32 match_rule_index = ~0;
350 sw_if_index0 = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
352 sw_if_index0 = vnet_buffer (b[0])->sw_if_index[VLIB_TX];
355 lc_index0 = am->input_lc_index_by_sw_if_index[sw_if_index0];
357 lc_index0 = am->output_lc_index_by_sw_if_index[sw_if_index0];
359 u16 current_policy_epoch =
360 get_current_policy_epoch (am, is_input, sw_if_index0);
364 * Extract the L3/L4 matching info into a 5-tuple structure.
367 acl_fill_5tuple (&acl_main, sw_if_index0, b[0], is_ip6,
368 is_input, is_l2_path, &fa_5tuple);
370 #ifdef FA_NODE_VERBOSE_DEBUG
372 ("ACL_FA_NODE_DBG: packet 5-tuple %016llx %016llx %016llx %016llx %016llx %016llx",
373 fa_5tuple.kv.key[0], fa_5tuple.kv.key[1], fa_5tuple.kv.key[2],
374 fa_5tuple.kv.key[3], fa_5tuple.kv.key[4], fa_5tuple.kv.value);
377 /* Try to match an existing session first */
379 if (acl_fa_ifc_has_sessions (am, sw_if_index0))
381 u64 value_sess = ~0ULL;
382 if (acl_fa_find_session
383 (am, is_ip6, sw_if_index0, &fa_5tuple, &value_sess)
384 && (value_sess != ~0ULL))
386 trace_bitmap |= 0x80000000;
387 error0 = ACL_FA_ERROR_ACL_EXIST_SESSION;
388 fa_full_session_id_t f_sess_id;
390 f_sess_id.as_u64 = value_sess;
391 ASSERT (f_sess_id.thread_index < vec_len (vlib_mains));
394 get_session_ptr (am, f_sess_id.thread_index,
395 f_sess_id.session_index);
396 int old_timeout_type = fa_session_get_timeout_type (am, sess);
398 acl_fa_track_session (am, is_input, sw_if_index0, now,
400 /* expose the session id to the tracer */
401 match_rule_index = f_sess_id.session_index;
402 int new_timeout_type = fa_session_get_timeout_type (am, sess);
403 acl_check_needed = 0;
404 pkts_exist_session += 1;
405 /* Tracking might have changed the session timeout type, e.g. from transient to established */
406 if (PREDICT_FALSE (old_timeout_type != new_timeout_type))
408 acl_fa_restart_timer_for_session (am, now, f_sess_id);
409 pkts_restart_session_timer++;
411 0x00010000 + ((0xff & old_timeout_type) << 8) +
412 (0xff & new_timeout_type);
415 * I estimate the likelihood to be very low - the VPP needs
416 * to have >64K interfaces to start with and then on
417 * exactly 64K indices apart needs to be exactly the same
418 * 5-tuple... Anyway, since this probability is nonzero -
419 * print an error and drop the unlucky packet.
420 * If this shows up in real world, we would need to bump
421 * the hash key length.
423 if (PREDICT_FALSE (sess->sw_if_index != sw_if_index0))
426 ("BUG: session LSB16(sw_if_index) and 5-tuple collision!");
427 acl_check_needed = 0;
430 if (PREDICT_FALSE (am->reclassify_sessions))
432 /* if the MSB of policy epoch matches but not the LSB means it is a stale session */
434 ((current_policy_epoch ^
435 f_sess_id.intf_policy_epoch) &
436 FA_POLICY_EPOCH_IS_INPUT))
437 && (current_policy_epoch !=
438 f_sess_id.intf_policy_epoch))
440 /* delete session and increment the counter */
442 (pw->fa_session_epoch_change_by_sw_if_index,
444 vec_elt (pw->fa_session_epoch_change_by_sw_if_index,
446 if (acl_fa_conn_list_delete_session
447 (am, f_sess_id, now))
449 /* delete the session only if we were able to unlink it */
450 acl_fa_two_stage_delete_session (am, sw_if_index0,
453 acl_check_needed = 1;
454 trace_bitmap |= 0x40000000;
460 if (acl_check_needed)
462 action = 0; /* deny by default */
463 acl_plugin_match_5tuple_inline (&acl_main, lc_index0,
464 (fa_5tuple_opaque_t *) &
465 fa_5tuple, is_ip6, &action,
468 &match_rule_index, &trace_bitmap);
471 pkts_acl_permit += 1;
474 if (!acl_fa_can_add_session (am, is_input, sw_if_index0))
475 acl_fa_try_recycle_session (am, is_input, thread_index,
478 if (acl_fa_can_add_session (am, is_input, sw_if_index0))
481 acl_fa_add_session (am, is_input, is_ip6,
484 current_policy_epoch);
485 acl_fa_track_session (am, is_input, sw_if_index0,
486 now, sess, &fa_5tuple);
487 pkts_new_session += 1;
492 error0 = ACL_FA_ERROR_ACL_TOO_MANY_SESSIONS;
501 vnet_feature_next (&next0, b[0]);
503 #ifdef FA_NODE_VERBOSE_DEBUG
505 ("ACL_FA_NODE_DBG: sw_if_index %d lc_index %d action %d acl_index %d rule_index %d",
506 sw_if_index0, lc_index0, action, match_acl_in_index,
510 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
511 && (b[0]->flags & VLIB_BUFFER_IS_TRACED)))
513 acl_fa_trace_t *t = vlib_add_trace (vm, node, b[0], sizeof (*t));
514 t->sw_if_index = sw_if_index0;
515 t->lc_index = lc_index0;
516 t->next_index = next0;
517 t->match_acl_in_index = match_acl_in_index;
518 t->match_rule_index = match_rule_index;
519 t->packet_info[0] = fa_5tuple.kv_40_8.key[0];
520 t->packet_info[1] = fa_5tuple.kv_40_8.key[1];
521 t->packet_info[2] = fa_5tuple.kv_40_8.key[2];
522 t->packet_info[3] = fa_5tuple.kv_40_8.key[3];
523 t->packet_info[4] = fa_5tuple.kv_40_8.key[4];
524 t->packet_info[5] = fa_5tuple.kv_40_8.value;
526 t->trace_bitmap = trace_bitmap;
529 next0 = next0 < node->n_next_nodes ? next0 : 0;
531 b[0]->error = error_node->errors[error0];
536 pkts_acl_checked += 1;
539 vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors);
541 vlib_node_increment_counter (vm, node->node_index,
542 ACL_FA_ERROR_ACL_CHECK, pkts_acl_checked);
543 vlib_node_increment_counter (vm, node->node_index,
544 ACL_FA_ERROR_ACL_PERMIT, pkts_acl_permit);
545 vlib_node_increment_counter (vm, node->node_index,
546 ACL_FA_ERROR_ACL_NEW_SESSION,
548 vlib_node_increment_counter (vm, node->node_index,
549 ACL_FA_ERROR_ACL_EXIST_SESSION,
551 vlib_node_increment_counter (vm, node->node_index,
552 ACL_FA_ERROR_ACL_RESTART_SESSION_TIMER,
553 pkts_restart_session_timer);
554 return frame->n_vectors;
557 VLIB_NODE_FN (acl_in_l2_ip6_node) (vlib_main_t * vm,
558 vlib_node_runtime_t * node,
559 vlib_frame_t * frame)
561 return acl_fa_node_fn (vm, node, frame, 1, 1, 1);
564 VLIB_NODE_FN (acl_in_l2_ip4_node) (vlib_main_t * vm,
565 vlib_node_runtime_t * node,
566 vlib_frame_t * frame)
568 return acl_fa_node_fn (vm, node, frame, 0, 1, 1);
571 VLIB_NODE_FN (acl_out_l2_ip6_node) (vlib_main_t * vm,
572 vlib_node_runtime_t * node,
573 vlib_frame_t * frame)
575 return acl_fa_node_fn (vm, node, frame, 1, 0, 1);
578 VLIB_NODE_FN (acl_out_l2_ip4_node) (vlib_main_t * vm,
579 vlib_node_runtime_t * node,
580 vlib_frame_t * frame)
582 return acl_fa_node_fn (vm, node, frame, 0, 0, 1);
585 /**** L3 processing path nodes ****/
587 VLIB_NODE_FN (acl_in_fa_ip6_node) (vlib_main_t * vm,
588 vlib_node_runtime_t * node,
589 vlib_frame_t * frame)
591 return acl_fa_node_fn (vm, node, frame, 1, 1, 0);
594 VLIB_NODE_FN (acl_in_fa_ip4_node) (vlib_main_t * vm,
595 vlib_node_runtime_t * node,
596 vlib_frame_t * frame)
598 return acl_fa_node_fn (vm, node, frame, 0, 1, 0);
601 VLIB_NODE_FN (acl_out_fa_ip6_node) (vlib_main_t * vm,
602 vlib_node_runtime_t * node,
603 vlib_frame_t * frame)
605 return acl_fa_node_fn (vm, node, frame, 1, 0, 0);
608 VLIB_NODE_FN (acl_out_fa_ip4_node) (vlib_main_t * vm,
609 vlib_node_runtime_t * node,
610 vlib_frame_t * frame)
612 return acl_fa_node_fn (vm, node, frame, 0, 0, 0);
616 format_fa_5tuple (u8 * s, va_list * args)
618 fa_5tuple_t *p5t = va_arg (*args, fa_5tuple_t *);
621 void *format_address_func;
624 p5t->pkt.is_nonfirst_fragment ? " non-initial fragment" : "";
629 format_address_func = format_ip6_address;
630 paddr0 = &p5t->ip6_addr[0];
631 paddr1 = &p5t->ip6_addr[1];
636 format_address_func = format_ip4_address;
637 paddr0 = &p5t->ip4_addr[0];
638 paddr1 = &p5t->ip4_addr[1];
642 format (s, "lc_index %d l3 %s%s ", p5t->pkt.lc_index, ip_af, ip_frag_txt);
644 format (s, "%U -> %U ", format_address_func, paddr0, format_address_func,
646 s = format (s, "%U ", format_fa_session_l4_key, &p5t->l4);
647 s = format (s, "tcp flags (%s) %02x rsvd %x",
648 p5t->pkt.tcp_flags_valid ? "valid" : "invalid",
649 p5t->pkt.tcp_flags, p5t->pkt.flags_reserved);
653 #ifndef CLIB_MARCH_VARIANT
655 format_acl_plugin_5tuple (u8 * s, va_list * args)
657 return format_fa_5tuple (s, args);
661 /* packet trace format function */
663 format_acl_plugin_trace (u8 * s, va_list * args)
665 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
666 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
667 acl_fa_trace_t *t = va_arg (*args, acl_fa_trace_t *);
671 "acl-plugin: lc_index: %d, sw_if_index %d, next index %d, action: %d, match: acl %d rule %d trace_bits %08x\n"
672 " pkt info %016llx %016llx %016llx %016llx %016llx %016llx",
673 t->lc_index, t->sw_if_index, t->next_index, t->action,
674 t->match_acl_in_index, t->match_rule_index, t->trace_bitmap,
675 t->packet_info[0], t->packet_info[1], t->packet_info[2],
676 t->packet_info[3], t->packet_info[4], t->packet_info[5]);
678 /* Now also print out the packet_info in a form usable by humans */
679 s = format (s, "\n %U", format_fa_5tuple, t->packet_info);
685 static char *acl_fa_error_strings[] = {
686 #define _(sym,string) string,
691 VLIB_REGISTER_NODE (acl_in_l2_ip6_node) =
693 .name = "acl-plugin-in-ip6-l2",
694 .vector_size = sizeof (u32),
695 .format_trace = format_acl_plugin_trace,
696 .type = VLIB_NODE_TYPE_INTERNAL,
697 .n_errors = ARRAY_LEN (acl_fa_error_strings),
698 .error_strings = acl_fa_error_strings,
699 .n_next_nodes = ACL_FA_N_NEXT,
702 [ACL_FA_ERROR_DROP] = "error-drop",
706 VNET_FEATURE_INIT (acl_in_l2_ip6_fa_feature, static) =
708 .arc_name = "l2-input-ip6",
709 .node_name = "acl-plugin-in-ip6-l2",
710 .runs_before = VNET_FEATURES ("l2-input-feat-arc-end"),
713 VLIB_REGISTER_NODE (acl_in_l2_ip4_node) =
715 .name = "acl-plugin-in-ip4-l2",
716 .vector_size = sizeof (u32),
717 .format_trace = format_acl_plugin_trace,
718 .type = VLIB_NODE_TYPE_INTERNAL,
719 .n_errors = ARRAY_LEN (acl_fa_error_strings),
720 .error_strings = acl_fa_error_strings,
721 .n_next_nodes = ACL_FA_N_NEXT,
724 [ACL_FA_ERROR_DROP] = "error-drop",
728 VNET_FEATURE_INIT (acl_in_l2_ip4_fa_feature, static) =
730 .arc_name = "l2-input-ip4",
731 .node_name = "acl-plugin-in-ip4-l2",
732 .runs_before = VNET_FEATURES ("l2-input-feat-arc-end"),
736 VLIB_REGISTER_NODE (acl_out_l2_ip6_node) =
738 .name = "acl-plugin-out-ip6-l2",
739 .vector_size = sizeof (u32),
740 .format_trace = format_acl_plugin_trace,
741 .type = VLIB_NODE_TYPE_INTERNAL,
742 .n_errors = ARRAY_LEN (acl_fa_error_strings),
743 .error_strings = acl_fa_error_strings,
744 .n_next_nodes = ACL_FA_N_NEXT,
747 [ACL_FA_ERROR_DROP] = "error-drop",
751 VNET_FEATURE_INIT (acl_out_l2_ip6_fa_feature, static) =
753 .arc_name = "l2-output-ip6",
754 .node_name = "acl-plugin-out-ip6-l2",
755 .runs_before = VNET_FEATURES ("l2-output-feat-arc-end"),
759 VLIB_REGISTER_NODE (acl_out_l2_ip4_node) =
761 .name = "acl-plugin-out-ip4-l2",
762 .vector_size = sizeof (u32),
763 .format_trace = format_acl_plugin_trace,
764 .type = VLIB_NODE_TYPE_INTERNAL,
765 .n_errors = ARRAY_LEN (acl_fa_error_strings),
766 .error_strings = acl_fa_error_strings,
767 .n_next_nodes = ACL_FA_N_NEXT,
770 [ACL_FA_ERROR_DROP] = "error-drop",
774 VNET_FEATURE_INIT (acl_out_l2_ip4_fa_feature, static) =
776 .arc_name = "l2-output-ip4",
777 .node_name = "acl-plugin-out-ip4-l2",
778 .runs_before = VNET_FEATURES ("l2-output-feat-arc-end"),
782 VLIB_REGISTER_NODE (acl_in_fa_ip6_node) =
784 .name = "acl-plugin-in-ip6-fa",
785 .vector_size = sizeof (u32),
786 .format_trace = format_acl_plugin_trace,
787 .type = VLIB_NODE_TYPE_INTERNAL,
788 .n_errors = ARRAY_LEN (acl_fa_error_strings),
789 .error_strings = acl_fa_error_strings,
790 .n_next_nodes = ACL_FA_N_NEXT,
793 [ACL_FA_ERROR_DROP] = "error-drop",
797 VNET_FEATURE_INIT (acl_in_ip6_fa_feature, static) =
799 .arc_name = "ip6-unicast",
800 .node_name = "acl-plugin-in-ip6-fa",
801 .runs_before = VNET_FEATURES ("ip6-flow-classify"),
804 VLIB_REGISTER_NODE (acl_in_fa_ip4_node) =
806 .name = "acl-plugin-in-ip4-fa",
807 .vector_size = sizeof (u32),
808 .format_trace = format_acl_plugin_trace,
809 .type = VLIB_NODE_TYPE_INTERNAL,
810 .n_errors = ARRAY_LEN (acl_fa_error_strings),
811 .error_strings = acl_fa_error_strings,
812 .n_next_nodes = ACL_FA_N_NEXT,
815 [ACL_FA_ERROR_DROP] = "error-drop",
819 VNET_FEATURE_INIT (acl_in_ip4_fa_feature, static) =
821 .arc_name = "ip4-unicast",
822 .node_name = "acl-plugin-in-ip4-fa",
823 .runs_before = VNET_FEATURES ("ip4-flow-classify"),
827 VLIB_REGISTER_NODE (acl_out_fa_ip6_node) =
829 .name = "acl-plugin-out-ip6-fa",
830 .vector_size = sizeof (u32),
831 .format_trace = format_acl_plugin_trace,
832 .type = VLIB_NODE_TYPE_INTERNAL,
833 .n_errors = ARRAY_LEN (acl_fa_error_strings),
834 .error_strings = acl_fa_error_strings,
835 .n_next_nodes = ACL_FA_N_NEXT,
838 [ACL_FA_ERROR_DROP] = "error-drop",
842 VNET_FEATURE_INIT (acl_out_ip6_fa_feature, static) =
844 .arc_name = "ip6-output",
845 .node_name = "acl-plugin-out-ip6-fa",
846 .runs_before = VNET_FEATURES ("interface-output"),
849 VLIB_REGISTER_NODE (acl_out_fa_ip4_node) =
851 .name = "acl-plugin-out-ip4-fa",
852 .vector_size = sizeof (u32),
853 .format_trace = format_acl_plugin_trace,
854 .type = VLIB_NODE_TYPE_INTERNAL,
855 .n_errors = ARRAY_LEN (acl_fa_error_strings),
856 .error_strings = acl_fa_error_strings,
857 .n_next_nodes = ACL_FA_N_NEXT,
858 /* edit / add dispositions here */
861 [ACL_FA_ERROR_DROP] = "error-drop",
865 VNET_FEATURE_INIT (acl_out_ip4_fa_feature, static) =
867 .arc_name = "ip4-output",
868 .node_name = "acl-plugin-out-ip4-fa",
869 .runs_before = VNET_FEATURES ("interface-output"),
875 * fd.io coding-style-patch-verification: ON
878 * eval: (c-set-style "gnu")