351cbbd8fb234a8b6a2b2ddf5b71bc4305e58db9
[vpp.git] / src / plugins / acl / dataplane_node.c
1 /*
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:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15 #include <stddef.h>
16 #include <netinet/in.h>
17
18 #include <vlib/vlib.h>
19 #include <vnet/vnet.h>
20 #include <vnet/pg/pg.h>
21 #include <vppinfra/error.h>
22
23
24 #include <acl/acl.h>
25 #include <vnet/ip/icmp46_packet.h>
26
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>
32
33 #include <vppinfra/bihash_40_8.h>
34 #include <vppinfra/bihash_template.h>
35
36 typedef struct
37 {
38   u32 next_index;
39   u32 sw_if_index;
40   u32 lc_index;
41   u32 match_acl_in_index;
42   u32 match_rule_index;
43   u64 packet_info[6];
44   u32 trace_bitmap;
45   u8 action;
46 } acl_fa_trace_t;
47
48 /* *INDENT-OFF* */
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") \
57 /* end  of errors */
58
59 typedef enum
60 {
61 #define _(sym,str) ACL_FA_ERROR_##sym,
62   foreach_acl_fa_error
63 #undef _
64     ACL_FA_N_ERROR,
65 } acl_fa_error_t;
66
67 /* *INDENT-ON* */
68
69
70 always_inline uword
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)
75 {
76   u32 n_left, *from;
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;
82   u32 trace_bitmap = 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];
90
91   u16 nexts[VLIB_FRAME_SIZE], *next;
92   vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
93
94   from = vlib_frame_vector_args (frame);
95
96   error_node = vlib_node_get_runtime (vm, acl_fa_node->index);
97
98   vlib_get_buffers (vm, from, bufs, frame->n_vectors);
99   /* set the initial values for the current buffer the next pointers */
100   b = bufs;
101   next = nexts;
102
103   n_left = frame->n_vectors;
104   while (n_left > 0)
105     {
106       u32 next0 = 0;
107       u8 action = 0;
108       u32 sw_if_index0;
109       u32 lc_index0 = ~0;
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;
114       u8 error0 = 0;
115
116       n_left -= 1;
117
118       if (is_input)
119         sw_if_index0 = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
120       else
121         sw_if_index0 = vnet_buffer (b[0])->sw_if_index[VLIB_TX];
122
123       if (is_input)
124         lc_index0 = am->input_lc_index_by_sw_if_index[sw_if_index0];
125       else
126         lc_index0 = am->output_lc_index_by_sw_if_index[sw_if_index0];
127
128
129       u32 **p_epoch_vec =
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,
134                                                          sw_if_index0)
135         : (is_input * FA_POLICY_EPOCH_IS_INPUT);
136       /*
137        * Extract the L3/L4 matching info into a 5-tuple structure.
138        */
139
140       acl_plugin_fill_5tuple_inline (lc_index0, b[0], is_ip6, is_input,
141                                      is_l2_path,
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
146       clib_warning
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);
150 #endif
151
152       /* Try to match an existing session first */
153
154       if (acl_fa_ifc_has_sessions (am, sw_if_index0))
155         {
156           if (acl_fa_find_session (am, sw_if_index0, &fa_5tuple, &value_sess))
157             {
158               trace_bitmap |= 0x80000000;
159               error0 = ACL_FA_ERROR_ACL_EXIST_SESSION;
160               fa_full_session_id_t f_sess_id;
161
162               f_sess_id.as_u64 = value_sess.value;
163               ASSERT (f_sess_id.thread_index < vec_len (vlib_mains));
164
165               fa_session_t *sess =
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);
169               action =
170                 acl_fa_track_session (am, is_input, sw_if_index0, now,
171                                       sess, &fa_5tuple);
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))
179                 {
180                   acl_fa_restart_timer_for_session (am, now, f_sess_id);
181                   pkts_restart_session_timer++;
182                   trace_bitmap |=
183                     0x00010000 + ((0xff & old_timeout_type) << 8) +
184                     (0xff & new_timeout_type);
185                 }
186               /*
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.
194                */
195               if (PREDICT_FALSE (sess->sw_if_index != sw_if_index0))
196                 {
197                   clib_warning
198                     ("BUG: session LSB16(sw_if_index) and 5-tuple collision!");
199                   acl_check_needed = 0;
200                   action = 0;
201                 }
202               if (PREDICT_FALSE (am->reclassify_sessions))
203                 {
204                   /* if the MSB of policy epoch matches but not the LSB means it is a stale session */
205                   if ((0 ==
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))
211                     {
212                       /* delete session and increment the counter */
213                       vec_validate
214                         (pw->fa_session_epoch_change_by_sw_if_index,
215                          sw_if_index0);
216                       vec_elt (pw->fa_session_epoch_change_by_sw_if_index,
217                                sw_if_index0)++;
218                       if (acl_fa_conn_list_delete_session (am, f_sess_id))
219                         {
220                           /* delete the session only if we were able to unlink it */
221                           acl_fa_delete_session (am, sw_if_index0, f_sess_id);
222                         }
223                       acl_check_needed = 1;
224                       trace_bitmap |= 0x40000000;
225                     }
226                 }
227             }
228         }
229
230       if (acl_check_needed)
231         {
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,
236                                           &match_acl_pos,
237                                           &match_acl_in_index,
238                                           &match_rule_index, &trace_bitmap);
239           error0 = action;
240           if (1 == action)
241             pkts_acl_permit += 1;
242           if (2 == action)
243             {
244               if (!acl_fa_can_add_session (am, is_input, sw_if_index0))
245                 acl_fa_try_recycle_session (am, is_input, thread_index,
246                                             sw_if_index0);
247
248               if (acl_fa_can_add_session (am, is_input, sw_if_index0))
249                 {
250                   fa_session_t *sess =
251                     acl_fa_add_session (am, is_input, is_ip6,
252                                         sw_if_index0,
253                                         now, &fa_5tuple,
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;
258                 }
259               else
260                 {
261                   action = 0;
262                   error0 = ACL_FA_ERROR_ACL_TOO_MANY_SESSIONS;
263                 }
264             }
265         }
266
267
268
269       if (action > 0)
270         {
271           if (is_l2_path)
272             next0 = vnet_l2_feature_next (b[0], l2_feat_next_node_index, 0);
273           else
274             vnet_feature_next (sw_if_index0, &next0, b[0]);
275         }
276 #ifdef FA_NODE_VERBOSE_DEBUG
277       clib_warning
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,
280          match_rule_index);
281 #endif
282
283       if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
284                          && (b[0]->flags & VLIB_BUFFER_IS_TRACED)))
285         {
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;
298           t->action = action;
299           t->trace_bitmap = trace_bitmap;
300         }
301
302       next0 = next0 < node->n_next_nodes ? next0 : 0;
303       if (0 == next0)
304         b[0]->error = error_node->errors[error0];
305       next[0] = next0;
306
307       next++;
308       b++;
309       pkts_acl_checked += 1;
310     }
311
312   vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors);
313
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,
320                                pkts_new_session);
321   vlib_node_increment_counter (vm, acl_fa_node->index,
322                                ACL_FA_ERROR_ACL_EXIST_SESSION,
323                                pkts_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;
328 }
329
330 vlib_node_registration_t acl_in_l2_ip6_node;
331 VLIB_NODE_FN (acl_in_l2_ip6_node) (vlib_main_t * vm,
332                                    vlib_node_runtime_t * node,
333                                    vlib_frame_t * frame)
334 {
335   acl_main_t *am = &acl_main;
336   return acl_fa_node_fn (vm, node, frame, 1, 1, 1,
337                          am->fa_acl_in_ip6_l2_node_feat_next_node_index,
338                          &acl_in_l2_ip6_node);
339 }
340
341 vlib_node_registration_t acl_in_l2_ip4_node;
342 VLIB_NODE_FN (acl_in_l2_ip4_node) (vlib_main_t * vm,
343                                    vlib_node_runtime_t * node,
344                                    vlib_frame_t * frame)
345 {
346   acl_main_t *am = &acl_main;
347   return acl_fa_node_fn (vm, node, frame, 0, 1, 1,
348                          am->fa_acl_in_ip4_l2_node_feat_next_node_index,
349                          &acl_in_l2_ip4_node);
350 }
351
352 vlib_node_registration_t acl_out_l2_ip6_node;
353 VLIB_NODE_FN (acl_out_l2_ip6_node) (vlib_main_t * vm,
354                                     vlib_node_runtime_t * node,
355                                     vlib_frame_t * frame)
356 {
357   acl_main_t *am = &acl_main;
358   return acl_fa_node_fn (vm, node, frame, 1, 0, 1,
359                          am->fa_acl_out_ip6_l2_node_feat_next_node_index,
360                          &acl_out_l2_ip6_node);
361 }
362
363 vlib_node_registration_t acl_out_l2_ip4_node;
364 VLIB_NODE_FN (acl_out_l2_ip4_node) (vlib_main_t * vm,
365                                     vlib_node_runtime_t * node,
366                                     vlib_frame_t * frame)
367 {
368   acl_main_t *am = &acl_main;
369   return acl_fa_node_fn (vm, node, frame, 0, 0, 1,
370                          am->fa_acl_out_ip4_l2_node_feat_next_node_index,
371                          &acl_out_l2_ip4_node);
372 }
373
374 /**** L3 processing path nodes ****/
375
376 vlib_node_registration_t acl_in_fa_ip6_node;
377 VLIB_NODE_FN (acl_in_fa_ip6_node) (vlib_main_t * vm,
378                                    vlib_node_runtime_t * node,
379                                    vlib_frame_t * frame)
380 {
381   return acl_fa_node_fn (vm, node, frame, 1, 1, 0, 0, &acl_in_fa_ip6_node);
382 }
383
384 vlib_node_registration_t acl_in_fa_ip4_node;
385 VLIB_NODE_FN (acl_in_fa_ip4_node) (vlib_main_t * vm,
386                                    vlib_node_runtime_t * node,
387                                    vlib_frame_t * frame)
388 {
389   return acl_fa_node_fn (vm, node, frame, 0, 1, 0, 0, &acl_in_fa_ip4_node);
390 }
391
392 vlib_node_registration_t acl_out_fa_ip6_node;
393 VLIB_NODE_FN (acl_out_fa_ip6_node) (vlib_main_t * vm,
394                                     vlib_node_runtime_t * node,
395                                     vlib_frame_t * frame)
396 {
397   return acl_fa_node_fn (vm, node, frame, 1, 0, 0, 0, &acl_out_fa_ip6_node);
398 }
399
400 vlib_node_registration_t acl_out_fa_ip4_node;
401 VLIB_NODE_FN (acl_out_fa_ip4_node) (vlib_main_t * vm,
402                                     vlib_node_runtime_t * node,
403                                     vlib_frame_t * frame)
404 {
405   return acl_fa_node_fn (vm, node, frame, 0, 0, 0, 0, &acl_out_fa_ip4_node);
406 }
407
408 #ifndef CLIB_MARCH_VARIANT
409 static u8 *
410 format_fa_5tuple (u8 * s, va_list * args)
411 {
412   fa_5tuple_t *p5t = va_arg (*args, fa_5tuple_t *);
413
414   return format (s, "lc_index %d (lsb16 of sw_if_index %d) l3 %s%s %U -> %U"
415                  " l4 proto %d l4_valid %d port %d -> %d tcp flags (%s) %02x rsvd %x",
416                  p5t->pkt.lc_index, p5t->l4.lsb_of_sw_if_index,
417                  p5t->pkt.is_ip6 ? "ip6" : "ip4",
418                  p5t->pkt.is_nonfirst_fragment ? " non-initial fragment" : "",
419                  format_ip46_address, &p5t->addr[0],
420                  p5t->pkt.is_ip6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4,
421                  format_ip46_address, &p5t->addr[1],
422                  p5t->pkt.is_ip6 ? IP46_TYPE_IP6 : IP46_TYPE_IP4,
423                  p5t->l4.proto, p5t->pkt.l4_valid, p5t->l4.port[0],
424                  p5t->l4.port[1],
425                  p5t->pkt.tcp_flags_valid ? "valid" : "invalid",
426                  p5t->pkt.tcp_flags, p5t->pkt.flags_reserved);
427 }
428
429 u8 *
430 format_acl_plugin_5tuple (u8 * s, va_list * args)
431 {
432   return format_fa_5tuple (s, args);
433 }
434
435 /* packet trace format function */
436 u8 *
437 format_acl_plugin_trace (u8 * s, va_list * args)
438 {
439   CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
440   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
441   acl_fa_trace_t *t = va_arg (*args, acl_fa_trace_t *);
442
443   s =
444     format (s,
445             "acl-plugin: lc_index: %d, sw_if_index %d, next index %d, action: %d, match: acl %d rule %d trace_bits %08x\n"
446             "  pkt info %016llx %016llx %016llx %016llx %016llx %016llx",
447             t->lc_index, t->sw_if_index, t->next_index, t->action,
448             t->match_acl_in_index, t->match_rule_index, t->trace_bitmap,
449             t->packet_info[0], t->packet_info[1], t->packet_info[2],
450             t->packet_info[3], t->packet_info[4], t->packet_info[5]);
451
452   /* Now also print out the packet_info in a form usable by humans */
453   s = format (s, "\n   %U", format_fa_5tuple, t->packet_info);
454   return s;
455 }
456
457
458 /* *INDENT-OFF* */
459
460 static char *acl_fa_error_strings[] = {
461 #define _(sym,string) string,
462   foreach_acl_fa_error
463 #undef _
464 };
465
466 VLIB_REGISTER_NODE (acl_in_l2_ip6_node) =
467 {
468   .name = "acl-plugin-in-ip6-l2",
469   .vector_size = sizeof (u32),
470   .format_trace = format_acl_plugin_trace,
471   .type = VLIB_NODE_TYPE_INTERNAL,
472   .n_errors = ARRAY_LEN (acl_fa_error_strings),
473   .error_strings = acl_fa_error_strings,
474   .n_next_nodes = ACL_FA_N_NEXT,
475   .next_nodes =
476   {
477     [ACL_FA_ERROR_DROP] = "error-drop",
478   }
479 };
480
481 VLIB_REGISTER_NODE (acl_in_l2_ip4_node) =
482 {
483   .name = "acl-plugin-in-ip4-l2",
484   .vector_size = sizeof (u32),
485   .format_trace = format_acl_plugin_trace,
486   .type = VLIB_NODE_TYPE_INTERNAL,
487   .n_errors = ARRAY_LEN (acl_fa_error_strings),
488   .error_strings = acl_fa_error_strings,
489   .n_next_nodes = ACL_FA_N_NEXT,
490   .next_nodes =
491   {
492     [ACL_FA_ERROR_DROP] = "error-drop",
493   }
494 };
495
496 VLIB_REGISTER_NODE (acl_out_l2_ip6_node) =
497 {
498   .name = "acl-plugin-out-ip6-l2",
499   .vector_size = sizeof (u32),
500   .format_trace = format_acl_plugin_trace,
501   .type = VLIB_NODE_TYPE_INTERNAL,
502   .n_errors = ARRAY_LEN (acl_fa_error_strings),
503   .error_strings = acl_fa_error_strings,
504   .n_next_nodes = ACL_FA_N_NEXT,
505   .next_nodes =
506   {
507     [ACL_FA_ERROR_DROP] = "error-drop",
508   }
509 };
510
511 VLIB_REGISTER_NODE (acl_out_l2_ip4_node) =
512 {
513   .name = "acl-plugin-out-ip4-l2",
514   .vector_size = sizeof (u32),
515   .format_trace = format_acl_plugin_trace,
516   .type = VLIB_NODE_TYPE_INTERNAL,
517   .n_errors = ARRAY_LEN (acl_fa_error_strings),
518   .error_strings = acl_fa_error_strings,
519   .n_next_nodes = ACL_FA_N_NEXT,
520   .next_nodes =
521   {
522     [ACL_FA_ERROR_DROP] = "error-drop",
523   }
524 };
525
526
527 VLIB_REGISTER_NODE (acl_in_fa_ip6_node) =
528 {
529   .name = "acl-plugin-in-ip6-fa",
530   .vector_size = sizeof (u32),
531   .format_trace = format_acl_plugin_trace,
532   .type = VLIB_NODE_TYPE_INTERNAL,
533   .n_errors = ARRAY_LEN (acl_fa_error_strings),
534   .error_strings = acl_fa_error_strings,
535   .n_next_nodes = ACL_FA_N_NEXT,
536   .next_nodes =
537   {
538     [ACL_FA_ERROR_DROP] = "error-drop",
539   }
540 };
541
542 VNET_FEATURE_INIT (acl_in_ip6_fa_feature, static) =
543 {
544   .arc_name = "ip6-unicast",
545   .node_name = "acl-plugin-in-ip6-fa",
546   .runs_before = VNET_FEATURES ("ip6-flow-classify"),
547 };
548
549 VLIB_REGISTER_NODE (acl_in_fa_ip4_node) =
550 {
551   .name = "acl-plugin-in-ip4-fa",
552   .vector_size = sizeof (u32),
553   .format_trace = format_acl_plugin_trace,
554   .type = VLIB_NODE_TYPE_INTERNAL,
555   .n_errors = ARRAY_LEN (acl_fa_error_strings),
556   .error_strings = acl_fa_error_strings,
557   .n_next_nodes = ACL_FA_N_NEXT,
558   .next_nodes =
559   {
560     [ACL_FA_ERROR_DROP] = "error-drop",
561   }
562 };
563
564 VNET_FEATURE_INIT (acl_in_ip4_fa_feature, static) =
565 {
566   .arc_name = "ip4-unicast",
567   .node_name = "acl-plugin-in-ip4-fa",
568   .runs_before = VNET_FEATURES ("ip4-flow-classify"),
569 };
570
571
572 VLIB_REGISTER_NODE (acl_out_fa_ip6_node) =
573 {
574   .name = "acl-plugin-out-ip6-fa",
575   .vector_size = sizeof (u32),
576   .format_trace = format_acl_plugin_trace,
577   .type = VLIB_NODE_TYPE_INTERNAL,
578   .n_errors = ARRAY_LEN (acl_fa_error_strings),
579   .error_strings = acl_fa_error_strings,
580   .n_next_nodes = ACL_FA_N_NEXT,
581   .next_nodes =
582   {
583     [ACL_FA_ERROR_DROP] = "error-drop",
584   }
585 };
586
587 VNET_FEATURE_INIT (acl_out_ip6_fa_feature, static) =
588 {
589   .arc_name = "ip6-output",
590   .node_name = "acl-plugin-out-ip6-fa",
591   .runs_before = VNET_FEATURES ("interface-output"),
592 };
593
594 VLIB_REGISTER_NODE (acl_out_fa_ip4_node) =
595 {
596   .name = "acl-plugin-out-ip4-fa",
597   .vector_size = sizeof (u32),
598   .format_trace = format_acl_plugin_trace,
599   .type = VLIB_NODE_TYPE_INTERNAL,
600   .n_errors = ARRAY_LEN (acl_fa_error_strings),
601   .error_strings = acl_fa_error_strings,
602   .n_next_nodes = ACL_FA_N_NEXT,
603     /* edit / add dispositions here */
604   .next_nodes =
605   {
606     [ACL_FA_ERROR_DROP] = "error-drop",
607   }
608 };
609
610 VNET_FEATURE_INIT (acl_out_ip4_fa_feature, static) =
611 {
612   .arc_name = "ip4-output",
613   .node_name = "acl-plugin-out-ip4-fa",
614   .runs_before = VNET_FEATURES ("interface-output"),
615 };
616 #endif
617
618 /* *INDENT-ON* */
619
620 /*
621  * fd.io coding-style-patch-verification: ON
622  *
623  * Local Variables:
624  * eval: (c-set-style "gnu")
625  * End:
626  */