blob: 909254a1dc9665570e050c27b66dd92136f523f2 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/*
2 * decap.c : IPSec tunnel support
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#include <vnet/interface.h>
Neale Ranns8d7c5022019-02-06 01:41:05 -080022#include <vnet/fib/fib_table.h>
Ed Warnickecb9cada2015-12-08 15:45:58 -070023
24#include <vnet/ipsec/ipsec.h>
Neale Rannsc87b66c2019-02-07 07:26:12 -080025#include <vnet/ipsec/ipsec_tun.h>
Neale Ranns6ba4e412020-10-19 09:59:41 +000026#include <vnet/ipsec/ipsec_itf.h>
Ed Warnickecb9cada2015-12-08 15:45:58 -070027
28u8 *
29format_ipsec_policy_action (u8 * s, va_list * args)
30{
31 u32 i = va_arg (*args, u32);
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070032 char *t = 0;
Ed Warnickecb9cada2015-12-08 15:45:58 -070033
34 switch (i)
35 {
36#define _(v,f,str) case IPSEC_POLICY_ACTION_##f: t = str; break;
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070037 foreach_ipsec_policy_action
Ed Warnickecb9cada2015-12-08 15:45:58 -070038#undef _
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070039 default:
40 s = format (s, "unknown");
Ed Warnickecb9cada2015-12-08 15:45:58 -070041 }
42 s = format (s, "%s", t);
43 return s;
44}
45
Neale Ranns9f231d42019-03-19 10:06:00 +000046u8 *
47format_ipsec_policy_type (u8 * s, va_list * args)
48{
49 u32 i = va_arg (*args, u32);
50 char *t = 0;
51
52 switch (i)
53 {
54#define _(f,str) case IPSEC_SPD_POLICY_##f: t = str; break;
55 foreach_ipsec_spd_policy_type
56#undef _
57 default:
58 s = format (s, "unknown");
59 }
60 s = format (s, "%s", t);
61 return s;
62}
63
Ed Warnickecb9cada2015-12-08 15:45:58 -070064uword
65unformat_ipsec_policy_action (unformat_input_t * input, va_list * args)
66{
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070067 u32 *r = va_arg (*args, u32 *);
Ed Warnickecb9cada2015-12-08 15:45:58 -070068
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070069 if (0);
Ed Warnickecb9cada2015-12-08 15:45:58 -070070#define _(v,f,s) else if (unformat (input, s)) *r = IPSEC_POLICY_ACTION_##f;
71 foreach_ipsec_policy_action
72#undef _
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070073 else
Ed Warnickecb9cada2015-12-08 15:45:58 -070074 return 0;
75 return 1;
76}
77
78u8 *
79format_ipsec_crypto_alg (u8 * s, va_list * args)
80{
81 u32 i = va_arg (*args, u32);
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070082 u8 *t = 0;
Ed Warnickecb9cada2015-12-08 15:45:58 -070083
84 switch (i)
85 {
86#define _(v,f,str) case IPSEC_CRYPTO_ALG_##f: t = (u8 *) str; break;
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070087 foreach_ipsec_crypto_alg
Ed Warnickecb9cada2015-12-08 15:45:58 -070088#undef _
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -070089 default:
90 s = format (s, "unknown");
Ed Warnickecb9cada2015-12-08 15:45:58 -070091 }
92 s = format (s, "%s", t);
93 return s;
94}
95
96uword
97unformat_ipsec_crypto_alg (unformat_input_t * input, va_list * args)
98{
BenoƮt Gannef6422ff2020-11-06 10:51:47 +010099 ipsec_crypto_alg_t *r = va_arg (*args, ipsec_crypto_alg_t *);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700100
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700101 if (0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700102#define _(v,f,s) else if (unformat (input, s)) *r = IPSEC_CRYPTO_ALG_##f;
103 foreach_ipsec_crypto_alg
104#undef _
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700105 else
Ed Warnickecb9cada2015-12-08 15:45:58 -0700106 return 0;
107 return 1;
108}
109
110u8 *
111format_ipsec_integ_alg (u8 * s, va_list * args)
112{
113 u32 i = va_arg (*args, u32);
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700114 u8 *t = 0;
Ed Warnickecb9cada2015-12-08 15:45:58 -0700115
116 switch (i)
117 {
118#define _(v,f,str) case IPSEC_INTEG_ALG_##f: t = (u8 *) str; break;
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700119 foreach_ipsec_integ_alg
Ed Warnickecb9cada2015-12-08 15:45:58 -0700120#undef _
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700121 default:
122 s = format (s, "unknown");
Ed Warnickecb9cada2015-12-08 15:45:58 -0700123 }
124 s = format (s, "%s", t);
125 return s;
126}
127
128uword
129unformat_ipsec_integ_alg (unformat_input_t * input, va_list * args)
130{
BenoƮt Gannef6422ff2020-11-06 10:51:47 +0100131 ipsec_integ_alg_t *r = va_arg (*args, ipsec_integ_alg_t *);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700132
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700133 if (0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700134#define _(v,f,s) else if (unformat (input, s)) *r = IPSEC_INTEG_ALG_##f;
135 foreach_ipsec_integ_alg
136#undef _
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700137 else
Ed Warnickecb9cada2015-12-08 15:45:58 -0700138 return 0;
139 return 1;
140}
141
142u8 *
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700143format_ipsec_replay_window (u8 * s, va_list * args)
Ed Warnickecb9cada2015-12-08 15:45:58 -0700144{
145 u64 w = va_arg (*args, u64);
146 u8 i;
147
148 for (i = 0; i < 64; i++)
149 {
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700150 s = format (s, "%u", w & (1ULL << i) ? 1 : 0);
Ed Warnickecb9cada2015-12-08 15:45:58 -0700151 }
152
153 return s;
154}
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700155
Neale Rannsa09c1ff2019-02-04 01:10:30 -0800156u8 *
157format_ipsec_policy (u8 * s, va_list * args)
158{
159 u32 pi = va_arg (*args, u32);
Guillaume Solignac5f08ab62019-05-20 15:58:46 +0200160 ip46_type_t ip_type = IP46_TYPE_IP4;
Neale Rannsa09c1ff2019-02-04 01:10:30 -0800161 ipsec_main_t *im = &ipsec_main;
162 ipsec_policy_t *p;
163 vlib_counter_t counts;
164
165 p = pool_elt_at_index (im->policies, pi);
166
Neale Ranns9f231d42019-03-19 10:06:00 +0000167 s = format (s, " [%d] priority %d action %U type %U protocol ",
168 pi, p->priority,
169 format_ipsec_policy_action, p->policy,
170 format_ipsec_policy_type, p->type);
Neale Rannsa09c1ff2019-02-04 01:10:30 -0800171 if (p->protocol)
172 {
173 s = format (s, "%U", format_ip_protocol, p->protocol);
174 }
175 else
176 {
177 s = format (s, "any");
178 }
179 if (p->policy == IPSEC_POLICY_ACTION_PROTECT)
180 {
181 s = format (s, " sa %u", p->sa_id);
182 }
Guillaume Solignac5f08ab62019-05-20 15:58:46 +0200183 if (p->is_ipv6)
184 {
185 ip_type = IP46_TYPE_IP6;
186 }
Neale Ranns231c4692019-03-18 17:11:28 +0000187
188 s = format (s, "\n local addr range %U - %U port range %u - %u",
Guillaume Solignac5f08ab62019-05-20 15:58:46 +0200189 format_ip46_address, &p->laddr.start, ip_type,
190 format_ip46_address, &p->laddr.stop, ip_type,
Neale Rannsa4d24312019-07-10 13:46:21 +0000191 p->lport.start, p->lport.stop);
Neale Ranns231c4692019-03-18 17:11:28 +0000192 s = format (s, "\n remote addr range %U - %U port range %u - %u",
Guillaume Solignac5f08ab62019-05-20 15:58:46 +0200193 format_ip46_address, &p->raddr.start, ip_type,
194 format_ip46_address, &p->raddr.stop, ip_type,
Neale Rannsa4d24312019-07-10 13:46:21 +0000195 p->rport.start, p->rport.stop);
Neale Ranns231c4692019-03-18 17:11:28 +0000196
Neale Rannsa09c1ff2019-02-04 01:10:30 -0800197 vlib_get_combined_counter (&ipsec_spd_policy_counters, pi, &counts);
198 s = format (s, "\n packets %u bytes %u", counts.packets, counts.bytes);
199
200 return (s);
201}
202
203u8 *
204format_ipsec_spd (u8 * s, va_list * args)
205{
206 u32 si = va_arg (*args, u32);
207 ipsec_main_t *im = &ipsec_main;
208 ipsec_spd_t *spd;
209 u32 *i;
210
Neale Rannsb294f102019-04-03 13:17:50 +0000211 if (pool_is_free_index (im->spds, si))
212 {
213 s = format (s, "No such SPD index: %d", si);
214 goto done;
215 }
216
Neale Rannsa09c1ff2019-02-04 01:10:30 -0800217 spd = pool_elt_at_index (im->spds, si);
218
219 s = format (s, "spd %u", spd->id);
220
221#define _(v, n) \
222 s = format (s, "\n %s:", n); \
223 vec_foreach(i, spd->policies[IPSEC_SPD_POLICY_##v]) \
224 { \
225 s = format (s, "\n %U", format_ipsec_policy, *i); \
226 }
227 foreach_ipsec_spd_policy_type;
228#undef _
229
Neale Rannsb294f102019-04-03 13:17:50 +0000230done:
Neale Rannsa09c1ff2019-02-04 01:10:30 -0800231 return (s);
232}
233
Neale Ranns8d7c5022019-02-06 01:41:05 -0800234u8 *
235format_ipsec_key (u8 * s, va_list * args)
236{
237 ipsec_key_t *key = va_arg (*args, ipsec_key_t *);
238
239 return (format (s, "%U", format_hex_bytes, key->data, key->len));
240}
241
242uword
243unformat_ipsec_key (unformat_input_t * input, va_list * args)
244{
245 ipsec_key_t *key = va_arg (*args, ipsec_key_t *);
246 u8 *data;
247
248 if (unformat (input, "%U", unformat_hex_string, &data))
249 {
250 ipsec_mk_key (key, data, vec_len (data));
251 vec_free (data);
252 }
253 else
254 return 0;
255 return 1;
256}
257
258u8 *
Neale Rannse524d452019-02-19 15:22:46 +0000259format_ipsec_sa_flags (u8 * s, va_list * args)
260{
261 ipsec_sa_flags_t flags = va_arg (*args, int);
262
Neale Ranns41afb332019-07-16 06:19:35 -0700263#define _(v, f, str) if (flags & IPSEC_SA_FLAG_##f) s = format(s, "%s ", str);
Neale Rannse524d452019-02-19 15:22:46 +0000264 foreach_ipsec_sa_flags
265#undef _
266 return (s);
267}
268
269u8 *
Neale Ranns8d7c5022019-02-06 01:41:05 -0800270format_ipsec_sa (u8 * s, va_list * args)
271{
272 u32 sai = va_arg (*args, u32);
Neale Rannsb294f102019-04-03 13:17:50 +0000273 ipsec_format_flags_t flags = va_arg (*args, ipsec_format_flags_t);
Neale Ranns8d7c5022019-02-06 01:41:05 -0800274 ipsec_main_t *im = &ipsec_main;
Neale Rannseba31ec2019-02-17 18:04:27 +0000275 vlib_counter_t counts;
Neale Ranns8d7c5022019-02-06 01:41:05 -0800276 u32 tx_table_id;
277 ipsec_sa_t *sa;
278
Neale Rannsb294f102019-04-03 13:17:50 +0000279 if (pool_is_free_index (im->sad, sai))
280 {
281 s = format (s, "No such SA index: %d", sai);
282 goto done;
283 }
284
Neale Ranns8d7c5022019-02-06 01:41:05 -0800285 sa = pool_elt_at_index (im->sad, sai);
286
Neale Ranns41afb332019-07-16 06:19:35 -0700287 s = format (s, "[%d] sa %u (0x%x) spi %u (0x%08x) protocol:%s flags:[%U]",
Neale Ranns495d7ff2019-07-12 09:15:26 +0000288 sai, sa->id, sa->id, sa->spi, sa->spi,
Neale Rannse524d452019-02-19 15:22:46 +0000289 sa->protocol ? "esp" : "ah", format_ipsec_sa_flags, sa->flags);
Neale Rannsb294f102019-04-03 13:17:50 +0000290
291 if (!(flags & IPSEC_FORMAT_DETAIL))
292 goto done;
293
Neale Ranns495d7ff2019-07-12 09:15:26 +0000294 s = format (s, "\n locks %d", sa->node.fn_locks);
Neale Ranns80f6fd52019-04-16 02:41:34 +0000295 s = format (s, "\n salt 0x%x", clib_net_to_host_u32 (sa->salt));
Neale Rannsf62a8c02019-04-02 08:13:33 +0000296 s = format (s, "\n thread-indices [encrypt:%d decrypt:%d]",
297 sa->encrypt_thread_index, sa->decrypt_thread_index);
Neale Ranns00a44202019-03-21 16:36:28 +0000298 s = format (s, "\n seq %u seq-hi %u", sa->seq, sa->seq_hi);
299 s = format (s, "\n last-seq %u last-seq-hi %u window %U",
Neale Ranns8d7c5022019-02-06 01:41:05 -0800300 sa->last_seq, sa->last_seq_hi,
301 format_ipsec_replay_window, sa->replay_window);
Neale Rannsb64cd2c2019-04-16 16:21:57 -0700302 s = format (s, "\n crypto alg %U",
303 format_ipsec_crypto_alg, sa->crypto_alg);
Christian E. Hopps01d61e72019-09-27 14:43:22 -0400304 if (sa->crypto_alg && (flags & IPSEC_FORMAT_INSECURE))
Neale Rannsb64cd2c2019-04-16 16:21:57 -0700305 s = format (s, " key %U", format_ipsec_key, &sa->crypto_key);
Christian E. Hopps01d61e72019-09-27 14:43:22 -0400306 else
307 s = format (s, " key [redacted]");
Neale Rannsb64cd2c2019-04-16 16:21:57 -0700308 s = format (s, "\n integrity alg %U",
309 format_ipsec_integ_alg, sa->integ_alg);
Christian E. Hopps01d61e72019-09-27 14:43:22 -0400310 if (sa->integ_alg && (flags & IPSEC_FORMAT_INSECURE))
Neale Rannsb64cd2c2019-04-16 16:21:57 -0700311 s = format (s, " key %U", format_ipsec_key, &sa->integ_key);
Christian E. Hopps01d61e72019-09-27 14:43:22 -0400312 else
313 s = format (s, " key [redacted]");
Neale Rannsabc56602020-04-01 09:45:23 +0000314 s = format (s, "\n UDP:[src:%d dst:%d]",
315 clib_host_to_net_u16 (sa->udp_hdr.src_port),
316 clib_host_to_net_u16 (sa->udp_hdr.dst_port));
Neale Ranns80f6fd52019-04-16 02:41:34 +0000317
Neale Rannseba31ec2019-02-17 18:04:27 +0000318 vlib_get_combined_counter (&ipsec_sa_counters, sai, &counts);
319 s = format (s, "\n packets %u bytes %u", counts.packets, counts.bytes);
Neale Ranns8d7c5022019-02-06 01:41:05 -0800320
Damjan Mariond709cbc2019-03-26 13:16:42 +0100321 if (ipsec_sa_is_set_IS_TUNNEL (sa))
Neale Ranns8d7c5022019-02-06 01:41:05 -0800322 {
Neale Ranns03fabbd2021-01-19 13:30:23 +0000323 tx_table_id = fib_table_get_table_id (
324 sa->tx_fib_index,
325 (ipsec_sa_is_set_IS_TUNNEL_V6 (sa) ? FIB_PROTOCOL_IP6 :
326 FIB_PROTOCOL_IP4));
Neale Ranns041add72020-01-02 04:06:10 +0000327 s = format (s, "\n table-ID %d tunnel %U src %U dst %U flags %U",
Neale Ranns8d7c5022019-02-06 01:41:05 -0800328 tx_table_id,
Neale Ranns041add72020-01-02 04:06:10 +0000329 format_ip_dscp, sa->dscp,
Neale Ranns8d7c5022019-02-06 01:41:05 -0800330 format_ip46_address, &sa->tunnel_src_addr, IP46_TYPE_ANY,
Neale Ranns041add72020-01-02 04:06:10 +0000331 format_ip46_address, &sa->tunnel_dst_addr, IP46_TYPE_ANY,
332 format_tunnel_encap_decap_flags, sa->tunnel_flags);
Neale Ranns2b5ba952019-04-02 10:15:40 +0000333 if (!ipsec_sa_is_set_IS_INBOUND (sa))
334 {
335 s =
336 format (s, "\n resovle via fib-entry: %d",
337 sa->fib_entry_index);
338 s = format (s, "\n stacked on:");
Neale Ranns72f2a3a2019-06-17 15:43:38 +0000339 s = format (s, "\n %U", format_dpo_id, &sa->dpo, 6);
Neale Ranns2b5ba952019-04-02 10:15:40 +0000340 }
Neale Ranns8d7c5022019-02-06 01:41:05 -0800341 }
342
Neale Rannsb294f102019-04-03 13:17:50 +0000343done:
344 return (s);
345}
346
347u8 *
Neale Ranns28287212019-12-16 00:53:11 +0000348format_ipsec_tun_protect_index (u8 * s, va_list * args)
349{
350 u32 itpi = va_arg (*args, index_t);
351 ipsec_tun_protect_t *itp;
352
353 if (pool_is_free_index (ipsec_tun_protect_pool, itpi))
354 return (format (s, "No such tunnel index: %d", itpi));
355
356 itp = pool_elt_at_index (ipsec_tun_protect_pool, itpi);
357
358 return (format (s, "%U", format_ipsec_tun_protect, itp));
359}
360
Neale Rannsdd4ccf22020-06-30 07:47:14 +0000361u8 *
362format_ipsec_tun_protect_flags (u8 * s, va_list * args)
363{
364 ipsec_protect_flags_t flags = va_arg (*args, int);
365
366 if (IPSEC_PROTECT_NONE == flags)
367 s = format (s, "none");
368#define _(a,b,c) \
369 else if (flags & IPSEC_PROTECT_##a) \
370 s = format (s, "%s", c); \
371 foreach_ipsec_protect_flags
372#undef _
373
374 return (s);
375}
Neale Ranns28287212019-12-16 00:53:11 +0000376
377u8 *
Neale Rannsc87b66c2019-02-07 07:26:12 -0800378format_ipsec_tun_protect (u8 * s, va_list * args)
379{
Neale Ranns28287212019-12-16 00:53:11 +0000380 ipsec_tun_protect_t *itp = va_arg (*args, ipsec_tun_protect_t *);
Neale Rannsc87b66c2019-02-07 07:26:12 -0800381 u32 sai;
382
Neale Rannsdd4ccf22020-06-30 07:47:14 +0000383 s = format (s, "%U flags:[%U]", format_vnet_sw_if_index_name,
384 vnet_get_main (), itp->itp_sw_if_index,
385 format_ipsec_tun_protect_flags, itp->itp_flags);
Neale Ranns28287212019-12-16 00:53:11 +0000386 if (!ip_address_is_zero (itp->itp_key))
387 s = format (s, ": %U", format_ip_address, itp->itp_key);
Neale Rannsc87b66c2019-02-07 07:26:12 -0800388 s = format (s, "\n output-sa:");
Neale Ranns28287212019-12-16 00:53:11 +0000389 s = format (s, "\n %U", format_ipsec_sa, itp->itp_out_sa,
390 IPSEC_FORMAT_BRIEF);
Neale Rannsc87b66c2019-02-07 07:26:12 -0800391
392 s = format (s, "\n input-sa:");
393 /* *INDENT-OFF* */
394 FOR_EACH_IPSEC_PROTECT_INPUT_SAI(itp, sai,
395 ({
396 s = format (s, "\n %U", format_ipsec_sa, sai, IPSEC_FORMAT_BRIEF);
397 }));
398 /* *INDENT-ON* */
399
Neale Rannsc87b66c2019-02-07 07:26:12 -0800400 return (s);
401}
402
Neale Ranns41afb332019-07-16 06:19:35 -0700403u8 *
Neale Ranns7b4e52f2020-05-24 16:17:50 +0000404format_ipsec4_tunnel_kv (u8 * s, va_list * args)
Neale Ranns41afb332019-07-16 06:19:35 -0700405{
Neale Ranns7b4e52f2020-05-24 16:17:50 +0000406 ipsec4_tunnel_kv_t *kv = va_arg (*args, ipsec4_tunnel_kv_t *);
407 ip4_address_t ip;
408 u32 spi;
Neale Ranns41afb332019-07-16 06:19:35 -0700409
Neale Ranns7b4e52f2020-05-24 16:17:50 +0000410 ipsec4_tunnel_extract_key (kv, &ip, &spi);
411
412 s = format (s, "remote:%U spi:%u (0x%08x) sa:%d tun:%d",
413 format_ip4_address, &ip,
414 clib_net_to_host_u32 (spi),
415 clib_net_to_host_u32 (spi),
416 kv->value.sa_index, kv->value.tun_index);
Neale Ranns41afb332019-07-16 06:19:35 -0700417
418 return (s);
419}
420
421u8 *
Neale Ranns7b4e52f2020-05-24 16:17:50 +0000422format_ipsec6_tunnel_kv (u8 * s, va_list * args)
Neale Ranns41afb332019-07-16 06:19:35 -0700423{
Neale Ranns7b4e52f2020-05-24 16:17:50 +0000424 ipsec6_tunnel_kv_t *kv = va_arg (*args, ipsec6_tunnel_kv_t *);
Neale Ranns41afb332019-07-16 06:19:35 -0700425
Neale Ranns7b4e52f2020-05-24 16:17:50 +0000426 s = format (s, "remote:%U spi:%u (0x%08x) sa:%d tun:%d",
427 format_ip6_address, &kv->key.remote_ip,
428 clib_net_to_host_u32 (kv->key.spi),
429 clib_net_to_host_u32 (kv->key.spi),
430 kv->value.sa_index, kv->value.tun_index);
Neale Ranns41afb332019-07-16 06:19:35 -0700431
432 return (s);
433}
434
Neale Ranns6ba4e412020-10-19 09:59:41 +0000435u8 *
436format_ipsec_itf (u8 * s, va_list * a)
437{
438 index_t ii = va_arg (*a, index_t);
439 ipsec_itf_t *itf;
440
441 itf = ipsec_itf_get (ii);
442 s = format (s, "[%d] %U %U",
443 ii, format_vnet_sw_if_index_name, vnet_get_main (),
444 itf->ii_sw_if_index, format_tunnel_mode, itf->ii_mode);
445
446 return (s);
447}
448
Keith Burns (alagalah)166a9d42016-08-06 11:00:56 -0700449/*
450 * fd.io coding-style-patch-verification: ON
451 *
452 * Local Variables:
453 * eval: (c-set-style "gnu")
454 * End:
455 */