blob: e69cd85101ae9d37ab56c598df6391b1d0fa8f52 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/*
2 * esp_decrypt.c : IPSec ESP decrypt node
3 *
4 * Copyright (c) 2015 Cisco and/or its affiliates.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#include <vnet/vnet.h>
19#include <vnet/api_errno.h>
20#include <vnet/ip/ip.h>
21
22#include <vnet/ipsec/ipsec.h>
23#include <vnet/ipsec/esp.h>
24
Ed Warnickecb9cada2015-12-08 15:45:58 -070025#define foreach_esp_decrypt_next \
26_(DROP, "error-drop") \
27_(IP4_INPUT, "ip4-input") \
Matus Fabian694265d2016-08-10 01:55:36 -070028_(IP6_INPUT, "ip6-input") \
29_(IPSEC_GRE_INPUT, "ipsec-gre-input")
Ed Warnickecb9cada2015-12-08 15:45:58 -070030
31#define _(v, s) ESP_DECRYPT_NEXT_##v,
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070032typedef enum
33{
Ed Warnickecb9cada2015-12-08 15:45:58 -070034 foreach_esp_decrypt_next
35#undef _
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070036 ESP_DECRYPT_N_NEXT,
Ed Warnickecb9cada2015-12-08 15:45:58 -070037} esp_decrypt_next_t;
38
39
40#define foreach_esp_decrypt_error \
41 _(RX_PKTS, "ESP pkts received") \
42 _(NO_BUFFER, "No buffer (packed dropped)") \
43 _(DECRYPTION_FAILED, "ESP decryption failed") \
44 _(INTEG_ERROR, "Integrity check failed") \
Matus Fabianefc33302016-07-11 07:08:55 -070045 _(REPLAY, "SA replayed packet") \
46 _(NOT_IP, "Not IP packet (dropped)")
Ed Warnickecb9cada2015-12-08 15:45:58 -070047
48
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070049typedef enum
50{
Ed Warnickecb9cada2015-12-08 15:45:58 -070051#define _(sym,str) ESP_DECRYPT_ERROR_##sym,
52 foreach_esp_decrypt_error
53#undef _
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070054 ESP_DECRYPT_N_ERROR,
Ed Warnickecb9cada2015-12-08 15:45:58 -070055} esp_decrypt_error_t;
56
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070057static char *esp_decrypt_error_strings[] = {
Ed Warnickecb9cada2015-12-08 15:45:58 -070058#define _(sym,string) string,
59 foreach_esp_decrypt_error
60#undef _
61};
62
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070063typedef struct
64{
Ed Warnickecb9cada2015-12-08 15:45:58 -070065 ipsec_crypto_alg_t crypto_alg;
66 ipsec_integ_alg_t integ_alg;
67} esp_decrypt_trace_t;
68
69/* packet trace format function */
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070070static u8 *
71format_esp_decrypt_trace (u8 * s, va_list * args)
Ed Warnickecb9cada2015-12-08 15:45:58 -070072{
73 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
74 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070075 esp_decrypt_trace_t *t = va_arg (*args, esp_decrypt_trace_t *);
Ed Warnickecb9cada2015-12-08 15:45:58 -070076
77 s = format (s, "esp: crypto %U integrity %U",
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070078 format_ipsec_crypto_alg, t->crypto_alg,
79 format_ipsec_integ_alg, t->integ_alg);
Ed Warnickecb9cada2015-12-08 15:45:58 -070080 return s;
81}
82
83always_inline void
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070084esp_decrypt_aes_cbc (ipsec_crypto_alg_t alg,
85 u8 * in, u8 * out, size_t in_len, u8 * key, u8 * iv)
Ed Warnickecb9cada2015-12-08 15:45:58 -070086{
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070087 esp_main_t *em = &esp_main;
88 u32 cpu_index = os_get_cpu_number ();
89 EVP_CIPHER_CTX *ctx = &(em->per_thread_data[cpu_index].decrypt_ctx);
90 const EVP_CIPHER *cipher = NULL;
Ed Warnickecb9cada2015-12-08 15:45:58 -070091 int out_len;
92
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070093 ASSERT (alg < IPSEC_CRYPTO_N_ALG);
Ed Warnickecb9cada2015-12-08 15:45:58 -070094
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070095 if (PREDICT_FALSE (em->esp_crypto_algs[alg].type == 0))
Ed Warnickecb9cada2015-12-08 15:45:58 -070096 return;
97
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070098 if (PREDICT_FALSE (alg != em->per_thread_data[cpu_index].last_decrypt_alg))
99 {
100 cipher = em->esp_crypto_algs[alg].type;
101 em->per_thread_data[cpu_index].last_decrypt_alg = alg;
102 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700103
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700104 EVP_DecryptInit_ex (ctx, cipher, NULL, key, iv);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700105
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700106 EVP_DecryptUpdate (ctx, out, &out_len, in, in_len);
107 EVP_DecryptFinal_ex (ctx, out + out_len, &out_len);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700108}
109
Ed Warnickecb9cada2015-12-08 15:45:58 -0700110static uword
111esp_decrypt_node_fn (vlib_main_t * vm,
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700112 vlib_node_runtime_t * node, vlib_frame_t * from_frame)
Ed Warnickecb9cada2015-12-08 15:45:58 -0700113{
114 u32 n_left_from, *from, next_index, *to_next;
115 ipsec_main_t *im = &ipsec_main;
116 esp_main_t *em = &esp_main;
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700117 u32 *recycle = 0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700118 from = vlib_frame_vector_args (from_frame);
119 n_left_from = from_frame->n_vectors;
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700120 u32 cpu_index = os_get_cpu_number ();
Ed Warnickecb9cada2015-12-08 15:45:58 -0700121
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700122 ipsec_alloc_empty_buffers (vm, im);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700123
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700124 u32 *empty_buffers = im->empty_buffers[cpu_index];
Matus Fabian141977f2016-07-04 05:36:52 -0700125
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700126 if (PREDICT_FALSE (vec_len (empty_buffers) < n_left_from))
127 {
128 vlib_node_increment_counter (vm, esp_decrypt_node.index,
129 ESP_DECRYPT_ERROR_NO_BUFFER, n_left_from);
130 goto free_buffers_and_exit;
131 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700132
133 next_index = node->cached_next_index;
134
135 while (n_left_from > 0)
136 {
137 u32 n_left_to_next;
138
139 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
140
141 while (n_left_from > 0 && n_left_to_next > 0)
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700142 {
143 u32 i_bi0, o_bi0 = (u32) ~ 0, next0;
144 vlib_buffer_t *i_b0;
145 vlib_buffer_t *o_b0 = 0;
146 esp_header_t *esp0;
147 ipsec_sa_t *sa0;
148 u32 sa_index0 = ~0;
149 u32 seq;
150 ip4_header_t *ih4 = 0, *oh4 = 0;
151 ip6_header_t *ih6 = 0, *oh6 = 0;
152 u8 tunnel_mode = 1;
153 u8 transport_ip6 = 0;
Matus Fabianefc33302016-07-11 07:08:55 -0700154
Ed Warnickecb9cada2015-12-08 15:45:58 -0700155
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700156 i_bi0 = from[0];
157 from += 1;
158 n_left_from -= 1;
159 n_left_to_next -= 1;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700160
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700161 next0 = ESP_DECRYPT_NEXT_DROP;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700162
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700163 i_b0 = vlib_get_buffer (vm, i_bi0);
164 esp0 = vlib_buffer_get_current (i_b0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700165
Damjan Marion9c6ae5f2016-11-15 23:20:01 +0100166 sa_index0 = vnet_buffer (i_b0)->ipsec.sad_index;
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700167 sa0 = pool_elt_at_index (im->sad, sa_index0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700168
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700169 seq = clib_host_to_net_u32 (esp0->seq);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700170
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700171 /* anti-replay check */
172 if (sa0->use_anti_replay)
173 {
174 int rv = 0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700175
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700176 if (PREDICT_TRUE (sa0->use_esn))
177 rv = esp_replay_check_esn (sa0, seq);
178 else
179 rv = esp_replay_check (sa0, seq);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700180
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700181 if (PREDICT_FALSE (rv))
182 {
183 clib_warning ("anti-replay SPI %u seq %u", sa0->spi, seq);
184 vlib_node_increment_counter (vm, esp_decrypt_node.index,
185 ESP_DECRYPT_ERROR_REPLAY, 1);
186 o_bi0 = i_bi0;
Sergio Gonzalez Monroy73c01102016-09-06 14:06:06 +0100187 to_next[0] = o_bi0;
188 to_next += 1;
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700189 goto trace;
190 }
191 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700192
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700193 if (PREDICT_TRUE (sa0->integ_alg != IPSEC_INTEG_ALG_NONE))
194 {
195 u8 sig[64];
196 int icv_size = em->esp_integ_algs[sa0->integ_alg].trunc_size;
197 memset (sig, 0, sizeof (sig));
198 u8 *icv =
199 vlib_buffer_get_current (i_b0) + i_b0->current_length -
200 icv_size;
201 i_b0->current_length -= icv_size;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700202
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700203 hmac_calc (sa0->integ_alg, sa0->integ_key, sa0->integ_key_len,
204 (u8 *) esp0, i_b0->current_length, sig, sa0->use_esn,
205 sa0->seq_hi);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700206
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700207 if (PREDICT_FALSE (memcmp (icv, sig, icv_size)))
208 {
209 vlib_node_increment_counter (vm, esp_decrypt_node.index,
210 ESP_DECRYPT_ERROR_INTEG_ERROR,
211 1);
212 o_bi0 = i_bi0;
Sergio Gonzalez Monroy73c01102016-09-06 14:06:06 +0100213 to_next[0] = o_bi0;
214 to_next += 1;
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700215 goto trace;
216 }
217 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700218
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700219 if (PREDICT_TRUE (sa0->use_anti_replay))
220 {
221 if (PREDICT_TRUE (sa0->use_esn))
222 esp_replay_advance_esn (sa0, seq);
223 else
224 esp_replay_advance (sa0, seq);
225 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700226
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700227 /* grab free buffer */
228 uword last_empty_buffer = vec_len (empty_buffers) - 1;
229 o_bi0 = empty_buffers[last_empty_buffer];
Sergio Gonzalez Monroy73c01102016-09-06 14:06:06 +0100230 to_next[0] = o_bi0;
231 to_next += 1;
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700232 o_b0 = vlib_get_buffer (vm, o_bi0);
233 vlib_prefetch_buffer_with_index (vm,
234 empty_buffers[last_empty_buffer -
235 1], STORE);
236 _vec_len (empty_buffers) = last_empty_buffer;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700237
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700238 /* add old buffer to the recycle list */
239 vec_add1 (recycle, i_bi0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700240
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700241 if (sa0->crypto_alg >= IPSEC_CRYPTO_ALG_AES_CBC_128 &&
242 sa0->crypto_alg <= IPSEC_CRYPTO_ALG_AES_CBC_256)
243 {
244 const int BLOCK_SIZE = 16;
245 const int IV_SIZE = 16;
246 esp_footer_t *f0;
247 u8 ip_hdr_size = 0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700248
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700249 int blocks =
250 (i_b0->current_length - sizeof (esp_header_t) -
251 IV_SIZE) / BLOCK_SIZE;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700252
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700253 o_b0->current_data = sizeof (ethernet_header_t);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700254
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700255 /* transport mode */
256 if (PREDICT_FALSE (!sa0->is_tunnel && !sa0->is_tunnel_ip6))
257 {
258 tunnel_mode = 0;
259 ih4 =
260 (ip4_header_t *) (i_b0->data +
261 sizeof (ethernet_header_t));
262 if (PREDICT_TRUE
263 ((ih4->ip_version_and_header_length & 0xF0) != 0x40))
264 {
265 if (PREDICT_TRUE
266 ((ih4->ip_version_and_header_length & 0xF0) ==
267 0x60))
268 {
269 transport_ip6 = 1;
270 ip_hdr_size = sizeof (ip6_header_t);
271 ih6 =
272 (ip6_header_t *) (i_b0->data +
273 sizeof (ethernet_header_t));
274 oh6 = vlib_buffer_get_current (o_b0);
275 }
276 else
277 {
278 vlib_node_increment_counter (vm,
279 esp_decrypt_node.index,
280 ESP_DECRYPT_ERROR_NOT_IP,
281 1);
282 o_b0 = 0;
283 goto trace;
284 }
285 }
286 else
287 {
288 oh4 = vlib_buffer_get_current (o_b0);
289 ip_hdr_size = sizeof (ip4_header_t);
290 }
291 }
Matus Fabianefc33302016-07-11 07:08:55 -0700292
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700293 esp_decrypt_aes_cbc (sa0->crypto_alg,
294 esp0->data + IV_SIZE,
295 (u8 *) vlib_buffer_get_current (o_b0) +
296 ip_hdr_size, BLOCK_SIZE * blocks,
297 sa0->crypto_key, esp0->data);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700298
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700299 o_b0->current_length = (blocks * 16) - 2 + ip_hdr_size;
300 o_b0->flags = VLIB_BUFFER_TOTAL_LENGTH_VALID;
301 f0 =
302 (esp_footer_t *) ((u8 *) vlib_buffer_get_current (o_b0) +
303 o_b0->current_length);
304 o_b0->current_length -= f0->pad_length;
Matus Fabianefc33302016-07-11 07:08:55 -0700305
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700306 /* tunnel mode */
307 if (PREDICT_TRUE (tunnel_mode))
308 {
309 if (PREDICT_TRUE (f0->next_header == IP_PROTOCOL_IP_IN_IP))
Matus Fabian694265d2016-08-10 01:55:36 -0700310 {
311 next0 = ESP_DECRYPT_NEXT_IP4_INPUT;
312 oh4 = vlib_buffer_get_current (o_b0);
313 }
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700314 else if (f0->next_header == IP_PROTOCOL_IPV6)
315 next0 = ESP_DECRYPT_NEXT_IP6_INPUT;
316 else
317 {
318 clib_warning ("next header: 0x%x", f0->next_header);
319 vlib_node_increment_counter (vm, esp_decrypt_node.index,
320 ESP_DECRYPT_ERROR_DECRYPTION_FAILED,
321 1);
322 o_b0 = 0;
323 goto trace;
324 }
325 }
326 /* transport mode */
327 else
328 {
329 if (PREDICT_FALSE (transport_ip6))
330 {
331 next0 = ESP_DECRYPT_NEXT_IP6_INPUT;
332 oh6->ip_version_traffic_class_and_flow_label =
333 ih6->ip_version_traffic_class_and_flow_label;
334 oh6->protocol = f0->next_header;
335 oh6->hop_limit = ih6->hop_limit;
336 oh6->src_address.as_u64[0] = ih6->src_address.as_u64[0];
337 oh6->src_address.as_u64[1] = ih6->src_address.as_u64[1];
338 oh6->dst_address.as_u64[0] = ih6->dst_address.as_u64[0];
339 oh6->dst_address.as_u64[1] = ih6->dst_address.as_u64[1];
340 oh6->payload_length =
341 clib_host_to_net_u16 (vlib_buffer_length_in_chain
342 (vm,
343 o_b0) - sizeof (ip6_header_t));
344 }
345 else
346 {
347 next0 = ESP_DECRYPT_NEXT_IP4_INPUT;
348 oh4->ip_version_and_header_length = 0x45;
349 oh4->tos = ih4->tos;
350 oh4->fragment_id = 0;
351 oh4->flags_and_fragment_offset = 0;
352 oh4->ttl = ih4->ttl;
353 oh4->protocol = f0->next_header;
354 oh4->src_address.as_u32 = ih4->src_address.as_u32;
355 oh4->dst_address.as_u32 = ih4->dst_address.as_u32;
356 oh4->length =
357 clib_host_to_net_u16 (vlib_buffer_length_in_chain
358 (vm, o_b0));
359 oh4->checksum = ip4_header_checksum (oh4);
360 }
361 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700362
Matus Fabian694265d2016-08-10 01:55:36 -0700363 /* for IPSec-GRE tunnel next node is ipsec-gre-input */
364 if (PREDICT_FALSE
Damjan Marion9c6ae5f2016-11-15 23:20:01 +0100365 ((vnet_buffer (i_b0)->ipsec.flags) &
Matus Fabian694265d2016-08-10 01:55:36 -0700366 IPSEC_FLAG_IPSEC_GRE_TUNNEL))
367 next0 = ESP_DECRYPT_NEXT_IPSEC_GRE_INPUT;
368
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700369 vnet_buffer (o_b0)->sw_if_index[VLIB_TX] = (u32) ~ 0;
370 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700371
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700372 trace:
373 if (PREDICT_FALSE (i_b0->flags & VLIB_BUFFER_IS_TRACED))
374 {
375 if (o_b0)
376 {
377 o_b0->flags |= VLIB_BUFFER_IS_TRACED;
378 o_b0->trace_index = i_b0->trace_index;
Damjan Marion3f54b182016-08-16 11:27:02 +0200379 esp_decrypt_trace_t *tr =
380 vlib_add_trace (vm, node, o_b0, sizeof (*tr));
381 tr->crypto_alg = sa0->crypto_alg;
382 tr->integ_alg = sa0->integ_alg;
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700383 }
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700384 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700385
386 vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700387 n_left_to_next, o_bi0, next0);
388 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700389 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
390 }
391 vlib_node_increment_counter (vm, esp_decrypt_node.index,
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700392 ESP_DECRYPT_ERROR_RX_PKTS,
393 from_frame->n_vectors);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700394
395free_buffers_and_exit:
Damjan Marion3f54b182016-08-16 11:27:02 +0200396 if (recycle)
397 vlib_buffer_free (vm, recycle, vec_len (recycle));
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700398 vec_free (recycle);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700399 return from_frame->n_vectors;
400}
401
402
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700403/* *INDENT-OFF* */
Ed Warnickecb9cada2015-12-08 15:45:58 -0700404VLIB_REGISTER_NODE (esp_decrypt_node) = {
405 .function = esp_decrypt_node_fn,
406 .name = "esp-decrypt",
407 .vector_size = sizeof (u32),
408 .format_trace = format_esp_decrypt_trace,
409 .type = VLIB_NODE_TYPE_INTERNAL,
410
411 .n_errors = ARRAY_LEN(esp_decrypt_error_strings),
412 .error_strings = esp_decrypt_error_strings,
413
414 .n_next_nodes = ESP_DECRYPT_N_NEXT,
415 .next_nodes = {
416#define _(s,n) [ESP_DECRYPT_NEXT_##s] = n,
417 foreach_esp_decrypt_next
418#undef _
419 },
420};
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700421/* *INDENT-ON* */
Ed Warnickecb9cada2015-12-08 15:45:58 -0700422
Damjan Marion1c80e832016-05-11 23:07:18 +0200423VLIB_NODE_FUNCTION_MULTIARCH (esp_decrypt_node, esp_decrypt_node_fn)
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700424/*
425 * fd.io coding-style-patch-verification: ON
426 *
427 * Local Variables:
428 * eval: (c-set-style "gnu")
429 * End:
430 */