blob: b0b52ab11c33e5368dfc793c5cd03fa6eb3d5c17 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/*
2 * Copyright (c) 2015 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 <vnet/ip/ip.h>
16#include <vnet/classify/vnet_classify.h>
17#include <vnet/classify/input_acl.h>
18
Dave Barachd7cb1b52016-12-09 09:52:16 -050019typedef struct
20{
Ed Warnickecb9cada2015-12-08 15:45:58 -070021 u32 sw_if_index;
22 u32 next_index;
23 u32 table_index;
24 u32 offset;
25} ip_inacl_trace_t;
26
27/* packet trace format function */
Dave Barachd7cb1b52016-12-09 09:52:16 -050028static u8 *
29format_ip_inacl_trace (u8 * s, va_list * args)
Ed Warnickecb9cada2015-12-08 15:45:58 -070030{
31 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
32 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
Dave Barachd7cb1b52016-12-09 09:52:16 -050033 ip_inacl_trace_t *t = va_arg (*args, ip_inacl_trace_t *);
Ed Warnickecb9cada2015-12-08 15:45:58 -070034
35 s = format (s, "INACL: sw_if_index %d, next_index %d, table %d, offset %d",
Dave Barachd7cb1b52016-12-09 09:52:16 -050036 t->sw_if_index, t->next_index, t->table_index, t->offset);
Ed Warnickecb9cada2015-12-08 15:45:58 -070037 return s;
38}
39
40vlib_node_registration_t ip4_inacl_node;
41vlib_node_registration_t ip6_inacl_node;
42
43#define foreach_ip_inacl_error \
44_(MISS, "input ACL misses") \
45_(HIT, "input ACL hits") \
46_(CHAIN_HIT, "input ACL hits after chain walk")
47
Dave Barachd7cb1b52016-12-09 09:52:16 -050048typedef enum
49{
Ed Warnickecb9cada2015-12-08 15:45:58 -070050#define _(sym,str) IP_INACL_ERROR_##sym,
51 foreach_ip_inacl_error
52#undef _
Dave Barachd7cb1b52016-12-09 09:52:16 -050053 IP_INACL_N_ERROR,
Ed Warnickecb9cada2015-12-08 15:45:58 -070054} ip_inacl_error_t;
55
Dave Barachd7cb1b52016-12-09 09:52:16 -050056static char *ip_inacl_error_strings[] = {
Ed Warnickecb9cada2015-12-08 15:45:58 -070057#define _(sym,string) string,
58 foreach_ip_inacl_error
59#undef _
60};
61
62static inline uword
63ip_inacl_inline (vlib_main_t * vm,
Dave Barachd7cb1b52016-12-09 09:52:16 -050064 vlib_node_runtime_t * node, vlib_frame_t * frame, int is_ip4)
Ed Warnickecb9cada2015-12-08 15:45:58 -070065{
Dave Barachd7cb1b52016-12-09 09:52:16 -050066 u32 n_left_from, *from, *to_next;
Ed Warnickecb9cada2015-12-08 15:45:58 -070067 acl_next_index_t next_index;
Dave Barachd7cb1b52016-12-09 09:52:16 -050068 input_acl_main_t *am = &input_acl_main;
69 vnet_classify_main_t *vcm = am->vnet_classify_main;
Ed Warnickecb9cada2015-12-08 15:45:58 -070070 f64 now = vlib_time_now (vm);
71 u32 hits = 0;
72 u32 misses = 0;
73 u32 chain_hits = 0;
74 input_acl_table_id_t tid;
Dave Barachd7cb1b52016-12-09 09:52:16 -050075 vlib_node_runtime_t *error_node;
Dave Barachf39ff742016-03-20 10:14:45 -040076 u32 n_next_nodes;
77
78 n_next_nodes = node->n_next_nodes;
Ed Warnickecb9cada2015-12-08 15:45:58 -070079
80 if (is_ip4)
81 {
82 tid = INPUT_ACL_TABLE_IP4;
83 error_node = vlib_node_get_runtime (vm, ip4_input_node.index);
84 }
85 else
86 {
87 tid = INPUT_ACL_TABLE_IP6;
88 error_node = vlib_node_get_runtime (vm, ip6_input_node.index);
89 }
90
91 from = vlib_frame_vector_args (frame);
92 n_left_from = frame->n_vectors;
93
94 /* First pass: compute hashes */
95
96 while (n_left_from > 2)
97 {
Dave Barachd7cb1b52016-12-09 09:52:16 -050098 vlib_buffer_t *b0, *b1;
Ed Warnickecb9cada2015-12-08 15:45:58 -070099 u32 bi0, bi1;
Dave Barachd7cb1b52016-12-09 09:52:16 -0500100 u8 *h0, *h1;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700101 u32 sw_if_index0, sw_if_index1;
102 u32 table_index0, table_index1;
Dave Barachd7cb1b52016-12-09 09:52:16 -0500103 vnet_classify_table_t *t0, *t1;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700104
105 /* prefetch next iteration */
106 {
Dave Barachd7cb1b52016-12-09 09:52:16 -0500107 vlib_buffer_t *p1, *p2;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700108
Dave Barachd7cb1b52016-12-09 09:52:16 -0500109 p1 = vlib_get_buffer (vm, from[1]);
110 p2 = vlib_get_buffer (vm, from[2]);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700111
Dave Barachd7cb1b52016-12-09 09:52:16 -0500112 vlib_prefetch_buffer_header (p1, STORE);
113 CLIB_PREFETCH (p1->data, CLIB_CACHE_LINE_BYTES, STORE);
114 vlib_prefetch_buffer_header (p2, STORE);
115 CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700116 }
117
118 bi0 = from[0];
119 b0 = vlib_get_buffer (vm, bi0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700120
121 bi1 = from[1];
122 b1 = vlib_get_buffer (vm, bi1);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700123
124 sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
Dave Barachd7cb1b52016-12-09 09:52:16 -0500125 table_index0 =
126 am->classify_table_index_by_sw_if_index[tid][sw_if_index0];
Ed Warnickecb9cada2015-12-08 15:45:58 -0700127
128 sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_RX];
Dave Barachd7cb1b52016-12-09 09:52:16 -0500129 table_index1 =
130 am->classify_table_index_by_sw_if_index[tid][sw_if_index1];
Ed Warnickecb9cada2015-12-08 15:45:58 -0700131
132 t0 = pool_elt_at_index (vcm->tables, table_index0);
133
134 t1 = pool_elt_at_index (vcm->tables, table_index1);
135
Steve Shin25e26dc2016-11-08 10:47:10 -0800136 if (t0->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA)
Dave Barachd7cb1b52016-12-09 09:52:16 -0500137 h0 = (void *) vlib_buffer_get_current (b0) + t0->current_data_offset;
Steve Shin25e26dc2016-11-08 10:47:10 -0800138 else
Dave Barachd7cb1b52016-12-09 09:52:16 -0500139 h0 = b0->data;
Steve Shin25e26dc2016-11-08 10:47:10 -0800140
Dave Barachd7cb1b52016-12-09 09:52:16 -0500141 vnet_buffer (b0)->l2_classify.hash =
142 vnet_classify_hash_packet (t0, (u8 *) h0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700143
Dave Barachd7cb1b52016-12-09 09:52:16 -0500144 vnet_classify_prefetch_bucket (t0, vnet_buffer (b0)->l2_classify.hash);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700145
Steve Shin25e26dc2016-11-08 10:47:10 -0800146 if (t1->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA)
Dave Barachd7cb1b52016-12-09 09:52:16 -0500147 h1 = (void *) vlib_buffer_get_current (b1) + t1->current_data_offset;
Steve Shin25e26dc2016-11-08 10:47:10 -0800148 else
Dave Barachd7cb1b52016-12-09 09:52:16 -0500149 h1 = b1->data;
Steve Shin25e26dc2016-11-08 10:47:10 -0800150
Dave Barachd7cb1b52016-12-09 09:52:16 -0500151 vnet_buffer (b1)->l2_classify.hash =
152 vnet_classify_hash_packet (t1, (u8 *) h1);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700153
Dave Barachd7cb1b52016-12-09 09:52:16 -0500154 vnet_classify_prefetch_bucket (t1, vnet_buffer (b1)->l2_classify.hash);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700155
Dave Barachd7cb1b52016-12-09 09:52:16 -0500156 vnet_buffer (b0)->l2_classify.table_index = table_index0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700157
Dave Barachd7cb1b52016-12-09 09:52:16 -0500158 vnet_buffer (b1)->l2_classify.table_index = table_index1;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700159
160 from += 2;
161 n_left_from -= 2;
162 }
163
164 while (n_left_from > 0)
165 {
Dave Barachd7cb1b52016-12-09 09:52:16 -0500166 vlib_buffer_t *b0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700167 u32 bi0;
Dave Barachd7cb1b52016-12-09 09:52:16 -0500168 u8 *h0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700169 u32 sw_if_index0;
170 u32 table_index0;
Dave Barachd7cb1b52016-12-09 09:52:16 -0500171 vnet_classify_table_t *t0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700172
173 bi0 = from[0];
174 b0 = vlib_get_buffer (vm, bi0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700175
176 sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
Dave Barachd7cb1b52016-12-09 09:52:16 -0500177 table_index0 =
178 am->classify_table_index_by_sw_if_index[tid][sw_if_index0];
Ed Warnickecb9cada2015-12-08 15:45:58 -0700179
180 t0 = pool_elt_at_index (vcm->tables, table_index0);
Steve Shin25e26dc2016-11-08 10:47:10 -0800181
182 if (t0->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA)
Dave Barachd7cb1b52016-12-09 09:52:16 -0500183 h0 = (void *) vlib_buffer_get_current (b0) + t0->current_data_offset;
Steve Shin25e26dc2016-11-08 10:47:10 -0800184 else
Dave Barachd7cb1b52016-12-09 09:52:16 -0500185 h0 = b0->data;
Steve Shin25e26dc2016-11-08 10:47:10 -0800186
Dave Barachd7cb1b52016-12-09 09:52:16 -0500187 vnet_buffer (b0)->l2_classify.hash =
188 vnet_classify_hash_packet (t0, (u8 *) h0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700189
Dave Barachd7cb1b52016-12-09 09:52:16 -0500190 vnet_buffer (b0)->l2_classify.table_index = table_index0;
191 vnet_classify_prefetch_bucket (t0, vnet_buffer (b0)->l2_classify.hash);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700192
193 from++;
194 n_left_from--;
195 }
196
197 next_index = node->cached_next_index;
198 from = vlib_frame_vector_args (frame);
199 n_left_from = frame->n_vectors;
200
201 while (n_left_from > 0)
202 {
203 u32 n_left_to_next;
204
Dave Barachd7cb1b52016-12-09 09:52:16 -0500205 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700206
207 /* Not enough load/store slots to dual loop... */
208 while (n_left_from > 0 && n_left_to_next > 0)
Dave Barachd7cb1b52016-12-09 09:52:16 -0500209 {
210 u32 bi0;
211 vlib_buffer_t *b0;
212 u32 next0 = ACL_NEXT_INDEX_DENY;
213 u32 table_index0;
214 vnet_classify_table_t *t0;
215 vnet_classify_entry_t *e0;
216 u64 hash0;
217 u8 *h0;
218 u8 error0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700219
Dave Barachd7cb1b52016-12-09 09:52:16 -0500220 /* Stride 3 seems to work best */
221 if (PREDICT_TRUE (n_left_from > 3))
222 {
223 vlib_buffer_t *p1 = vlib_get_buffer (vm, from[3]);
224 vnet_classify_table_t *tp1;
225 u32 table_index1;
226 u64 phash1;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700227
Dave Barachd7cb1b52016-12-09 09:52:16 -0500228 table_index1 = vnet_buffer (p1)->l2_classify.table_index;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700229
Dave Barachd7cb1b52016-12-09 09:52:16 -0500230 if (PREDICT_TRUE (table_index1 != ~0))
231 {
232 tp1 = pool_elt_at_index (vcm->tables, table_index1);
233 phash1 = vnet_buffer (p1)->l2_classify.hash;
234 vnet_classify_prefetch_entry (tp1, phash1);
235 }
236 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700237
Dave Barachd7cb1b52016-12-09 09:52:16 -0500238 /* speculatively enqueue b0 to the current next frame */
239 bi0 = from[0];
240 to_next[0] = bi0;
241 from += 1;
242 to_next += 1;
243 n_left_from -= 1;
244 n_left_to_next -= 1;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700245
Dave Barachd7cb1b52016-12-09 09:52:16 -0500246 b0 = vlib_get_buffer (vm, bi0);
247 table_index0 = vnet_buffer (b0)->l2_classify.table_index;
248 e0 = 0;
249 t0 = 0;
250 vnet_get_config_data (am->vnet_config_main[tid],
251 &b0->current_config_index, &next0,
252 /* # bytes of config data */ 0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700253
Dave Barachd7cb1b52016-12-09 09:52:16 -0500254 vnet_buffer (b0)->l2_classify.opaque_index = ~0;
rangan09306492016-04-13 17:08:11 +0530255
Dave Barachd7cb1b52016-12-09 09:52:16 -0500256 if (PREDICT_TRUE (table_index0 != ~0))
257 {
258 hash0 = vnet_buffer (b0)->l2_classify.hash;
259 t0 = pool_elt_at_index (vcm->tables, table_index0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700260
Dave Barachd7cb1b52016-12-09 09:52:16 -0500261 if (t0->current_data_flag == CLASSIFY_FLAG_USE_CURR_DATA)
262 h0 =
263 (void *) vlib_buffer_get_current (b0) +
264 t0->current_data_offset;
265 else
266 h0 = b0->data;
Steve Shin25e26dc2016-11-08 10:47:10 -0800267
Dave Barachd7cb1b52016-12-09 09:52:16 -0500268 e0 = vnet_classify_find_entry (t0, (u8 *) h0, hash0, now);
269 if (e0)
270 {
271 vnet_buffer (b0)->l2_classify.opaque_index
272 = e0->opaque_index;
273 vlib_buffer_advance (b0, e0->advance);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700274
Dave Barachd7cb1b52016-12-09 09:52:16 -0500275 next0 = (e0->next_index < n_next_nodes) ?
276 e0->next_index : next0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700277
Dave Barachd7cb1b52016-12-09 09:52:16 -0500278 hits++;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700279
Dave Barachd7cb1b52016-12-09 09:52:16 -0500280 if (is_ip4)
281 error0 = (next0 == ACL_NEXT_INDEX_DENY) ?
282 IP4_ERROR_INACL_SESSION_DENY : IP4_ERROR_NONE;
283 else
284 error0 = (next0 == ACL_NEXT_INDEX_DENY) ?
285 IP6_ERROR_INACL_SESSION_DENY : IP6_ERROR_NONE;
286 b0->error = error_node->errors[error0];
Steve Shin25e26dc2016-11-08 10:47:10 -0800287
Dave Barachd7cb1b52016-12-09 09:52:16 -0500288 if (e0->action == CLASSIFY_ACTION_SET_IP4_FIB_INDEX ||
289 e0->action == CLASSIFY_ACTION_SET_IP6_FIB_INDEX)
290 vnet_buffer (b0)->sw_if_index[VLIB_TX] = e0->metadata;
291 }
292 else
293 {
294 while (1)
295 {
296 if (PREDICT_TRUE (t0->next_table_index != ~0))
297 t0 = pool_elt_at_index (vcm->tables,
298 t0->next_table_index);
299 else
300 {
301 next0 = (t0->miss_next_index < n_next_nodes) ?
302 t0->miss_next_index : next0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700303
Dave Barachd7cb1b52016-12-09 09:52:16 -0500304 misses++;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700305
Dave Barachd7cb1b52016-12-09 09:52:16 -0500306 if (is_ip4)
307 error0 = (next0 == ACL_NEXT_INDEX_DENY) ?
308 IP4_ERROR_INACL_TABLE_MISS : IP4_ERROR_NONE;
309 else
310 error0 = (next0 == ACL_NEXT_INDEX_DENY) ?
311 IP6_ERROR_INACL_TABLE_MISS : IP6_ERROR_NONE;
312 b0->error = error_node->errors[error0];
313 break;
314 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700315
Dave Barachd7cb1b52016-12-09 09:52:16 -0500316 if (t0->current_data_flag ==
317 CLASSIFY_FLAG_USE_CURR_DATA)
318 h0 =
319 (void *) vlib_buffer_get_current (b0) +
320 t0->current_data_offset;
321 else
322 h0 = b0->data;
Steve Shin25e26dc2016-11-08 10:47:10 -0800323
Dave Barachd7cb1b52016-12-09 09:52:16 -0500324 hash0 = vnet_classify_hash_packet (t0, (u8 *) h0);
325 e0 = vnet_classify_find_entry
326 (t0, (u8 *) h0, hash0, now);
327 if (e0)
328 {
329 vnet_buffer (b0)->l2_classify.opaque_index
330 = e0->opaque_index;
331 vlib_buffer_advance (b0, e0->advance);
332 next0 = (e0->next_index < n_next_nodes) ?
333 e0->next_index : next0;
334 hits++;
335 chain_hits++;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700336
Dave Barachd7cb1b52016-12-09 09:52:16 -0500337 if (is_ip4)
338 error0 = (next0 == ACL_NEXT_INDEX_DENY) ?
339 IP4_ERROR_INACL_SESSION_DENY : IP4_ERROR_NONE;
340 else
341 error0 = (next0 == ACL_NEXT_INDEX_DENY) ?
342 IP6_ERROR_INACL_SESSION_DENY : IP6_ERROR_NONE;
343 b0->error = error_node->errors[error0];
Steve Shin25e26dc2016-11-08 10:47:10 -0800344
Dave Barachd7cb1b52016-12-09 09:52:16 -0500345 if (e0->action == CLASSIFY_ACTION_SET_IP4_FIB_INDEX
346 || e0->action ==
347 CLASSIFY_ACTION_SET_IP6_FIB_INDEX)
348 vnet_buffer (b0)->sw_if_index[VLIB_TX] =
349 e0->metadata;
350 break;
351 }
352 }
353 }
354 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700355
Dave Barachd7cb1b52016-12-09 09:52:16 -0500356 if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)
357 && (b0->flags & VLIB_BUFFER_IS_TRACED)))
358 {
359 ip_inacl_trace_t *t =
360 vlib_add_trace (vm, node, b0, sizeof (*t));
361 t->sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_RX];
362 t->next_index = next0;
363 t->table_index = t0 ? t0 - vcm->tables : ~0;
364 t->offset = (e0 && t0) ? vnet_classify_get_offset (t0, e0) : ~0;
365 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700366
Dave Barachd7cb1b52016-12-09 09:52:16 -0500367 /* verify speculative enqueue, maybe switch current next frame */
368 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
369 to_next, n_left_to_next,
370 bi0, next0);
371 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700372
373 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
374 }
375
376 vlib_node_increment_counter (vm, node->node_index,
Dave Barachd7cb1b52016-12-09 09:52:16 -0500377 IP_INACL_ERROR_MISS, misses);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700378 vlib_node_increment_counter (vm, node->node_index,
Dave Barachd7cb1b52016-12-09 09:52:16 -0500379 IP_INACL_ERROR_HIT, hits);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700380 vlib_node_increment_counter (vm, node->node_index,
Dave Barachd7cb1b52016-12-09 09:52:16 -0500381 IP_INACL_ERROR_CHAIN_HIT, chain_hits);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700382 return frame->n_vectors;
383}
384
385static uword
Dave Barachd7cb1b52016-12-09 09:52:16 -0500386ip4_inacl (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
Ed Warnickecb9cada2015-12-08 15:45:58 -0700387{
Dave Barachd7cb1b52016-12-09 09:52:16 -0500388 return ip_inacl_inline (vm, node, frame, 1 /* is_ip4 */ );
Ed Warnickecb9cada2015-12-08 15:45:58 -0700389}
390
391
Dave Barachd7cb1b52016-12-09 09:52:16 -0500392/* *INDENT-OFF* */
Ed Warnickecb9cada2015-12-08 15:45:58 -0700393VLIB_REGISTER_NODE (ip4_inacl_node) = {
394 .function = ip4_inacl,
395 .name = "ip4-inacl",
396 .vector_size = sizeof (u32),
397 .format_trace = format_ip_inacl_trace,
398 .n_errors = ARRAY_LEN(ip_inacl_error_strings),
399 .error_strings = ip_inacl_error_strings,
400
401 .n_next_nodes = ACL_NEXT_INDEX_N_NEXT,
402 .next_nodes = {
403 [ACL_NEXT_INDEX_DENY] = "error-drop",
404 },
405};
Dave Barachd7cb1b52016-12-09 09:52:16 -0500406/* *INDENT-ON* */
Ed Warnickecb9cada2015-12-08 15:45:58 -0700407
Dave Barachd7cb1b52016-12-09 09:52:16 -0500408VLIB_NODE_FUNCTION_MULTIARCH (ip4_inacl_node, ip4_inacl);
Damjan Marion1c80e832016-05-11 23:07:18 +0200409
Ed Warnickecb9cada2015-12-08 15:45:58 -0700410static uword
Dave Barachd7cb1b52016-12-09 09:52:16 -0500411ip6_inacl (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
Ed Warnickecb9cada2015-12-08 15:45:58 -0700412{
Dave Barachd7cb1b52016-12-09 09:52:16 -0500413 return ip_inacl_inline (vm, node, frame, 0 /* is_ip4 */ );
Ed Warnickecb9cada2015-12-08 15:45:58 -0700414}
415
416
Dave Barachd7cb1b52016-12-09 09:52:16 -0500417/* *INDENT-OFF* */
Ed Warnickecb9cada2015-12-08 15:45:58 -0700418VLIB_REGISTER_NODE (ip6_inacl_node) = {
419 .function = ip6_inacl,
420 .name = "ip6-inacl",
421 .vector_size = sizeof (u32),
422 .format_trace = format_ip_inacl_trace,
423 .n_errors = ARRAY_LEN(ip_inacl_error_strings),
424 .error_strings = ip_inacl_error_strings,
425
426 .n_next_nodes = ACL_NEXT_INDEX_N_NEXT,
427 .next_nodes = {
428 [ACL_NEXT_INDEX_DENY] = "error-drop",
429 },
430};
Dave Barachd7cb1b52016-12-09 09:52:16 -0500431/* *INDENT-ON* */
Ed Warnickecb9cada2015-12-08 15:45:58 -0700432
Dave Barachd7cb1b52016-12-09 09:52:16 -0500433VLIB_NODE_FUNCTION_MULTIARCH (ip6_inacl_node, ip6_inacl);
Damjan Marion1c80e832016-05-11 23:07:18 +0200434
Ed Warnickecb9cada2015-12-08 15:45:58 -0700435static clib_error_t *
436ip_inacl_init (vlib_main_t * vm)
437{
438 return 0;
439}
440
441VLIB_INIT_FUNCTION (ip_inacl_init);
442
Dave Barachd7cb1b52016-12-09 09:52:16 -0500443
444/*
445 * fd.io coding-style-patch-verification: ON
446 *
447 * Local Variables:
448 * eval: (c-set-style "gnu")
449 * End:
450 */