blob: 58e25f6b85ecebf108f19725b4a5018989db50e3 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/*
2 * esp_encrypt.c : IPSec ESP encrypt 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>
Klement Sekera4b089f22018-04-17 18:04:57 +020021#include <vnet/udp/udp.h>
Ed Warnickecb9cada2015-12-08 15:45:58 -070022
Damjan Marion91f17dc2019-03-18 18:59:25 +010023#include <vnet/crypto/crypto.h>
24
Ed Warnickecb9cada2015-12-08 15:45:58 -070025#include <vnet/ipsec/ipsec.h>
26#include <vnet/ipsec/esp.h>
27
Ed Warnickecb9cada2015-12-08 15:45:58 -070028#define foreach_esp_encrypt_next \
29_(DROP, "error-drop") \
Neale Rannsf62a8c02019-04-02 08:13:33 +000030_(HANDOFF, "handoff") \
Ed Warnickecb9cada2015-12-08 15:45:58 -070031_(INTERFACE_OUTPUT, "interface-output")
32
33#define _(v, s) ESP_ENCRYPT_NEXT_##v,
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070034typedef enum
35{
Ed Warnickecb9cada2015-12-08 15:45:58 -070036 foreach_esp_encrypt_next
37#undef _
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070038 ESP_ENCRYPT_N_NEXT,
Ed Warnickecb9cada2015-12-08 15:45:58 -070039} esp_encrypt_next_t;
40
Damjan Marionc59b9a22019-03-19 15:38:40 +010041#define foreach_esp_encrypt_error \
42 _(RX_PKTS, "ESP pkts received") \
43 _(SEQ_CYCLED, "sequence number cycled (packet dropped)") \
44 _(CRYPTO_ENGINE_ERROR, "crypto engine error (packet dropped)") \
45 _(CHAINED_BUFFER, "chained buffers (packet dropped)") \
46 _(NO_TRAILER_SPACE, "no trailer space (packet dropped)")
Ed Warnickecb9cada2015-12-08 15:45:58 -070047
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070048typedef enum
49{
Ed Warnickecb9cada2015-12-08 15:45:58 -070050#define _(sym,str) ESP_ENCRYPT_ERROR_##sym,
51 foreach_esp_encrypt_error
52#undef _
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070053 ESP_ENCRYPT_N_ERROR,
Ed Warnickecb9cada2015-12-08 15:45:58 -070054} esp_encrypt_error_t;
55
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070056static char *esp_encrypt_error_strings[] = {
Ed Warnickecb9cada2015-12-08 15:45:58 -070057#define _(sym,string) string,
58 foreach_esp_encrypt_error
59#undef _
60};
61
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070062typedef struct
63{
Neale Ranns8d7c5022019-02-06 01:41:05 -080064 u32 sa_index;
Ed Warnickecb9cada2015-12-08 15:45:58 -070065 u32 spi;
66 u32 seq;
Neale Ranns6afaae12019-07-17 15:07:14 +000067 u32 sa_seq_hi;
Klement Sekera4b089f22018-04-17 18:04:57 +020068 u8 udp_encap;
Ed Warnickecb9cada2015-12-08 15:45:58 -070069 ipsec_crypto_alg_t crypto_alg;
70 ipsec_integ_alg_t integ_alg;
71} esp_encrypt_trace_t;
72
73/* packet trace format function */
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070074static u8 *
75format_esp_encrypt_trace (u8 * s, va_list * args)
Ed Warnickecb9cada2015-12-08 15:45:58 -070076{
77 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
78 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070079 esp_encrypt_trace_t *t = va_arg (*args, esp_encrypt_trace_t *);
Ed Warnickecb9cada2015-12-08 15:45:58 -070080
Guillaume Solignac8f818cc2019-05-15 12:02:33 +020081 s =
82 format (s,
Neale Ranns6afaae12019-07-17 15:07:14 +000083 "esp: sa-index %d spi %u (0x%08x) seq %u sa-seq-hi %u crypto %U integrity %U%s",
84 t->sa_index, t->spi, t->spi, t->seq, t->sa_seq_hi,
85 format_ipsec_crypto_alg,
Guillaume Solignac8f818cc2019-05-15 12:02:33 +020086 t->crypto_alg, format_ipsec_integ_alg, t->integ_alg,
87 t->udp_encap ? " udp-encap-enabled" : "");
Ed Warnickecb9cada2015-12-08 15:45:58 -070088 return s;
89}
90
Damjan Marionc59b9a22019-03-19 15:38:40 +010091/* pad packet in input buffer */
92static_always_inline u8 *
Filip Tehlar8cdb1a02019-11-18 22:21:37 +000093esp_add_footer_and_icv (vlib_buffer_t * b, u8 block_size, u8 icv_sz,
94 u16 * next, vlib_node_runtime_t * node,
95 u16 buffer_data_size)
Ed Warnickecb9cada2015-12-08 15:45:58 -070096{
Damjan Marionc59b9a22019-03-19 15:38:40 +010097 static const u8 pad_data[ESP_MAX_BLOCK_SIZE] = {
98 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
99 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x00, 0x00,
100 };
Ed Warnickecb9cada2015-12-08 15:45:58 -0700101
Damjan Marionc59b9a22019-03-19 15:38:40 +0100102 u16 min_length = b->current_length + sizeof (esp_footer_t);
103 u16 new_length = round_pow2 (min_length, block_size);
104 u8 pad_bytes = new_length - min_length;
105 esp_footer_t *f = (esp_footer_t *) (vlib_buffer_get_current (b) +
106 new_length - sizeof (esp_footer_t));
Ed Warnickecb9cada2015-12-08 15:45:58 -0700107
Filip Tehlar8cdb1a02019-11-18 22:21:37 +0000108 if (b->current_data + new_length + icv_sz > buffer_data_size)
109 {
110 b->error = node->errors[ESP_ENCRYPT_ERROR_NO_TRAILER_SPACE];
111 next[0] = ESP_ENCRYPT_NEXT_DROP;
112 return 0;
113 }
114
Damjan Marionc59b9a22019-03-19 15:38:40 +0100115 if (pad_bytes)
BenoƮt Ganne4505f012019-12-07 09:14:27 -0700116 {
117 ASSERT (pad_bytes <= ESP_MAX_BLOCK_SIZE);
118 pad_bytes = clib_min (ESP_MAX_BLOCK_SIZE, pad_bytes);
119 clib_memcpy_fast ((u8 *) f - pad_bytes, pad_data, pad_bytes);
120 }
Damjan Marionc59b9a22019-03-19 15:38:40 +0100121
122 f->pad_length = pad_bytes;
123 b->current_length = new_length + icv_sz;
124 return &f->next_header;
125}
126
127static_always_inline void
128esp_update_ip4_hdr (ip4_header_t * ip4, u16 len, int is_transport, int is_udp)
129{
Neale Ranns1b582b82019-04-18 19:49:13 -0700130 ip_csum_t sum;
131 u16 old_len;
132
133 len = clib_net_to_host_u16 (len);
134 old_len = ip4->length;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100135
136 if (is_transport)
137 {
138 u8 prot = is_udp ? IP_PROTOCOL_UDP : IP_PROTOCOL_IPSEC_ESP;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100139
Neale Ranns1b582b82019-04-18 19:49:13 -0700140 sum = ip_csum_update (ip4->checksum, ip4->protocol,
141 prot, ip4_header_t, protocol);
142 ip4->protocol = prot;
143
144 sum = ip_csum_update (sum, old_len, len, ip4_header_t, length);
145 }
146 else
147 sum = ip_csum_update (ip4->checksum, old_len, len, ip4_header_t, length);
148
149 ip4->length = len;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100150 ip4->checksum = ip_csum_fold (sum);
151}
152
153static_always_inline void
154esp_fill_udp_hdr (ipsec_sa_t * sa, udp_header_t * udp, u16 len)
155{
156 clib_memcpy_fast (udp, &sa->udp_hdr, sizeof (udp_header_t));
157 udp->length = clib_net_to_host_u16 (len);
158}
159
160static_always_inline u8
161ext_hdr_is_pre_esp (u8 nexthdr)
162{
163#ifdef CLIB_HAVE_VEC128
164 static const u8x16 ext_hdr_types = {
165 IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS,
166 IP_PROTOCOL_IPV6_ROUTE,
167 IP_PROTOCOL_IPV6_FRAGMENTATION,
168 };
169
170 return !u8x16_is_all_zero (ext_hdr_types == u8x16_splat (nexthdr));
171#else
172 return ((nexthdr ^ IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS) |
173 (nexthdr ^ IP_PROTOCOL_IPV6_ROUTE) |
174 (nexthdr ^ IP_PROTOCOL_IPV6_FRAGMENTATION) != 0);
175#endif
176}
177
178static_always_inline u8
179esp_get_ip6_hdr_len (ip6_header_t * ip6)
180{
181 /* this code assumes that HbH, route and frag headers will be before
182 others, if that is not the case, they will end up encrypted */
183
184 u8 len = sizeof (ip6_header_t);
185 ip6_ext_header_t *p;
186
187 /* if next packet doesn't have ext header */
188 if (ext_hdr_is_pre_esp (ip6->protocol) == 0)
189 return len;
190
191 p = (void *) (ip6 + 1);
192 len += ip6_ext_header_len (p);
193
194 while (ext_hdr_is_pre_esp (p->next_hdr))
195 {
196 len += ip6_ext_header_len (p);
197 p = ip6_ext_next_header (p);
198 }
199
200 return len;
201}
202
Damjan Marionc59b9a22019-03-19 15:38:40 +0100203static_always_inline void
204esp_process_ops (vlib_main_t * vm, vlib_node_runtime_t * node,
205 vnet_crypto_op_t * ops, vlib_buffer_t * b[], u16 * nexts)
206{
207 u32 n_fail, n_ops = vec_len (ops);
208 vnet_crypto_op_t *op = ops;
209
210 if (n_ops == 0)
Ed Warnickecb9cada2015-12-08 15:45:58 -0700211 return;
212
Damjan Marionc59b9a22019-03-19 15:38:40 +0100213 n_fail = n_ops - vnet_crypto_process_ops (vm, op, n_ops);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700214
Damjan Marionc59b9a22019-03-19 15:38:40 +0100215 while (n_fail)
216 {
217 ASSERT (op - ops < n_ops);
218
219 if (op->status != VNET_CRYPTO_OP_STATUS_COMPLETED)
220 {
221 u32 bi = op->user_data;
222 b[bi]->error = node->errors[ESP_ENCRYPT_ERROR_CRYPTO_ENGINE_ERROR];
223 nexts[bi] = ESP_ENCRYPT_NEXT_DROP;
224 n_fail--;
225 }
226 op++;
227 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700228}
229
Damjan Mariond97918e2019-04-25 18:28:31 +0200230typedef struct
231{
232 u32 salt;
233 u64 iv;
234} __clib_packed esp_gcm_nonce_t;
235
236STATIC_ASSERT_SIZEOF (esp_gcm_nonce_t, 12);
237
Klement Sekerabe5a5dd2018-10-09 16:05:48 +0200238always_inline uword
Damjan Marionc59b9a22019-03-19 15:38:40 +0100239esp_encrypt_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
Neale Ranns25edf142019-03-22 08:12:48 +0000240 vlib_frame_t * frame, int is_ip6, int is_tun)
Ed Warnickecb9cada2015-12-08 15:45:58 -0700241{
Ed Warnickecb9cada2015-12-08 15:45:58 -0700242 ipsec_main_t *im = &ipsec_main;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100243 ipsec_per_thread_data_t *ptd = vec_elt_at_index (im->ptd, vm->thread_index);
244 u32 *from = vlib_frame_vector_args (frame);
245 u32 n_left = frame->n_vectors;
246 vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b = bufs;
Damjan Marionc98275f2019-03-06 14:05:01 +0100247 u16 nexts[VLIB_FRAME_SIZE], *next = nexts;
Damjan Mariond97918e2019-04-25 18:28:31 +0200248 esp_gcm_nonce_t nonces[VLIB_FRAME_SIZE], *nonce = nonces;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100249 u32 thread_index = vm->thread_index;
250 u16 buffer_data_size = vlib_buffer_get_default_data_size (vm);
251 u32 current_sa_index = ~0, current_sa_packets = 0;
252 u32 current_sa_bytes = 0, spi = 0;
253 u8 block_sz = 0, iv_sz = 0, icv_sz = 0;
254 ipsec_sa_t *sa0 = 0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700255
Damjan Marionc59b9a22019-03-19 15:38:40 +0100256 vlib_get_buffers (vm, from, b, n_left);
257 vec_reset_length (ptd->crypto_ops);
258 vec_reset_length (ptd->integ_ops);
259
260 while (n_left > 0)
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700261 {
Zhiyong Yang1cff6432019-04-30 05:33:53 -0400262 u32 sa_index0;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100263 dpo_id_t *dpo;
264 esp_header_t *esp;
265 u8 *payload, *next_hdr_ptr;
266 u16 payload_len;
Neale Rannsf62a8c02019-04-02 08:13:33 +0000267 u32 hdr_len, config_index;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700268
Damjan Marionc59b9a22019-03-19 15:38:40 +0100269 if (n_left > 2)
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700270 {
Damjan Marionc59b9a22019-03-19 15:38:40 +0100271 u8 *p;
272 vlib_prefetch_buffer_header (b[2], LOAD);
273 p = vlib_buffer_get_current (b[1]);
274 CLIB_PREFETCH (p, CLIB_CACHE_LINE_BYTES, LOAD);
275 p -= CLIB_CACHE_LINE_BYTES;
276 CLIB_PREFETCH (p, CLIB_CACHE_LINE_BYTES, LOAD);
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700277 }
Ed Warnickecb9cada2015-12-08 15:45:58 -0700278
Neale Ranns25edf142019-03-22 08:12:48 +0000279 if (is_tun)
280 {
281 /* we are on a ipsec tunnel's feature arc */
282 u32 next0;
Neale Rannsf62a8c02019-04-02 08:13:33 +0000283 config_index = b[0]->current_config_index;
Neale Ranns25edf142019-03-22 08:12:48 +0000284 sa_index0 = *(u32 *) vnet_feature_next_with_data (&next0, b[0],
285 sizeof
286 (sa_index0));
Neale Rannsf62a8c02019-04-02 08:13:33 +0000287 vnet_buffer (b[0])->ipsec.sad_index = sa_index0;
Neale Ranns25edf142019-03-22 08:12:48 +0000288 next[0] = next0;
289 }
290 else
291 sa_index0 = vnet_buffer (b[0])->ipsec.sad_index;
292
293 if (sa_index0 != current_sa_index)
Damjan Marionc59b9a22019-03-19 15:38:40 +0100294 {
Damjan Marion21f265f2019-06-05 15:45:50 +0200295 if (current_sa_packets)
296 vlib_increment_combined_counter (&ipsec_sa_counters, thread_index,
297 current_sa_index,
298 current_sa_packets,
299 current_sa_bytes);
300 current_sa_packets = current_sa_bytes = 0;
301
Damjan Marionc59b9a22019-03-19 15:38:40 +0100302 sa0 = pool_elt_at_index (im->sad, sa_index0);
303 current_sa_index = sa_index0;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100304 spi = clib_net_to_host_u32 (sa0->spi);
305 block_sz = sa0->crypto_block_size;
Damjan Marion7c22ff72019-04-04 12:25:44 +0200306 icv_sz = sa0->integ_icv_size;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100307 iv_sz = sa0->crypto_iv_size;
308 }
309
Neale Rannsf62a8c02019-04-02 08:13:33 +0000310 if (PREDICT_FALSE (~0 == sa0->encrypt_thread_index))
311 {
312 /* this is the first packet to use this SA, claim the SA
313 * for this thread. this could happen simultaneously on
314 * another thread */
315 clib_atomic_cmp_and_swap (&sa0->encrypt_thread_index, ~0,
316 ipsec_sa_assign_thread (thread_index));
317 }
318
319 if (PREDICT_TRUE (thread_index != sa0->encrypt_thread_index))
320 {
321 next[0] = ESP_ENCRYPT_NEXT_HANDOFF;
322 if (is_tun)
323 {
324 b[0]->current_config_index = config_index;
325 }
326 goto trace;
327 }
328
Damjan Marionc59b9a22019-03-19 15:38:40 +0100329 if (vlib_buffer_chain_linearize (vm, b[0]) != 1)
330 {
331 b[0]->error = node->errors[ESP_ENCRYPT_ERROR_CHAINED_BUFFER];
332 next[0] = ESP_ENCRYPT_NEXT_DROP;
333 goto trace;
334 }
335
336 if (PREDICT_FALSE (esp_seq_advance (sa0)))
337 {
338 b[0]->error = node->errors[ESP_ENCRYPT_ERROR_SEQ_CYCLED];
339 next[0] = ESP_ENCRYPT_NEXT_DROP;
340 goto trace;
341 }
342
343 /* space for IV */
344 hdr_len = iv_sz;
345
Damjan Mariond709cbc2019-03-26 13:16:42 +0100346 if (ipsec_sa_is_set_IS_TUNNEL (sa0))
Damjan Marionc59b9a22019-03-19 15:38:40 +0100347 {
348 payload = vlib_buffer_get_current (b[0]);
Filip Tehlar8cdb1a02019-11-18 22:21:37 +0000349 next_hdr_ptr = esp_add_footer_and_icv (b[0], block_sz, icv_sz,
350 next, node,
351 buffer_data_size);
352 if (!next_hdr_ptr)
Damjan Marionc59b9a22019-03-19 15:38:40 +0100353 goto trace;
Filip Tehlar8cdb1a02019-11-18 22:21:37 +0000354 payload_len = b[0]->current_length;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100355
356 /* ESP header */
357 hdr_len += sizeof (*esp);
358 esp = (esp_header_t *) (payload - hdr_len);
359
360 /* optional UDP header */
Damjan Mariond709cbc2019-03-26 13:16:42 +0100361 if (ipsec_sa_is_set_UDP_ENCAP (sa0))
Damjan Marionc98275f2019-03-06 14:05:01 +0100362 {
Damjan Marionc59b9a22019-03-19 15:38:40 +0100363 hdr_len += sizeof (udp_header_t);
364 esp_fill_udp_hdr (sa0, (udp_header_t *) (payload - hdr_len),
365 payload_len + hdr_len);
366 }
367
368 /* IP header */
Damjan Mariond709cbc2019-03-26 13:16:42 +0100369 if (ipsec_sa_is_set_IS_TUNNEL_V6 (sa0))
Damjan Marionc59b9a22019-03-19 15:38:40 +0100370 {
371 ip6_header_t *ip6;
372 u16 len = sizeof (ip6_header_t);
373 hdr_len += len;
374 ip6 = (ip6_header_t *) (payload - hdr_len);
375 clib_memcpy_fast (ip6, &sa0->ip6_hdr, len);
Neale Ranns987aea82019-03-27 13:40:35 +0000376 *next_hdr_ptr = (is_ip6 ?
377 IP_PROTOCOL_IPV6 : IP_PROTOCOL_IP_IN_IP);
Damjan Marionc59b9a22019-03-19 15:38:40 +0100378 len = payload_len + hdr_len - len;
379 ip6->payload_length = clib_net_to_host_u16 (len);
Damjan Marionc98275f2019-03-06 14:05:01 +0100380 }
381 else
382 {
Damjan Marionc59b9a22019-03-19 15:38:40 +0100383 ip4_header_t *ip4;
384 u16 len = sizeof (ip4_header_t);
385 hdr_len += len;
386 ip4 = (ip4_header_t *) (payload - hdr_len);
387 clib_memcpy_fast (ip4, &sa0->ip4_hdr, len);
Neale Ranns987aea82019-03-27 13:40:35 +0000388 *next_hdr_ptr = (is_ip6 ?
389 IP_PROTOCOL_IPV6 : IP_PROTOCOL_IP_IN_IP);
Damjan Marionc59b9a22019-03-19 15:38:40 +0100390 len = payload_len + hdr_len;
391 esp_update_ip4_hdr (ip4, len, /* is_transport */ 0, 0);
Damjan Marionc98275f2019-03-06 14:05:01 +0100392 }
Damjan Marionc98275f2019-03-06 14:05:01 +0100393
Neale Ranns72f2a3a2019-06-17 15:43:38 +0000394 dpo = &sa0->dpo;
Neale Ranns25edf142019-03-22 08:12:48 +0000395 if (!is_tun)
396 {
397 next[0] = dpo->dpoi_next_node;
398 vnet_buffer (b[0])->ip.adj_index[VLIB_TX] = dpo->dpoi_index;
399 }
Damjan Marionc98275f2019-03-06 14:05:01 +0100400 }
Damjan Marionc59b9a22019-03-19 15:38:40 +0100401 else /* transport mode */
Damjan Marionc98275f2019-03-06 14:05:01 +0100402 {
Damjan Marionc59b9a22019-03-19 15:38:40 +0100403 u8 *l2_hdr, l2_len, *ip_hdr, ip_len;
404 udp_header_t *udp = 0;
405 u8 *old_ip_hdr = vlib_buffer_get_current (b[0]);
Damjan Marionc98275f2019-03-06 14:05:01 +0100406
Damjan Marionc59b9a22019-03-19 15:38:40 +0100407 ip_len = is_ip6 ?
408 esp_get_ip6_hdr_len ((ip6_header_t *) old_ip_hdr) :
409 ip4_header_bytes ((ip4_header_t *) old_ip_hdr);
Damjan Marionc98275f2019-03-06 14:05:01 +0100410
Damjan Marionc59b9a22019-03-19 15:38:40 +0100411 vlib_buffer_advance (b[0], ip_len);
412 payload = vlib_buffer_get_current (b[0]);
Filip Tehlar8cdb1a02019-11-18 22:21:37 +0000413 next_hdr_ptr = esp_add_footer_and_icv (b[0], block_sz, icv_sz,
414 next, node,
415 buffer_data_size);
416 if (!next_hdr_ptr)
Damjan Marionc59b9a22019-03-19 15:38:40 +0100417 goto trace;
Filip Tehlar8cdb1a02019-11-18 22:21:37 +0000418 payload_len = b[0]->current_length;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100419
420 /* ESP header */
421 hdr_len += sizeof (*esp);
422 esp = (esp_header_t *) (payload - hdr_len);
423
424 /* optional UDP header */
Damjan Mariond709cbc2019-03-26 13:16:42 +0100425 if (ipsec_sa_is_set_UDP_ENCAP (sa0))
Damjan Marionc98275f2019-03-06 14:05:01 +0100426 {
Damjan Marionc59b9a22019-03-19 15:38:40 +0100427 hdr_len += sizeof (udp_header_t);
428 udp = (udp_header_t *) (payload - hdr_len);
Damjan Marionc98275f2019-03-06 14:05:01 +0100429 }
430
Damjan Marionc59b9a22019-03-19 15:38:40 +0100431 /* IP header */
432 hdr_len += ip_len;
433 ip_hdr = payload - hdr_len;
434
435 /* L2 header */
Neale Rannsc87b66c2019-02-07 07:26:12 -0800436 if (!is_tun)
437 {
438 l2_len = vnet_buffer (b[0])->ip.save_rewrite_length;
439 hdr_len += l2_len;
440 l2_hdr = payload - hdr_len;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100441
Neale Rannsc87b66c2019-02-07 07:26:12 -0800442 /* copy l2 and ip header */
443 clib_memcpy_le32 (l2_hdr, old_ip_hdr - l2_len, l2_len);
444 }
445 else
446 l2_len = 0;
447
Damjan Marionc59b9a22019-03-19 15:38:40 +0100448 clib_memcpy_le64 (ip_hdr, old_ip_hdr, ip_len);
449
Damjan Marionc98275f2019-03-06 14:05:01 +0100450 if (is_ip6)
Damjan Marionc59b9a22019-03-19 15:38:40 +0100451 {
452 ip6_header_t *ip6 = (ip6_header_t *) (ip_hdr);
453 *next_hdr_ptr = ip6->protocol;
454 ip6->protocol = IP_PROTOCOL_IPSEC_ESP;
Neale Rannsd207fd72019-04-18 17:18:12 -0700455 ip6->payload_length =
456 clib_host_to_net_u16 (payload_len + hdr_len - l2_len -
457 ip_len);
Damjan Marionc59b9a22019-03-19 15:38:40 +0100458 }
Damjan Marionc98275f2019-03-06 14:05:01 +0100459 else
Damjan Marionc98275f2019-03-06 14:05:01 +0100460 {
Damjan Marionc59b9a22019-03-19 15:38:40 +0100461 u16 len;
462 ip4_header_t *ip4 = (ip4_header_t *) (ip_hdr);
463 *next_hdr_ptr = ip4->protocol;
Neale Ranns1b582b82019-04-18 19:49:13 -0700464 len = payload_len + hdr_len - l2_len;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100465 if (udp)
466 {
467 esp_update_ip4_hdr (ip4, len, /* is_transport */ 1, 1);
468 esp_fill_udp_hdr (sa0, udp, len - ip_len);
469 }
470 else
471 esp_update_ip4_hdr (ip4, len, /* is_transport */ 1, 0);
Damjan Marionc98275f2019-03-06 14:05:01 +0100472 }
Damjan Marionc98275f2019-03-06 14:05:01 +0100473
Neale Rannsc87b66c2019-02-07 07:26:12 -0800474 if (!is_tun)
475 next[0] = ESP_ENCRYPT_NEXT_INTERFACE_OUTPUT;
Damjan Marionc98275f2019-03-06 14:05:01 +0100476 }
477
Damjan Marionc59b9a22019-03-19 15:38:40 +0100478 esp->spi = spi;
479 esp->seq = clib_net_to_host_u32 (sa0->seq);
Damjan Marionc98275f2019-03-06 14:05:01 +0100480
Damjan Marion060bfb92019-03-29 13:47:54 +0100481 if (sa0->crypto_enc_op_id)
Damjan Marionc98275f2019-03-06 14:05:01 +0100482 {
Damjan Marionc59b9a22019-03-19 15:38:40 +0100483 vnet_crypto_op_t *op;
484 vec_add2_aligned (ptd->crypto_ops, op, 1, CLIB_CACHE_LINE_BYTES);
Damjan Marion060bfb92019-03-29 13:47:54 +0100485 vnet_crypto_op_init (op, sa0->crypto_enc_op_id);
Damjan Marionc59b9a22019-03-19 15:38:40 +0100486 op->src = op->dst = payload;
Damjan Mariond1bed682019-04-24 15:20:35 +0200487 op->key_index = sa0->crypto_key_index;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100488 op->len = payload_len - icv_sz;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100489 op->user_data = b - bufs;
Neale Ranns47feb112019-04-11 15:14:07 +0000490
491 if (ipsec_sa_is_set_IS_AEAD (sa0))
492 {
493 /*
494 * construct the AAD in a scratch space in front
495 * of the IP header.
496 */
497 op->aad = payload - hdr_len - sizeof (esp_aead_t);
498
499 esp_aad_fill (op, esp, sa0);
500
501 op->tag = payload + op->len;
502 op->tag_len = 16;
Damjan Mariond97918e2019-04-25 18:28:31 +0200503
504 u64 *iv = (u64 *) (payload - iv_sz);
505 nonce->salt = sa0->salt;
506 nonce->iv = *iv = clib_host_to_net_u64 (sa0->gcm_iv_counter++);
507 op->iv = (u8 *) nonce;
508 nonce++;
509 }
510 else
511 {
512 op->iv = payload - iv_sz;
513 op->flags = VNET_CRYPTO_OP_FLAG_INIT_IV;
Neale Ranns47feb112019-04-11 15:14:07 +0000514 }
Damjan Marionc98275f2019-03-06 14:05:01 +0100515 }
Damjan Marionc59b9a22019-03-19 15:38:40 +0100516
Damjan Marion060bfb92019-03-29 13:47:54 +0100517 if (sa0->integ_op_id)
Damjan Marionc98275f2019-03-06 14:05:01 +0100518 {
Damjan Marionc59b9a22019-03-19 15:38:40 +0100519 vnet_crypto_op_t *op;
520 vec_add2_aligned (ptd->integ_ops, op, 1, CLIB_CACHE_LINE_BYTES);
Damjan Marion060bfb92019-03-29 13:47:54 +0100521 vnet_crypto_op_init (op, sa0->integ_op_id);
Damjan Marionc59b9a22019-03-19 15:38:40 +0100522 op->src = payload - iv_sz - sizeof (esp_header_t);
Damjan Marion060bfb92019-03-29 13:47:54 +0100523 op->digest = payload + payload_len - icv_sz;
Damjan Mariond1bed682019-04-24 15:20:35 +0200524 op->key_index = sa0->integ_key_index;
Damjan Marion060bfb92019-03-29 13:47:54 +0100525 op->digest_len = icv_sz;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100526 op->len = payload_len - icv_sz + iv_sz + sizeof (esp_header_t);
Damjan Marionc59b9a22019-03-19 15:38:40 +0100527 op->user_data = b - bufs;
Damjan Marion1e3aa5e2019-03-28 10:58:59 +0100528 if (ipsec_sa_is_set_USE_ESN (sa0))
Damjan Marionc98275f2019-03-06 14:05:01 +0100529 {
Damjan Marionc59b9a22019-03-19 15:38:40 +0100530 u32 seq_hi = clib_net_to_host_u32 (sa0->seq_hi);
Neale Ranns49e7ef62019-04-10 17:24:29 +0000531 clib_memcpy_fast (op->digest, &seq_hi, sizeof (seq_hi));
Damjan Marionc59b9a22019-03-19 15:38:40 +0100532 op->len += sizeof (seq_hi);
Damjan Marionc98275f2019-03-06 14:05:01 +0100533 }
534 }
535
Damjan Marionc59b9a22019-03-19 15:38:40 +0100536 vlib_buffer_advance (b[0], 0LL - hdr_len);
Damjan Marionc98275f2019-03-06 14:05:01 +0100537
Damjan Marionc59b9a22019-03-19 15:38:40 +0100538 current_sa_packets += 1;
539 current_sa_bytes += payload_len;
540
541 trace:
542 if (PREDICT_FALSE (b[0]->flags & VLIB_BUFFER_IS_TRACED))
Damjan Marionc98275f2019-03-06 14:05:01 +0100543 {
Damjan Marionc59b9a22019-03-19 15:38:40 +0100544 esp_encrypt_trace_t *tr = vlib_add_trace (vm, node, b[0],
545 sizeof (*tr));
546 tr->sa_index = sa_index0;
547 tr->spi = sa0->spi;
Neale Ranns6afaae12019-07-17 15:07:14 +0000548 tr->seq = sa0->seq;
549 tr->sa_seq_hi = sa0->seq_hi;
Damjan Mariond709cbc2019-03-26 13:16:42 +0100550 tr->udp_encap = ipsec_sa_is_set_UDP_ENCAP (sa0);
Damjan Marionc59b9a22019-03-19 15:38:40 +0100551 tr->crypto_alg = sa0->crypto_alg;
552 tr->integ_alg = sa0->integ_alg;
Damjan Marionc98275f2019-03-06 14:05:01 +0100553 }
Damjan Marionc98275f2019-03-06 14:05:01 +0100554 /* next */
Damjan Marionc59b9a22019-03-19 15:38:40 +0100555 n_left -= 1;
Damjan Marionc98275f2019-03-06 14:05:01 +0100556 next += 1;
Damjan Marionc59b9a22019-03-19 15:38:40 +0100557 b += 1;
Damjan Marionc98275f2019-03-06 14:05:01 +0100558 }
559
Damjan Marionc59b9a22019-03-19 15:38:40 +0100560 vlib_increment_combined_counter (&ipsec_sa_counters, thread_index,
561 current_sa_index, current_sa_packets,
562 current_sa_bytes);
Damjan Marionc59b9a22019-03-19 15:38:40 +0100563 esp_process_ops (vm, node, ptd->crypto_ops, bufs, nexts);
564 esp_process_ops (vm, node, ptd->integ_ops, bufs, nexts);
565
566 vlib_node_increment_counter (vm, node->node_index,
567 ESP_ENCRYPT_ERROR_RX_PKTS, frame->n_vectors);
568
569 vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors);
570 return frame->n_vectors;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700571}
572
Klement Sekerab8f35442018-10-29 13:38:19 +0100573VLIB_NODE_FN (esp4_encrypt_node) (vlib_main_t * vm,
574 vlib_node_runtime_t * node,
575 vlib_frame_t * from_frame)
Klement Sekerabe5a5dd2018-10-09 16:05:48 +0200576{
Neale Ranns25edf142019-03-22 08:12:48 +0000577 return esp_encrypt_inline (vm, node, from_frame, 0 /* is_ip6 */ , 0);
Klement Sekerabe5a5dd2018-10-09 16:05:48 +0200578}
Ed Warnickecb9cada2015-12-08 15:45:58 -0700579
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700580/* *INDENT-OFF* */
Klement Sekerabe5a5dd2018-10-09 16:05:48 +0200581VLIB_REGISTER_NODE (esp4_encrypt_node) = {
Klement Sekerabe5a5dd2018-10-09 16:05:48 +0200582 .name = "esp4-encrypt",
Ed Warnickecb9cada2015-12-08 15:45:58 -0700583 .vector_size = sizeof (u32),
584 .format_trace = format_esp_encrypt_trace,
585 .type = VLIB_NODE_TYPE_INTERNAL,
586
587 .n_errors = ARRAY_LEN(esp_encrypt_error_strings),
588 .error_strings = esp_encrypt_error_strings,
589
590 .n_next_nodes = ESP_ENCRYPT_N_NEXT,
591 .next_nodes = {
Neale Rannsf62a8c02019-04-02 08:13:33 +0000592 [ESP_ENCRYPT_NEXT_DROP] = "ip4-drop",
593 [ESP_ENCRYPT_NEXT_HANDOFF] = "esp4-encrypt-handoff",
594 [ESP_ENCRYPT_NEXT_INTERFACE_OUTPUT] = "interface-output",
Ed Warnickecb9cada2015-12-08 15:45:58 -0700595 },
596};
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700597/* *INDENT-ON* */
Ed Warnickecb9cada2015-12-08 15:45:58 -0700598
Klement Sekerab8f35442018-10-29 13:38:19 +0100599VLIB_NODE_FN (esp6_encrypt_node) (vlib_main_t * vm,
600 vlib_node_runtime_t * node,
601 vlib_frame_t * from_frame)
Klement Sekerabe5a5dd2018-10-09 16:05:48 +0200602{
Neale Ranns25edf142019-03-22 08:12:48 +0000603 return esp_encrypt_inline (vm, node, from_frame, 1 /* is_ip6 */ , 0);
Klement Sekerabe5a5dd2018-10-09 16:05:48 +0200604}
605
606/* *INDENT-OFF* */
607VLIB_REGISTER_NODE (esp6_encrypt_node) = {
Klement Sekerabe5a5dd2018-10-09 16:05:48 +0200608 .name = "esp6-encrypt",
609 .vector_size = sizeof (u32),
610 .format_trace = format_esp_encrypt_trace,
611 .type = VLIB_NODE_TYPE_INTERNAL,
612
613 .n_errors = ARRAY_LEN(esp_encrypt_error_strings),
614 .error_strings = esp_encrypt_error_strings,
615
616 .n_next_nodes = ESP_ENCRYPT_N_NEXT,
617 .next_nodes = {
Neale Rannsf62a8c02019-04-02 08:13:33 +0000618 [ESP_ENCRYPT_NEXT_DROP] = "ip6-drop",
619 [ESP_ENCRYPT_NEXT_HANDOFF] = "esp6-encrypt-handoff",
620 [ESP_ENCRYPT_NEXT_INTERFACE_OUTPUT] = "interface-output",
Klement Sekerabe5a5dd2018-10-09 16:05:48 +0200621 },
622};
623/* *INDENT-ON* */
624
Neale Ranns25edf142019-03-22 08:12:48 +0000625VLIB_NODE_FN (esp4_encrypt_tun_node) (vlib_main_t * vm,
626 vlib_node_runtime_t * node,
627 vlib_frame_t * from_frame)
628{
629 return esp_encrypt_inline (vm, node, from_frame, 0 /* is_ip6 */ , 1);
630}
631
632/* *INDENT-OFF* */
633VLIB_REGISTER_NODE (esp4_encrypt_tun_node) = {
634 .name = "esp4-encrypt-tun",
635 .vector_size = sizeof (u32),
636 .format_trace = format_esp_encrypt_trace,
637 .type = VLIB_NODE_TYPE_INTERNAL,
638
639 .n_errors = ARRAY_LEN(esp_encrypt_error_strings),
640 .error_strings = esp_encrypt_error_strings,
Neale Rannsd7603d92019-03-28 08:56:10 +0000641
Neale Rannsf62a8c02019-04-02 08:13:33 +0000642 .n_next_nodes = ESP_ENCRYPT_N_NEXT,
Neale Rannsd7603d92019-03-28 08:56:10 +0000643 .next_nodes = {
644 [ESP_ENCRYPT_NEXT_DROP] = "ip4-drop",
Neale Rannsf62a8c02019-04-02 08:13:33 +0000645 [ESP_ENCRYPT_NEXT_HANDOFF] = "esp4-encrypt-handoff",
646 [ESP_ENCRYPT_NEXT_INTERFACE_OUTPUT] = "error-drop",
Neale Rannsd7603d92019-03-28 08:56:10 +0000647 },
Neale Ranns25edf142019-03-22 08:12:48 +0000648};
649
650VNET_FEATURE_INIT (esp4_encrypt_tun_feat_node, static) =
651{
652 .arc_name = "ip4-output",
653 .node_name = "esp4-encrypt-tun",
Neale Rannsea5bb772019-04-02 05:43:34 -0700654 .runs_before = VNET_FEATURES ("adj-midchain-tx"),
Neale Ranns25edf142019-03-22 08:12:48 +0000655};
Neale Rannsc87b66c2019-02-07 07:26:12 -0800656
Neale Rannsb3259832019-09-27 13:32:02 +0000657VNET_FEATURE_INIT (esp6o4_encrypt_tun_feat_node, static) =
658{
659 .arc_name = "ip6-output",
660 .node_name = "esp4-encrypt-tun",
661 .runs_before = VNET_FEATURES ("adj-midchain-tx"),
662};
663
Neale Rannsc87b66c2019-02-07 07:26:12 -0800664VNET_FEATURE_INIT (esp4_ethernet_encrypt_tun_feat_node, static) =
665{
666 .arc_name = "ethernet-output",
667 .node_name = "esp4-encrypt-tun",
668 .runs_before = VNET_FEATURES ("adj-midchain-tx", "adj-midchain-tx-no-count"),
669};
Neale Ranns25edf142019-03-22 08:12:48 +0000670/* *INDENT-ON* */
671
672VLIB_NODE_FN (esp6_encrypt_tun_node) (vlib_main_t * vm,
673 vlib_node_runtime_t * node,
674 vlib_frame_t * from_frame)
675{
676 return esp_encrypt_inline (vm, node, from_frame, 1 /* is_ip6 */ , 1);
677}
678
679/* *INDENT-OFF* */
680VLIB_REGISTER_NODE (esp6_encrypt_tun_node) = {
681 .name = "esp6-encrypt-tun",
682 .vector_size = sizeof (u32),
683 .format_trace = format_esp_encrypt_trace,
684 .type = VLIB_NODE_TYPE_INTERNAL,
685
686 .n_errors = ARRAY_LEN(esp_encrypt_error_strings),
687 .error_strings = esp_encrypt_error_strings,
Neale Rannsd7603d92019-03-28 08:56:10 +0000688
Neale Rannsf62a8c02019-04-02 08:13:33 +0000689 .n_next_nodes = ESP_ENCRYPT_N_NEXT,
Neale Rannsd7603d92019-03-28 08:56:10 +0000690 .next_nodes = {
691 [ESP_ENCRYPT_NEXT_DROP] = "ip6-drop",
Neale Rannsf62a8c02019-04-02 08:13:33 +0000692 [ESP_ENCRYPT_NEXT_HANDOFF] = "esp6-encrypt-handoff",
693 [ESP_ENCRYPT_NEXT_INTERFACE_OUTPUT] = "error-drop",
Neale Rannsd7603d92019-03-28 08:56:10 +0000694 },
Neale Ranns25edf142019-03-22 08:12:48 +0000695};
696
697VNET_FEATURE_INIT (esp6_encrypt_tun_feat_node, static) =
698{
699 .arc_name = "ip6-output",
700 .node_name = "esp6-encrypt-tun",
Neale Rannsea5bb772019-04-02 05:43:34 -0700701 .runs_before = VNET_FEATURES ("adj-midchain-tx"),
Neale Ranns25edf142019-03-22 08:12:48 +0000702};
Neale Rannsb3259832019-09-27 13:32:02 +0000703
704VNET_FEATURE_INIT (esp4o6_encrypt_tun_feat_node, static) =
705{
706 .arc_name = "ip4-output",
707 .node_name = "esp6-encrypt-tun",
708 .runs_before = VNET_FEATURES ("adj-midchain-tx"),
709};
710
Neale Ranns25edf142019-03-22 08:12:48 +0000711/* *INDENT-ON* */
712
Matthew Smith401aedf2019-07-08 14:45:04 -0500713typedef struct
714{
715 u32 sa_index;
716} esp_no_crypto_trace_t;
717
718static u8 *
719format_esp_no_crypto_trace (u8 * s, va_list * args)
720{
721 CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
722 CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
723 esp_no_crypto_trace_t *t = va_arg (*args, esp_no_crypto_trace_t *);
724
725 s = format (s, "esp-no-crypto: sa-index %u", t->sa_index);
726
727 return s;
728}
729
730enum
731{
732 ESP_NO_CRYPTO_NEXT_DROP,
733 ESP_NO_CRYPTO_N_NEXT,
734};
735
736enum
737{
738 ESP_NO_CRYPTO_ERROR_RX_PKTS,
739};
740
741static char *esp_no_crypto_error_strings[] = {
742 "Outbound ESP packets received",
743};
744
745always_inline uword
746esp_no_crypto_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
747 vlib_frame_t * frame)
748{
749 vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b = bufs;
750 u16 nexts[VLIB_FRAME_SIZE], *next = nexts;
751 u32 *from = vlib_frame_vector_args (frame);
752 u32 n_left = frame->n_vectors;
753
754 vlib_get_buffers (vm, from, b, n_left);
755
756 while (n_left > 0)
757 {
758 u32 next0;
759 u32 sa_index0;
760
761 /* packets are always going to be dropped, but get the sa_index */
762 sa_index0 = *(u32 *) vnet_feature_next_with_data (&next0, b[0],
763 sizeof (sa_index0));
764
765 next[0] = ESP_NO_CRYPTO_NEXT_DROP;
766
767 if (PREDICT_FALSE (b[0]->flags & VLIB_BUFFER_IS_TRACED))
768 {
769 esp_no_crypto_trace_t *tr = vlib_add_trace (vm, node, b[0],
770 sizeof (*tr));
771 tr->sa_index = sa_index0;
772 }
773
774 n_left -= 1;
775 next += 1;
776 b += 1;
777 }
778
779 vlib_node_increment_counter (vm, node->node_index,
780 ESP_NO_CRYPTO_ERROR_RX_PKTS, frame->n_vectors);
781
782 vlib_buffer_enqueue_to_next (vm, node, from, nexts, frame->n_vectors);
783
784 return frame->n_vectors;
785}
786
787VLIB_NODE_FN (esp4_no_crypto_tun_node) (vlib_main_t * vm,
788 vlib_node_runtime_t * node,
789 vlib_frame_t * from_frame)
790{
791 return esp_no_crypto_inline (vm, node, from_frame);
792}
793
794/* *INDENT-OFF* */
795VLIB_REGISTER_NODE (esp4_no_crypto_tun_node) =
796{
797 .name = "esp4-no-crypto",
798 .vector_size = sizeof (u32),
799 .format_trace = format_esp_no_crypto_trace,
800 .n_errors = ARRAY_LEN(esp_no_crypto_error_strings),
801 .error_strings = esp_no_crypto_error_strings,
802 .n_next_nodes = ESP_NO_CRYPTO_N_NEXT,
803 .next_nodes = {
804 [ESP_NO_CRYPTO_NEXT_DROP] = "ip4-drop",
805 },
806};
807
808VNET_FEATURE_INIT (esp4_no_crypto_tun_feat_node, static) =
809{
810 .arc_name = "ip4-output",
811 .node_name = "esp4-no-crypto",
812 .runs_before = VNET_FEATURES ("adj-midchain-tx"),
813};
814
815VLIB_NODE_FN (esp6_no_crypto_tun_node) (vlib_main_t * vm,
816 vlib_node_runtime_t * node,
817 vlib_frame_t * from_frame)
818{
819 return esp_no_crypto_inline (vm, node, from_frame);
820}
821
822/* *INDENT-OFF* */
823VLIB_REGISTER_NODE (esp6_no_crypto_tun_node) =
824{
825 .name = "esp6-no-crypto",
826 .vector_size = sizeof (u32),
827 .format_trace = format_esp_no_crypto_trace,
828 .n_errors = ARRAY_LEN(esp_no_crypto_error_strings),
829 .error_strings = esp_no_crypto_error_strings,
830 .n_next_nodes = ESP_NO_CRYPTO_N_NEXT,
831 .next_nodes = {
832 [ESP_NO_CRYPTO_NEXT_DROP] = "ip6-drop",
833 },
834};
835
836VNET_FEATURE_INIT (esp6_no_crypto_tun_feat_node, static) =
837{
838 .arc_name = "ip6-output",
839 .node_name = "esp6-no-crypto",
840 .runs_before = VNET_FEATURES ("adj-midchain-tx"),
841};
842/* *INDENT-ON* */
843
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700844/*
845 * fd.io coding-style-patch-verification: ON
846 *
847 * Local Variables:
848 * eval: (c-set-style "gnu")
849 * End:
850 */