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,
168 int is_output, vlib_node_registration_t * fa_node)
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, fa_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_registration_t acl_in_nonip_node;
226 VLIB_NODE_FN (acl_in_nonip_node) (vlib_main_t * vm,
227 vlib_node_runtime_t * node,
228 vlib_frame_t * frame)
230 return nonip_in_out_node_fn (vm, node, frame, 0, &acl_in_nonip_node);
233 vlib_node_registration_t acl_out_nonip_node;
234 VLIB_NODE_FN (acl_out_nonip_node) (vlib_main_t * vm,
235 vlib_node_runtime_t * node,
236 vlib_frame_t * frame)
238 return nonip_in_out_node_fn (vm, node, frame, 1, &acl_in_nonip_node);
244 VLIB_NODE_FUNCTION_MULTIARCH (acl_in_nonip_node, acl_in_nonip_node_fn)
245 VLIB_NODE_FUNCTION_MULTIARCH (acl_out_nonip_node, acl_out_nonip_node_fn)
247 VLIB_REGISTER_NODE (acl_in_nonip_node) =
249 .name = "acl-plugin-in-nonip-l2",
250 .vector_size = sizeof (u32),
251 .format_trace = format_l2_nonip_in_trace,
252 .type = VLIB_NODE_TYPE_INTERNAL,
253 .n_errors = ARRAY_LEN (fa_in_nonip_error_strings),
254 .error_strings = fa_in_nonip_error_strings,
255 .n_next_nodes = ACL_FA_N_NEXT,
258 [ACL_FA_ERROR_DROP] = "error-drop",
262 VNET_FEATURE_INIT (acl_in_l2_nonip_fa_feature, static) =
264 .arc_name = "l2-input-nonip",
265 .node_name = "acl-plugin-in-nonip-l2",
266 .runs_before = VNET_FEATURES ("l2-input-feat-arc-end"),
269 VLIB_REGISTER_NODE (acl_out_nonip_node) =
271 .name = "acl-plugin-out-nonip-l2",
272 .vector_size = sizeof (u32),
273 .format_trace = format_l2_nonip_out_trace,
274 .type = VLIB_NODE_TYPE_INTERNAL,
275 .n_errors = ARRAY_LEN (fa_out_nonip_error_strings),
276 .error_strings = fa_out_nonip_error_strings,
277 .n_next_nodes = ACL_FA_N_NEXT,
280 [ACL_FA_ERROR_DROP] = "error-drop",
284 VNET_FEATURE_INIT (acl_out_l2_nonip_fa_feature, static) =
286 .arc_name = "l2-output-nonip",
287 .node_name = "acl-plugin-out-nonip-l2",
288 .runs_before = VNET_FEATURES ("l2-output-feat-arc-end"),
296 get_current_policy_epoch (acl_main_t * am, int is_input, u32 sw_if_index0)
299 is_input ? &am->input_policy_epoch_by_sw_if_index :
300 &am->output_policy_epoch_by_sw_if_index;
301 u16 current_policy_epoch =
302 sw_if_index0 < vec_len (*p_epoch_vec) ? vec_elt (*p_epoch_vec,
304 : (is_input * FA_POLICY_EPOCH_IS_INPUT);
305 return current_policy_epoch;
309 acl_fa_node_fn (vlib_main_t * vm,
310 vlib_node_runtime_t * node, vlib_frame_t * frame, int is_ip6,
311 int is_input, int is_l2_path,
312 vlib_node_registration_t * acl_fa_node)
315 u32 pkts_acl_checked = 0;
316 u32 pkts_new_session = 0;
317 u32 pkts_exist_session = 0;
318 u32 pkts_acl_permit = 0;
319 u32 pkts_restart_session_timer = 0;
320 u32 trace_bitmap = 0;
321 acl_main_t *am = &acl_main;
322 fa_5tuple_t fa_5tuple;
323 vlib_node_runtime_t *error_node;
324 u64 now = clib_cpu_time_now ();
325 uword thread_index = os_get_thread_index ();
326 acl_fa_per_worker_data_t *pw = &am->per_worker_data[thread_index];
328 u16 nexts[VLIB_FRAME_SIZE], *next;
329 vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
331 from = vlib_frame_vector_args (frame);
333 error_node = vlib_node_get_runtime (vm, acl_fa_node->index);
335 vlib_get_buffers (vm, from, bufs, frame->n_vectors);
336 /* set the initial values for the current buffer the next pointers */
340 n_left = frame->n_vectors;
347 int acl_check_needed = 1;
348 u32 match_acl_in_index = ~0;
349 u32 match_acl_pos = ~0;
350 u32 match_rule_index = ~0;
356 sw_if_index0 = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
358 sw_if_index0 = vnet_buffer (b[0])->sw_if_index[VLIB_TX];
361 lc_index0 = am->input_lc_index_by_sw_if_index[sw_if_index0];
363 lc_index0 = am->output_lc_index_by_sw_if_index[sw_if_index0];
365 u16 current_policy_epoch =
366 get_current_policy_epoch (am, is_input, sw_if_index0);
370 * Extract the L3/L4 matching info into a 5-tuple structure.
373 acl_fill_5tuple (&acl_main, sw_if_index0, b[0], is_ip6,
374 is_input, is_l2_path, &fa_5tuple);
376 #ifdef FA_NODE_VERBOSE_DEBUG
378 ("ACL_FA_NODE_DBG: packet 5-tuple %016llx %016llx %016llx %016llx %016llx %016llx",
379 fa_5tuple.kv.key[0], fa_5tuple.kv.key[1], fa_5tuple.kv.key[2],
380 fa_5tuple.kv.key[3], fa_5tuple.kv.key[4], fa_5tuple.kv.value);
383 /* Try to match an existing session first */
385 if (acl_fa_ifc_has_sessions (am, sw_if_index0))
387 u64 value_sess = ~0ULL;
388 if (acl_fa_find_session
389 (am, is_ip6, sw_if_index0, &fa_5tuple, &value_sess)
390 && (value_sess != ~0ULL))
392 trace_bitmap |= 0x80000000;
393 error0 = ACL_FA_ERROR_ACL_EXIST_SESSION;
394 fa_full_session_id_t f_sess_id;
396 f_sess_id.as_u64 = value_sess;
397 ASSERT (f_sess_id.thread_index < vec_len (vlib_mains));
400 get_session_ptr (am, f_sess_id.thread_index,
401 f_sess_id.session_index);
402 int old_timeout_type = fa_session_get_timeout_type (am, sess);
404 acl_fa_track_session (am, is_input, sw_if_index0, now,
406 /* expose the session id to the tracer */
407 match_rule_index = f_sess_id.session_index;
408 int new_timeout_type = fa_session_get_timeout_type (am, sess);
409 acl_check_needed = 0;
410 pkts_exist_session += 1;
411 /* Tracking might have changed the session timeout type, e.g. from transient to established */
412 if (PREDICT_FALSE (old_timeout_type != new_timeout_type))
414 acl_fa_restart_timer_for_session (am, now, f_sess_id);
415 pkts_restart_session_timer++;
417 0x00010000 + ((0xff & old_timeout_type) << 8) +
418 (0xff & new_timeout_type);
421 * I estimate the likelihood to be very low - the VPP needs
422 * to have >64K interfaces to start with and then on
423 * exactly 64K indices apart needs to be exactly the same
424 * 5-tuple... Anyway, since this probability is nonzero -
425 * print an error and drop the unlucky packet.
426 * If this shows up in real world, we would need to bump
427 * the hash key length.
429 if (PREDICT_FALSE (sess->sw_if_index != sw_if_index0))
432 ("BUG: session LSB16(sw_if_index) and 5-tuple collision!");
433 acl_check_needed = 0;
436 if (PREDICT_FALSE (am->reclassify_sessions))
438 /* if the MSB of policy epoch matches but not the LSB means it is a stale session */
440 ((current_policy_epoch ^
441 f_sess_id.intf_policy_epoch) &
442 FA_POLICY_EPOCH_IS_INPUT))
443 && (current_policy_epoch !=
444 f_sess_id.intf_policy_epoch))
446 /* delete session and increment the counter */
448 (pw->fa_session_epoch_change_by_sw_if_index,
450 vec_elt (pw->fa_session_epoch_change_by_sw_if_index,
452 if (acl_fa_conn_list_delete_session
453 (am, f_sess_id, now))
455 /* delete the session only if we were able to unlink it */
456 acl_fa_two_stage_delete_session (am, sw_if_index0,
459 acl_check_needed = 1;
460 trace_bitmap |= 0x40000000;
466 if (acl_check_needed)
468 action = 0; /* deny by default */
469 acl_plugin_match_5tuple_inline (&acl_main, lc_index0,
470 (fa_5tuple_opaque_t *) &
471 fa_5tuple, is_ip6, &action,
474 &match_rule_index, &trace_bitmap);
477 pkts_acl_permit += 1;
480 if (!acl_fa_can_add_session (am, is_input, sw_if_index0))
481 acl_fa_try_recycle_session (am, is_input, thread_index,
484 if (acl_fa_can_add_session (am, is_input, sw_if_index0))
487 acl_fa_add_session (am, is_input, is_ip6,
490 current_policy_epoch);
491 acl_fa_track_session (am, is_input, sw_if_index0,
492 now, sess, &fa_5tuple);
493 pkts_new_session += 1;
498 error0 = ACL_FA_ERROR_ACL_TOO_MANY_SESSIONS;
507 vnet_feature_next (&next0, b[0]);
509 #ifdef FA_NODE_VERBOSE_DEBUG
511 ("ACL_FA_NODE_DBG: sw_if_index %d lc_index %d action %d acl_index %d rule_index %d",
512 sw_if_index0, lc_index0, action, match_acl_in_index,
516 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
517 && (b[0]->flags & VLIB_BUFFER_IS_TRACED)))
519 acl_fa_trace_t *t = vlib_add_trace (vm, node, b[0], sizeof (*t));
520 t->sw_if_index = sw_if_index0;
521 t->lc_index = lc_index0;
522 t->next_index = next0;
523 t->match_acl_in_index = match_acl_in_index;
524 t->match_rule_index = match_rule_index;
525 t->packet_info[0] = fa_5tuple.kv_40_8.key[0];
526 t->packet_info[1] = fa_5tuple.kv_40_8.key[1];
527 t->packet_info[2] = fa_5tuple.kv_40_8.key[2];
528 t->packet_info[3] = fa_5tuple.kv_40_8.key[3];
529 t->packet_info[4] = fa_5tuple.kv_40_8.key[4];
530 t->packet_info[5] = fa_5tuple.kv_40_8.value;
532 t->trace_bitmap = trace_bitmap;
535 next0 = next0 < node->n_next_nodes ? next0 : 0;
537 b[0]->error = error_node->errors[error0];
542 pkts_acl_checked += 1;
545 vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors);
547 vlib_node_increment_counter (vm, acl_fa_node->index,
548 ACL_FA_ERROR_ACL_CHECK, pkts_acl_checked);
549 vlib_node_increment_counter (vm, acl_fa_node->index,
550 ACL_FA_ERROR_ACL_PERMIT, pkts_acl_permit);
551 vlib_node_increment_counter (vm, acl_fa_node->index,
552 ACL_FA_ERROR_ACL_NEW_SESSION,
554 vlib_node_increment_counter (vm, acl_fa_node->index,
555 ACL_FA_ERROR_ACL_EXIST_SESSION,
557 vlib_node_increment_counter (vm, acl_fa_node->index,
558 ACL_FA_ERROR_ACL_RESTART_SESSION_TIMER,
559 pkts_restart_session_timer);
560 return frame->n_vectors;
563 vlib_node_registration_t acl_in_l2_ip6_node;
564 VLIB_NODE_FN (acl_in_l2_ip6_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, 1, 1, 1, &acl_in_l2_ip6_node);
571 vlib_node_registration_t acl_in_l2_ip4_node;
572 VLIB_NODE_FN (acl_in_l2_ip4_node) (vlib_main_t * vm,
573 vlib_node_runtime_t * node,
574 vlib_frame_t * frame)
576 return acl_fa_node_fn (vm, node, frame, 0, 1, 1, &acl_in_l2_ip4_node);
579 vlib_node_registration_t acl_out_l2_ip6_node;
580 VLIB_NODE_FN (acl_out_l2_ip6_node) (vlib_main_t * vm,
581 vlib_node_runtime_t * node,
582 vlib_frame_t * frame)
584 return acl_fa_node_fn (vm, node, frame, 1, 0, 1, &acl_out_l2_ip6_node);
587 vlib_node_registration_t acl_out_l2_ip4_node;
588 VLIB_NODE_FN (acl_out_l2_ip4_node) (vlib_main_t * vm,
589 vlib_node_runtime_t * node,
590 vlib_frame_t * frame)
592 return acl_fa_node_fn (vm, node, frame, 0, 0, 1, &acl_out_l2_ip4_node);
595 /**** L3 processing path nodes ****/
597 vlib_node_registration_t acl_in_fa_ip6_node;
598 VLIB_NODE_FN (acl_in_fa_ip6_node) (vlib_main_t * vm,
599 vlib_node_runtime_t * node,
600 vlib_frame_t * frame)
602 return acl_fa_node_fn (vm, node, frame, 1, 1, 0, &acl_in_fa_ip6_node);
605 vlib_node_registration_t acl_in_fa_ip4_node;
606 VLIB_NODE_FN (acl_in_fa_ip4_node) (vlib_main_t * vm,
607 vlib_node_runtime_t * node,
608 vlib_frame_t * frame)
610 return acl_fa_node_fn (vm, node, frame, 0, 1, 0, &acl_in_fa_ip4_node);
613 vlib_node_registration_t acl_out_fa_ip6_node;
614 VLIB_NODE_FN (acl_out_fa_ip6_node) (vlib_main_t * vm,
615 vlib_node_runtime_t * node,
616 vlib_frame_t * frame)
618 return acl_fa_node_fn (vm, node, frame, 1, 0, 0, &acl_out_fa_ip6_node);
621 vlib_node_registration_t acl_out_fa_ip4_node;
622 VLIB_NODE_FN (acl_out_fa_ip4_node) (vlib_main_t * vm,
623 vlib_node_runtime_t * node,
624 vlib_frame_t * frame)
626 return acl_fa_node_fn (vm, node, frame, 0, 0, 0, &acl_out_fa_ip4_node);
630 format_fa_5tuple (u8 * s, va_list * args)
632 fa_5tuple_t *p5t = va_arg (*args, fa_5tuple_t *);
635 return format (s, "lc_index %d (lsb16 of sw_if_index %d) l3 %s%s %U -> %U"
636 " l4 proto %d l4_valid %d port %d -> %d tcp flags (%s) %02x rsvd %x",
637 p5t->pkt.lc_index, p5t->l4.lsb_of_sw_if_index,
640 pkt.is_nonfirst_fragment ? " non-initial fragment" : "",
641 format_ip6_address, &p5t->ip6_addr[0], format_ip6_address,
642 &p5t->ip6_addr[1], p5t->l4.proto, p5t->pkt.l4_valid,
643 p5t->l4.port[0], p5t->l4.port[1],
644 p5t->pkt.tcp_flags_valid ? "valid" : "invalid",
645 p5t->pkt.tcp_flags, p5t->pkt.flags_reserved);
647 return format (s, "lc_index %d (lsb16 of sw_if_index %d) l3 %s%s %U -> %U"
648 " l4 proto %d l4_valid %d port %d -> %d tcp flags (%s) %02x rsvd %x",
649 p5t->pkt.lc_index, p5t->l4.lsb_of_sw_if_index,
652 pkt.is_nonfirst_fragment ? " non-initial fragment" : "",
653 format_ip4_address, &p5t->ip4_addr[0], format_ip4_address,
654 &p5t->ip4_addr[1], p5t->l4.proto, p5t->pkt.l4_valid,
655 p5t->l4.port[0], p5t->l4.port[1],
656 p5t->pkt.tcp_flags_valid ? "valid" : "invalid",
657 p5t->pkt.tcp_flags, p5t->pkt.flags_reserved);
660 #ifndef CLIB_MARCH_VARIANT
662 format_acl_plugin_5tuple (u8 * s, va_list * args)
664 return format_fa_5tuple (s, args);
668 /* packet trace format function */
670 format_acl_plugin_trace (u8 * s, va_list * args)
672 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
673 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
674 acl_fa_trace_t *t = va_arg (*args, acl_fa_trace_t *);
678 "acl-plugin: lc_index: %d, sw_if_index %d, next index %d, action: %d, match: acl %d rule %d trace_bits %08x\n"
679 " pkt info %016llx %016llx %016llx %016llx %016llx %016llx",
680 t->lc_index, t->sw_if_index, t->next_index, t->action,
681 t->match_acl_in_index, t->match_rule_index, t->trace_bitmap,
682 t->packet_info[0], t->packet_info[1], t->packet_info[2],
683 t->packet_info[3], t->packet_info[4], t->packet_info[5]);
685 /* Now also print out the packet_info in a form usable by humans */
686 s = format (s, "\n %U", format_fa_5tuple, t->packet_info);
692 static char *acl_fa_error_strings[] = {
693 #define _(sym,string) string,
698 VLIB_REGISTER_NODE (acl_in_l2_ip6_node) =
700 .name = "acl-plugin-in-ip6-l2",
701 .vector_size = sizeof (u32),
702 .format_trace = format_acl_plugin_trace,
703 .type = VLIB_NODE_TYPE_INTERNAL,
704 .n_errors = ARRAY_LEN (acl_fa_error_strings),
705 .error_strings = acl_fa_error_strings,
706 .n_next_nodes = ACL_FA_N_NEXT,
709 [ACL_FA_ERROR_DROP] = "error-drop",
713 VNET_FEATURE_INIT (acl_in_l2_ip6_fa_feature, static) =
715 .arc_name = "l2-input-ip6",
716 .node_name = "acl-plugin-in-ip6-l2",
717 .runs_before = VNET_FEATURES ("l2-input-feat-arc-end"),
720 VLIB_REGISTER_NODE (acl_in_l2_ip4_node) =
722 .name = "acl-plugin-in-ip4-l2",
723 .vector_size = sizeof (u32),
724 .format_trace = format_acl_plugin_trace,
725 .type = VLIB_NODE_TYPE_INTERNAL,
726 .n_errors = ARRAY_LEN (acl_fa_error_strings),
727 .error_strings = acl_fa_error_strings,
728 .n_next_nodes = ACL_FA_N_NEXT,
731 [ACL_FA_ERROR_DROP] = "error-drop",
735 VNET_FEATURE_INIT (acl_in_l2_ip4_fa_feature, static) =
737 .arc_name = "l2-input-ip4",
738 .node_name = "acl-plugin-in-ip4-l2",
739 .runs_before = VNET_FEATURES ("l2-input-feat-arc-end"),
743 VLIB_REGISTER_NODE (acl_out_l2_ip6_node) =
745 .name = "acl-plugin-out-ip6-l2",
746 .vector_size = sizeof (u32),
747 .format_trace = format_acl_plugin_trace,
748 .type = VLIB_NODE_TYPE_INTERNAL,
749 .n_errors = ARRAY_LEN (acl_fa_error_strings),
750 .error_strings = acl_fa_error_strings,
751 .n_next_nodes = ACL_FA_N_NEXT,
754 [ACL_FA_ERROR_DROP] = "error-drop",
758 VNET_FEATURE_INIT (acl_out_l2_ip6_fa_feature, static) =
760 .arc_name = "l2-output-ip6",
761 .node_name = "acl-plugin-out-ip6-l2",
762 .runs_before = VNET_FEATURES ("l2-output-feat-arc-end"),
766 VLIB_REGISTER_NODE (acl_out_l2_ip4_node) =
768 .name = "acl-plugin-out-ip4-l2",
769 .vector_size = sizeof (u32),
770 .format_trace = format_acl_plugin_trace,
771 .type = VLIB_NODE_TYPE_INTERNAL,
772 .n_errors = ARRAY_LEN (acl_fa_error_strings),
773 .error_strings = acl_fa_error_strings,
774 .n_next_nodes = ACL_FA_N_NEXT,
777 [ACL_FA_ERROR_DROP] = "error-drop",
781 VNET_FEATURE_INIT (acl_out_l2_ip4_fa_feature, static) =
783 .arc_name = "l2-output-ip4",
784 .node_name = "acl-plugin-out-ip4-l2",
785 .runs_before = VNET_FEATURES ("l2-output-feat-arc-end"),
789 VLIB_REGISTER_NODE (acl_in_fa_ip6_node) =
791 .name = "acl-plugin-in-ip6-fa",
792 .vector_size = sizeof (u32),
793 .format_trace = format_acl_plugin_trace,
794 .type = VLIB_NODE_TYPE_INTERNAL,
795 .n_errors = ARRAY_LEN (acl_fa_error_strings),
796 .error_strings = acl_fa_error_strings,
797 .n_next_nodes = ACL_FA_N_NEXT,
800 [ACL_FA_ERROR_DROP] = "error-drop",
804 VNET_FEATURE_INIT (acl_in_ip6_fa_feature, static) =
806 .arc_name = "ip6-unicast",
807 .node_name = "acl-plugin-in-ip6-fa",
808 .runs_before = VNET_FEATURES ("ip6-flow-classify"),
811 VLIB_REGISTER_NODE (acl_in_fa_ip4_node) =
813 .name = "acl-plugin-in-ip4-fa",
814 .vector_size = sizeof (u32),
815 .format_trace = format_acl_plugin_trace,
816 .type = VLIB_NODE_TYPE_INTERNAL,
817 .n_errors = ARRAY_LEN (acl_fa_error_strings),
818 .error_strings = acl_fa_error_strings,
819 .n_next_nodes = ACL_FA_N_NEXT,
822 [ACL_FA_ERROR_DROP] = "error-drop",
826 VNET_FEATURE_INIT (acl_in_ip4_fa_feature, static) =
828 .arc_name = "ip4-unicast",
829 .node_name = "acl-plugin-in-ip4-fa",
830 .runs_before = VNET_FEATURES ("ip4-flow-classify"),
834 VLIB_REGISTER_NODE (acl_out_fa_ip6_node) =
836 .name = "acl-plugin-out-ip6-fa",
837 .vector_size = sizeof (u32),
838 .format_trace = format_acl_plugin_trace,
839 .type = VLIB_NODE_TYPE_INTERNAL,
840 .n_errors = ARRAY_LEN (acl_fa_error_strings),
841 .error_strings = acl_fa_error_strings,
842 .n_next_nodes = ACL_FA_N_NEXT,
845 [ACL_FA_ERROR_DROP] = "error-drop",
849 VNET_FEATURE_INIT (acl_out_ip6_fa_feature, static) =
851 .arc_name = "ip6-output",
852 .node_name = "acl-plugin-out-ip6-fa",
853 .runs_before = VNET_FEATURES ("interface-output"),
856 VLIB_REGISTER_NODE (acl_out_fa_ip4_node) =
858 .name = "acl-plugin-out-ip4-fa",
859 .vector_size = sizeof (u32),
860 .format_trace = format_acl_plugin_trace,
861 .type = VLIB_NODE_TYPE_INTERNAL,
862 .n_errors = ARRAY_LEN (acl_fa_error_strings),
863 .error_strings = acl_fa_error_strings,
864 .n_next_nodes = ACL_FA_N_NEXT,
865 /* edit / add dispositions here */
868 [ACL_FA_ERROR_DROP] = "error-drop",
872 VNET_FEATURE_INIT (acl_out_ip4_fa_feature, static) =
874 .arc_name = "ip4-output",
875 .node_name = "acl-plugin-out-ip4-fa",
876 .runs_before = VNET_FEATURES ("interface-output"),
882 * fd.io coding-style-patch-verification: ON
885 * eval: (c-set-style "gnu")