FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
ipsec_cli.c
Go to the documentation of this file.
1 /*
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>
22 #include <vnet/fib/fib.h>
23 #include <vnet/ipip/ipip.h>
24 
25 #include <vnet/ipsec/ipsec.h>
26 #include <vnet/ipsec/ipsec_tun.h>
27 
28 static clib_error_t *
30  unformat_input_t * input,
31  vlib_cli_command_t * cmd)
32 {
33  unformat_input_t _line_input, *line_input = &_line_input;
35  u32 sw_if_index = (u32) ~ 0;
36  u32 spd_id;
37  int is_add = 1;
38  clib_error_t *error = NULL;
39  int err;
40 
41  if (!unformat_user (input, unformat_line_input, line_input))
42  return 0;
43 
44  if (unformat
45  (line_input, "%U %u", unformat_vnet_sw_interface, im->vnet_main,
46  &sw_if_index, &spd_id))
47  ;
48  else if (unformat (line_input, "del"))
49  is_add = 0;
50  else
51  {
52  error = clib_error_return (0, "parse error: '%U'",
53  format_unformat_error, line_input);
54  goto done;
55  }
56 
57  err = ipsec_set_interface_spd (vm, sw_if_index, spd_id, is_add);
58  switch (err)
59  {
60  case VNET_API_ERROR_SYSCALL_ERROR_1:
61  error = clib_error_return (0, "no such spd-id");
62  break;
63  case VNET_API_ERROR_SYSCALL_ERROR_2:
64  error = clib_error_return (0, "spd already assigned");
65  break;
66  }
67 
68 done:
69  unformat_free (line_input);
70 
71  return error;
72 }
73 
74 /* *INDENT-OFF* */
76  .path = "set interface ipsec spd",
77  .short_help =
78  "set interface ipsec spd <int> <id>",
79  .function = set_interface_spd_command_fn,
80 };
81 /* *INDENT-ON* */
82 
83 static clib_error_t *
85  unformat_input_t * input,
86  vlib_cli_command_t * cmd)
87 {
88  unformat_input_t _line_input, *line_input = &_line_input;
89  ipsec_crypto_alg_t crypto_alg;
90  ipsec_integ_alg_t integ_alg;
91  ipsec_protocol_t proto;
94  ipsec_key_t ck = { 0 };
95  ipsec_key_t ik = { 0 };
96  u32 id, spi, salt, sai;
97  int i = 0;
98  u16 udp_src, udp_dst;
99  int is_add, rv;
100  u32 m_args = 0;
101  tunnel_t tun = {};
102 
103  salt = 0;
104  error = NULL;
105  is_add = 0;
106  flags = IPSEC_SA_FLAG_NONE;
108  integ_alg = IPSEC_INTEG_ALG_NONE;
109  crypto_alg = IPSEC_CRYPTO_ALG_NONE;
110  udp_src = udp_dst = IPSEC_UDP_PORT_NONE;
111 
112  if (!unformat_user (input, unformat_line_input, line_input))
113  return 0;
114 
115  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
116  {
117  if (unformat (line_input, "add %u", &id))
118  {
119  is_add = 1;
120  m_args |= 1 << 0;
121  }
122  else if (unformat (line_input, "del %u", &id))
123  {
124  is_add = 0;
125  m_args |= 1 << 0;
126  }
127  else if (unformat (line_input, "spi %u", &spi))
128  m_args |= 1 << 1;
129  else if (unformat (line_input, "salt 0x%x", &salt))
130  ;
131  else if (unformat (line_input, "esp"))
133  else if (unformat (line_input, "ah"))
135  else if (unformat (line_input, "crypto-key %U",
136  unformat_ipsec_key, &ck))
137  ;
138  else if (unformat (line_input, "crypto-alg %U",
139  unformat_ipsec_crypto_alg, &crypto_alg))
140  ;
141  else if (unformat (line_input, "integ-key %U", unformat_ipsec_key, &ik))
142  ;
143  else if (unformat (line_input, "integ-alg %U",
145  ;
146  else if (unformat (line_input, " %U", unformat_tunnel, &tun))
147  {
148  flags |= IPSEC_SA_FLAG_IS_TUNNEL;
149  if (AF_IP6 == tunnel_get_af (&tun))
150  flags |= IPSEC_SA_FLAG_IS_TUNNEL_V6;
151  }
152  else if (unformat (line_input, "udp-src-port %d", &i))
153  udp_src = i;
154  else if (unformat (line_input, "udp-dst-port %d", &i))
155  udp_dst = i;
156  else if (unformat (line_input, "inbound"))
157  flags |= IPSEC_SA_FLAG_IS_INBOUND;
158  else if (unformat (line_input, "use-anti-replay"))
159  flags |= IPSEC_SA_FLAG_USE_ANTI_REPLAY;
160  else if (unformat (line_input, "use-esn"))
161  flags |= IPSEC_SA_FLAG_USE_ESN;
162  else if (unformat (line_input, "udp-encap"))
163  flags |= IPSEC_SA_FLAG_UDP_ENCAP;
164  else if (unformat (line_input, "async"))
165  flags |= IPSEC_SA_FLAG_IS_ASYNC;
166  else
167  {
168  error = clib_error_return (0, "parse error: '%U'",
169  format_unformat_error, line_input);
170  goto done;
171  }
172  }
173 
174  if (!(m_args & 1))
175  {
176  error = clib_error_return (0, "missing id");
177  goto done;
178  }
179 
180  if (is_add)
181  {
182  if (!(m_args & 2))
183  {
184  error = clib_error_return (0, "missing spi");
185  goto done;
186  }
187  rv = ipsec_sa_add_and_lock (id, spi, proto, crypto_alg, &ck, integ_alg,
188  &ik, flags, clib_host_to_net_u32 (salt),
189  udp_src, udp_dst, &tun, &sai);
190  }
191  else
192  {
193  rv = ipsec_sa_unlock_id (id);
194  }
195 
196  if (rv)
197  error = clib_error_return (0, "failed: %d", rv);
198 
199 done:
200  unformat_free (line_input);
201 
202  return error;
203 }
204 
205 /* *INDENT-OFF* */
207  .path = "ipsec sa",
208  .short_help =
209  "ipsec sa [add|del]",
210  .function = ipsec_sa_add_del_command_fn,
211 };
212 /* *INDENT-ON* */
213 
214 static clib_error_t *
216  unformat_input_t * input,
217  vlib_cli_command_t * cmd)
218 {
219  unformat_input_t _line_input, *line_input = &_line_input;
220  u32 spd_id = ~0;
221  int is_add = ~0;
222  clib_error_t *error = NULL;
223 
224  if (!unformat_user (input, unformat_line_input, line_input))
225  return 0;
226 
227  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
228  {
229  if (unformat (line_input, "add"))
230  is_add = 1;
231  else if (unformat (line_input, "del"))
232  is_add = 0;
233  else if (unformat (line_input, "%u", &spd_id))
234  ;
235  else
236  {
237  error = clib_error_return (0, "parse error: '%U'",
238  format_unformat_error, line_input);
239  goto done;
240  }
241  }
242 
243  if (spd_id == ~0)
244  {
245  error = clib_error_return (0, "please specify SPD ID");
246  goto done;
247  }
248 
249  ipsec_add_del_spd (vm, spd_id, is_add);
250 
251 done:
252  unformat_free (line_input);
253 
254  return error;
255 }
256 
257 /* *INDENT-OFF* */
259  .path = "ipsec spd",
260  .short_help =
261  "ipsec spd [add|del] <id>",
262  .function = ipsec_spd_add_del_command_fn,
263 };
264 /* *INDENT-ON* */
265 
266 
267 static clib_error_t *
269  unformat_input_t * input,
270  vlib_cli_command_t * cmd)
271 {
272  unformat_input_t _line_input, *line_input = &_line_input;
273  ipsec_policy_t p;
274  int rv, is_add = 0;
275  u32 tmp, tmp2, stat_index, local_range_set, remote_range_set;
276  clib_error_t *error = NULL;
278 
279  clib_memset (&p, 0, sizeof (p));
280  p.lport.stop = p.rport.stop = ~0;
281  remote_range_set = local_range_set = is_outbound = 0;
282 
283  if (!unformat_user (input, unformat_line_input, line_input))
284  return 0;
285 
286  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
287  {
288  if (unformat (line_input, "add"))
289  is_add = 1;
290  else if (unformat (line_input, "del"))
291  is_add = 0;
292  else if (unformat (line_input, "ip6"))
293  p.is_ipv6 = 1;
294  else if (unformat (line_input, "spd %u", &p.id))
295  ;
296  else if (unformat (line_input, "inbound"))
297  is_outbound = 0;
298  else if (unformat (line_input, "outbound"))
299  is_outbound = 1;
300  else if (unformat (line_input, "priority %d", &p.priority))
301  ;
302  else if (unformat (line_input, "protocol %u", &tmp))
303  p.protocol = (u8) tmp;
304  else
305  if (unformat
306  (line_input, "action %U", unformat_ipsec_policy_action,
307  &p.policy))
308  {
309  if (p.policy == IPSEC_POLICY_ACTION_RESOLVE)
310  {
311  error = clib_error_return (0, "unsupported action: 'resolve'");
312  goto done;
313  }
314  }
315  else if (unformat (line_input, "sa %u", &p.sa_id))
316  ;
317  else if (unformat (line_input, "local-ip-range %U - %U",
320  local_range_set = 1;
321  else if (unformat (line_input, "remote-ip-range %U - %U",
324  remote_range_set = 1;
325  else if (unformat (line_input, "local-ip-range %U - %U",
328  {
329  p.is_ipv6 = 1;
330  local_range_set = 1;
331  }
332  else if (unformat (line_input, "remote-ip-range %U - %U",
335  {
336  p.is_ipv6 = 1;
337  remote_range_set = 1;
338  }
339  else if (unformat (line_input, "local-port-range %u - %u", &tmp, &tmp2))
340  {
341  p.lport.start = tmp;
342  p.lport.stop = tmp2;
343  }
344  else
345  if (unformat (line_input, "remote-port-range %u - %u", &tmp, &tmp2))
346  {
347  p.rport.start = tmp;
348  p.rport.stop = tmp2;
349  }
350  else
351  {
352  error = clib_error_return (0, "parse error: '%U'",
353  format_unformat_error, line_input);
354  goto done;
355  }
356  }
357 
358  if (!remote_range_set)
359  {
360  if (p.is_ipv6)
361  clib_memset (&p.raddr.stop.ip6, 0xff, 16);
362  else
363  clib_memset (&p.raddr.stop.ip4, 0xff, 4);
364  }
365  if (!local_range_set)
366  {
367  if (p.is_ipv6)
368  clib_memset (&p.laddr.stop.ip6, 0xff, 16);
369  else
370  clib_memset (&p.laddr.stop.ip4, 0xff, 4);
371  }
372 
374 
375  if (rv)
376  {
377  error = clib_error_return (0, "unsupported policy type for:",
378  " outboud:%s %s action:%U",
379  (is_outbound ? "yes" : "no"),
380  (p.is_ipv6 ? "IPv4" : "IPv6"),
382  goto done;
383  }
384 
385  rv = ipsec_add_del_policy (vm, &p, is_add, &stat_index);
386 
387  if (!rv)
388  vlib_cli_output (vm, "policy-index:%d", stat_index);
389  else
390  vlib_cli_output (vm, "error:%d", rv);
391 
392 done:
393  unformat_free (line_input);
394 
395  return error;
396 }
397 
398 /* *INDENT-OFF* */
400  .path = "ipsec policy",
401  .short_help =
402  "ipsec policy [add|del] spd <id> priority <n> ",
404 };
405 /* *INDENT-ON* */
406 
407 static void
409 {
410  u32 sai;
411 
412  /* *INDENT-OFF* */
414  {
415  vlib_cli_output (vm, "%U", format_ipsec_sa, sai,
417  }
418  /* *INDENT-ON* */
419 }
420 
421 static void
423 {
424  u32 spdi;
425 
426  /* *INDENT-OFF* */
427  pool_foreach_index (spdi, im->spds) {
428  vlib_cli_output(vm, "%U", format_ipsec_spd, spdi);
429  }
430  /* *INDENT-ON* */
431 }
432 
433 static void
435 {
436  u32 spd_id, sw_if_index;
437  ipsec_spd_t *spd;
438 
439  vlib_cli_output (vm, "SPD Bindings:");
440 
441  /* *INDENT-OFF* */
442  hash_foreach(sw_if_index, spd_id, im->spd_index_by_sw_if_index, ({
443  spd = pool_elt_at_index (im->spds, spd_id);
444  vlib_cli_output (vm, " %d -> %U", spd->id,
445  format_vnet_sw_if_index_name, im->vnet_main,
446  sw_if_index);
447  }));
448  /* *INDENT-ON* */
449 }
450 
451 static walk_rc_t
453 {
455 
456  return (WALK_CONTINUE);
457 }
458 
459 static void
461 {
463 }
464 
465 static clib_error_t *
467  unformat_input_t * input, vlib_cli_command_t * cmd)
468 {
470 
471  ipsec_sa_show_all (vm, im, 0);
475 
476  vlib_cli_output (vm, "IPSec async mode: %s",
477  (im->async_mode ? "on" : "off"));
478 
479  return 0;
480 }
481 
482 /* *INDENT-OFF* */
484  .path = "show ipsec all",
485  .short_help = "show ipsec all",
486  .function = show_ipsec_command_fn,
487 };
488 /* *INDENT-ON* */
489 
490 static clib_error_t *
492  unformat_input_t * input, vlib_cli_command_t * cmd)
493 {
495  u32 sai = ~0;
496  u8 detail = 0;
497 
499  {
500  if (unformat (input, "%u", &sai))
501  ;
502  if (unformat (input, "detail"))
503  detail = 1;
504  else
505  break;
506  }
507 
508  if (~0 == sai)
509  ipsec_sa_show_all (vm, im, detail);
510  else
511  vlib_cli_output (vm, "%U", format_ipsec_sa, sai,
513 
514  return 0;
515 }
516 
517 static clib_error_t *
519  unformat_input_t * input, vlib_cli_command_t * cmd)
520 {
521  u32 sai = ~0;
522 
524  {
525  if (unformat (input, "%u", &sai))
526  ;
527  else
528  break;
529  }
530 
531  if (~0 == sai)
532  {
533  /* *INDENT-OFF* */
535  {
536  ipsec_sa_clear (sai);
537  }
538  /* *INDENT-ON* */
539  }
540  else
541  {
543  return clib_error_return (0, "unknown SA index: %d", sai);
544  else
545  ipsec_sa_clear (sai);
546  }
547 
548  return 0;
549 }
550 
551 /* *INDENT-OFF* */
553  .path = "show ipsec sa",
554  .short_help = "show ipsec sa [index]",
555  .function = show_ipsec_sa_command_fn,
556 };
557 
559  .path = "clear ipsec sa",
560  .short_help = "clear ipsec sa [index]",
561  .function = clear_ipsec_sa_command_fn,
562 };
563 /* *INDENT-ON* */
564 
565 static clib_error_t *
567  unformat_input_t * input, vlib_cli_command_t * cmd)
568 {
570  u8 show_bindings = 0;
571  u32 spdi = ~0;
572 
574  {
575  if (unformat (input, "%u", &spdi))
576  ;
577  else if (unformat (input, "bindings"))
578  show_bindings = 1;
579  else
580  break;
581  }
582 
583  if (show_bindings)
585  else if (~0 != spdi)
586  vlib_cli_output (vm, "%U", format_ipsec_spd, spdi);
587  else
589 
590  return 0;
591 }
592 
593 /* *INDENT-OFF* */
595  .path = "show ipsec spd",
596  .short_help = "show ipsec spd [index]",
597  .function = show_ipsec_spd_command_fn,
598 };
599 /* *INDENT-ON* */
600 
601 static clib_error_t *
603  unformat_input_t * input,
604  vlib_cli_command_t * cmd)
605 {
607 
608  return 0;
609 }
610 
611 /* *INDENT-OFF* */
613  .path = "show ipsec tunnel",
614  .short_help = "show ipsec tunnel",
615  .function = show_ipsec_tunnel_command_fn,
616 };
617 /* *INDENT-ON* */
618 
619 static clib_error_t *
621  unformat_input_t * input,
622  vlib_cli_command_t * cmd)
623 {
625  u32 verbose = 0;
626 
627  (void) unformat (input, "verbose %u", &verbose);
628 
629  vlib_cli_output (vm, "IPsec AH backends available:");
630  u8 *s = format (NULL, "%=25s %=25s %=10s\n", "Name", "Index", "Active");
631  ipsec_ah_backend_t *ab;
632  /* *INDENT-OFF* */
633  pool_foreach (ab, im->ah_backends) {
634  s = format (s, "%=25s %=25u %=10s\n", ab->name, ab - im->ah_backends,
635  ab - im->ah_backends == im->ah_current_backend ? "yes" : "no");
636  if (verbose) {
637  vlib_node_t *n;
639  s = format (s, " enc4 %s (next %d)\n", n->name, ab->ah4_encrypt_next_index);
641  s = format (s, " dec4 %s (next %d)\n", n->name, ab->ah4_decrypt_next_index);
643  s = format (s, " enc6 %s (next %d)\n", n->name, ab->ah6_encrypt_next_index);
645  s = format (s, " dec6 %s (next %d)\n", n->name, ab->ah6_decrypt_next_index);
646  }
647  }
648  /* *INDENT-ON* */
649  vlib_cli_output (vm, "%v", s);
650  _vec_len (s) = 0;
651  vlib_cli_output (vm, "IPsec ESP backends available:");
652  s = format (s, "%=25s %=25s %=10s\n", "Name", "Index", "Active");
654  /* *INDENT-OFF* */
655  pool_foreach (eb, im->esp_backends) {
656  s = format (s, "%=25s %=25u %=10s\n", eb->name, eb - im->esp_backends,
657  eb - im->esp_backends == im->esp_current_backend ? "yes"
658  : "no");
659  if (verbose) {
660  vlib_node_t *n;
662  s = format (s, " enc4 %s (next %d)\n", n->name, eb->esp4_encrypt_next_index);
664  s = format (s, " dec4 %s (next %d)\n", n->name, eb->esp4_decrypt_next_index);
666  s = format (s, " enc6 %s (next %d)\n", n->name, eb->esp6_encrypt_next_index);
668  s = format (s, " dec6 %s (next %d)\n", n->name, eb->esp6_decrypt_next_index);
669  }
670  }
671  /* *INDENT-ON* */
672  vlib_cli_output (vm, "%v", s);
673 
674  vec_free (s);
675  return 0;
676 }
677 
678 /* *INDENT-OFF* */
680  .path = "show ipsec backends",
681  .short_help = "show ipsec backends",
682  .function = ipsec_show_backends_command_fn,
683 };
684 /* *INDENT-ON* */
685 
686 static clib_error_t *
688  unformat_input_t * input,
689  vlib_cli_command_t * cmd)
690 {
691  unformat_input_t _line_input, *line_input = &_line_input;
694  u32 backend_index;
695 
697 
698  if (error)
699  return error;
700 
701  /* Get a line of input. */
702  if (!unformat_user (input, unformat_line_input, line_input))
703  return 0;
704 
705  if (unformat (line_input, "ah"))
706  {
707  if (unformat (line_input, "%u", &backend_index))
708  {
709  if (ipsec_select_ah_backend (im, backend_index) < 0)
710  {
711  return clib_error_return (0, "Invalid AH backend index `%u'",
712  backend_index);
713  }
714  }
715  else
716  {
717  return clib_error_return (0, "Invalid backend index `%U'",
718  format_unformat_error, line_input);
719  }
720  }
721  else if (unformat (line_input, "esp"))
722  {
723  if (unformat (line_input, "%u", &backend_index))
724  {
725  if (ipsec_select_esp_backend (im, backend_index) < 0)
726  {
727  return clib_error_return (0, "Invalid ESP backend index `%u'",
728  backend_index);
729  }
730  }
731  else
732  {
733  return clib_error_return (0, "Invalid backend index `%U'",
734  format_unformat_error, line_input);
735  }
736  }
737  else
738  {
739  return clib_error_return (0, "Unknown input `%U'",
740  format_unformat_error, line_input);
741  }
742 
743  return 0;
744 }
745 
746 /* *INDENT-OFF* */
748  .path = "ipsec select backend",
749  .short_help = "ipsec select backend <ah|esp> <backend index>",
751 };
752 
753 /* *INDENT-ON* */
754 
755 static clib_error_t *
757  unformat_input_t * input,
758  vlib_cli_command_t * cmd)
759 {
762 
763  return (NULL);
764 }
765 
766 /* *INDENT-OFF* */
768  .path = "clear ipsec counters",
769  .short_help = "clear ipsec counters",
771 };
772 /* *INDENT-ON* */
773 
774 static clib_error_t *
776  unformat_input_t * input, vlib_cli_command_t * cmd)
777 {
778  unformat_input_t _line_input, *line_input = &_line_input;
779  u32 sw_if_index, is_del, sa_in, sa_out, *sa_ins = NULL;
780  ip_address_t peer = { };
781  vnet_main_t *vnm;
782 
783  is_del = 0;
784  sw_if_index = ~0;
785  vnm = vnet_get_main ();
786 
787  if (!unformat_user (input, unformat_line_input, line_input))
788  return 0;
789 
790  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
791  {
792  if (unformat (line_input, "del"))
793  is_del = 1;
794  else if (unformat (line_input, "add"))
795  is_del = 0;
796  else if (unformat (line_input, "sa-in %d", &sa_in))
797  vec_add1 (sa_ins, sa_in);
798  else if (unformat (line_input, "sa-out %d", &sa_out))
799  ;
800  else if (unformat (line_input, "%U",
802  ;
803  else if (unformat (line_input, "%U", unformat_ip_address, &peer))
804  ;
805  else
806  return (clib_error_return (0, "unknown input '%U'",
807  format_unformat_error, line_input));
808  }
809 
810  if (!is_del)
812  else
814 
815  unformat_free (line_input);
816  return NULL;
817 }
818 
819 /**
820  * Protect tunnel with IPSEC
821  */
822 /* *INDENT-OFF* */
824 {
825  .path = "ipsec tunnel protect",
826  .function = ipsec_tun_protect_cmd,
827  .short_help = "ipsec tunnel protect <interface> input-sa <SA> output-sa <SA> [add|del]",
828  // this is not MP safe
829 };
830 /* *INDENT-ON* */
831 
832 
833 static clib_error_t *
835  unformat_input_t * input, vlib_cli_command_t * cmd)
836 {
838 
839  return NULL;
840 }
841 
842 /**
843  * show IPSEC tunnel protection
844  */
845 /* *INDENT-OFF* */
847 {
848  .path = "show ipsec protect",
849  .function = ipsec_tun_protect_show,
850  .short_help = "show ipsec protect",
851 };
852 /* *INDENT-ON* */
853 
854 static int
856 {
858  vlib_main_t *vm = arg;
859 
861 
862  return (BIHASH_WALK_CONTINUE);
863 }
864 
865 static int
867 {
869  vlib_main_t *vm = arg;
870 
872 
873  return (BIHASH_WALK_CONTINUE);
874 }
875 
876 static clib_error_t *
878  unformat_input_t * input,
879  vlib_cli_command_t * cmd)
880 {
882 
883  {
884  vlib_cli_output (vm, "IPv4:");
885 
886  clib_bihash_foreach_key_value_pair_8_16
887  (&im->tun4_protect_by_key, ipsec_tun_protect4_hash_show_one, vm);
888 
889  vlib_cli_output (vm, "IPv6:");
890 
891  clib_bihash_foreach_key_value_pair_24_16
892  (&im->tun6_protect_by_key, ipsec_tun_protect6_hash_show_one, vm);
893  }
894 
895  return NULL;
896 }
897 
898 /**
899  * show IPSEC tunnel protection hash tables
900  */
901 /* *INDENT-OFF* */
903 {
904  .path = "show ipsec protect-hash",
905  .function = ipsec_tun_protect_hash_show,
906  .short_help = "show ipsec protect-hash",
907 };
908 /* *INDENT-ON* */
909 
910 clib_error_t *
912 {
913  return 0;
914 }
915 
917 
918 static clib_error_t *
920  vlib_cli_command_t * cmd)
921 {
922  unformat_input_t _line_input, *line_input = &_line_input;
923  int async_enable = 0;
924 
925  if (!unformat_user (input, unformat_line_input, line_input))
926  return 0;
927 
928  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
929  {
930  if (unformat (line_input, "on"))
931  async_enable = 1;
932  else if (unformat (line_input, "off"))
933  async_enable = 0;
934  else
935  return (clib_error_return (0, "unknown input '%U'",
936  format_unformat_error, line_input));
937  }
938 
939  ipsec_set_async_mode (async_enable);
940 
941  unformat_free (line_input);
942  return (NULL);
943 }
944 
945 /* *INDENT-OFF* */
947  .path = "set ipsec async mode",
948  .short_help = "set ipsec async mode on|off",
949  .function = set_async_mode_command_fn,
950 };
951 /* *INDENT-ON* */
952 
953 /*
954  * fd.io coding-style-patch-verification: ON
955  *
956  * Local Variables:
957  * eval: (c-set-style "gnu")
958  * End:
959  */
show_ipsec_tunnel_command_fn
static clib_error_t * show_ipsec_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:602
ipsec_ah_backend_t::ah4_decrypt_next_index
u32 ah4_decrypt_next_index
Definition: ipsec.h:47
ipsec.h
ip_address
Definition: ip_types.h:79
tmp
u32 * tmp
Definition: interface_output.c:1096
ipsec_tun_protect_hash_show
static clib_error_t * ipsec_tun_protect_hash_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:877
ipsec_esp_backend_t::esp6_decrypt_node_index
u32 esp6_decrypt_node_index
Definition: ipsec.h:68
im
vnet_interface_main_t * im
Definition: interface_output.c:415
fib.h
ipsec_tun.h
tunnel_get_af
ip_address_family_t tunnel_get_af(const tunnel_t *t)
Definition: tunnel.c:125
ipsec_add_del_spd
int ipsec_add_del_spd(vlib_main_t *vm, u32 spd_id, int is_add)
Add/Delete a SPD.
Definition: ipsec_spd.c:20
unformat_user
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:989
WALK_CONTINUE
@ WALK_CONTINUE
Definition: interface_funcs.h:174
ipsec_policy_t_::priority
i32 priority
Definition: ipsec_spd_policy.h:57
unformat_ipsec_key
uword unformat_ipsec_key(unformat_input_t *input, va_list *args)
Definition: ipsec_format.c:243
port_range_t::stop
u16 stop
Definition: ipsec_spd_policy.h:42
ipsec_ah_backend_t::ah4_decrypt_node_index
u32 ah4_decrypt_node_index
Definition: ipsec.h:45
ipsec_esp_backend_t::esp6_decrypt_next_index
u32 esp6_decrypt_next_index
Definition: ipsec.h:70
show_ipsec_command
static vlib_cli_command_t show_ipsec_command
(constructor) VLIB_CLI_COMMAND (show_ipsec_command)
Definition: ipsec_cli.c:483
ipsec_policy_t_::raddr
ip46_address_range_t raddr
Definition: ipsec_spd_policy.h:65
ipsec_tun_protect4_hash_show_one
static int ipsec_tun_protect4_hash_show_one(clib_bihash_kv_8_16_t *kv, void *arg)
Definition: ipsec_cli.c:855
unformat_line_input
unformat_function_t unformat_line_input
Definition: format.h:275
tunnel_t_
A representation of an IP tunnel config.
Definition: tunnel.h:85
vlib_clear_combined_counters
void vlib_clear_combined_counters(vlib_combined_counter_main_t *cm)
Clear a collection of combined counters.
Definition: counter.c:61
clear_ipsec_sa_command_fn
static clib_error_t * clear_ipsec_sa_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:518
ipsec_ah_backend_t::ah4_encrypt_next_index
u32 ah4_encrypt_next_index
Definition: ipsec.h:46
show_ipsec_tunnel_command
static vlib_cli_command_t show_ipsec_tunnel_command
(constructor) VLIB_CLI_COMMAND (show_ipsec_tunnel_command)
Definition: ipsec_cli.c:612
ipsec_tunnel_show_all
static void ipsec_tunnel_show_all(vlib_main_t *vm)
Definition: ipsec_cli.c:460
clib_error_return
#define clib_error_return(e, args...)
Definition: error.h:99
u8
#define u8
Padding.
Definition: clib.h:121
vlib_cli_command_t::path
char * path
Definition: cli.h:96
ipsec_esp_backend_t::esp4_decrypt_node_index
u32 esp4_decrypt_node_index
Definition: ipsec.h:64
show_ipsec_spd_command
static vlib_cli_command_t show_ipsec_spd_command
(constructor) VLIB_CLI_COMMAND (show_ipsec_spd_command)
Definition: ipsec_cli.c:594
ipsec_cli_init
clib_error_t * ipsec_cli_init(vlib_main_t *vm)
Definition: ipsec_cli.c:911
hash_foreach
#define hash_foreach(key_var, value_var, h, body)
Definition: hash.h:441
u16
unsigned short u16
Definition: types.h:57
unformat_tunnel
uword unformat_tunnel(unformat_input_t *input, va_list *args)
Definition: tunnel.c:168
format_ipsec_tun_protect_index
u8 * format_ipsec_tun_protect_index(u8 *s, va_list *args)
Definition: ipsec_format.c:325
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
ipsec_set_interface_spd
int ipsec_set_interface_spd(vlib_main_t *vm, u32 sw_if_index, u32 spd_id, int is_add)
Bind/attach a SPD to an interface.
Definition: ipsec_spd.c:63
ipsec_tun_protect_show
static clib_error_t * ipsec_tun_protect_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:834
sa_out
u32 sa_out
Definition: ipsec.api:298
ipsec_spd_bindings_show_all
static void ipsec_spd_bindings_show_all(vlib_main_t *vm, ipsec_main_t *im)
Definition: ipsec_cli.c:434
IPSEC_PROTOCOL_ESP
@ IPSEC_PROTOCOL_ESP
Definition: ipsec_sa.h:76
format_ipsec4_tunnel_kv
u8 * format_ipsec4_tunnel_kv(u8 *s, va_list *args)
Definition: ipsec_format.c:381
ipsec_esp_backend_t::esp4_encrypt_node_index
u32 esp4_encrypt_node_index
Definition: ipsec.h:63
unformat_input_t
struct _unformat_input_t unformat_input_t
ipsec_spd_add_del_command
static vlib_cli_command_t ipsec_spd_add_del_command
(constructor) VLIB_CLI_COMMAND (ipsec_spd_add_del_command)
Definition: ipsec_cli.c:258
clib_bihash_kv_24_16_t
Definition: bihash_24_16.h:40
ipsec_ah_backend_t
Definition: ipsec.h:37
show_ipsec_command_fn
static clib_error_t * show_ipsec_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:466
ipsec_policy_t_::is_ipv6
u8 is_ipv6
Definition: ipsec_spd_policy.h:63
ipsec_tun_protect_cmd_node
static vlib_cli_command_t ipsec_tun_protect_cmd_node
Protect tunnel with IPSEC.
Definition: ipsec_cli.c:823
ipsec_sa_add_del_command_fn
static clib_error_t * ipsec_sa_add_del_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:84
show_ipsec_spd_command_fn
static clib_error_t * show_ipsec_spd_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:566
error
Definition: cJSON.c:88
unformat_ipsec_crypto_alg
uword unformat_ipsec_crypto_alg(unformat_input_t *input, va_list *args)
Definition: ipsec_format.c:97
ipsec_tun_protect_hash_show_node
static vlib_cli_command_t ipsec_tun_protect_hash_show_node
show IPSEC tunnel protection hash tables
Definition: ipsec_cli.c:902
ipsec_esp_backend_t::esp6_encrypt_node_index
u32 esp6_encrypt_node_index
Definition: ipsec.h:67
unformat
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:978
pool_is_free_index
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:302
ipsec_rsc_in_use
clib_error_t * ipsec_rsc_in_use(ipsec_main_t *im)
Definition: ipsec.c:247
set_async_mode_command_fn
static clib_error_t * set_async_mode_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:919
ipsec4_tunnel_kv_t
Definition: ipsec_tun.h:48
ipsec_spd_add_del_command_fn
static clib_error_t * ipsec_spd_add_del_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:215
is_outbound
bool is_outbound
Definition: ipsec.api:96
IPSEC_UDP_PORT_NONE
#define IPSEC_UDP_PORT_NONE
Definition: ipsec_sa.h:297
pool_foreach
#define pool_foreach(VAR, POOL)
Iterate through pool.
Definition: pool.h:534
unformat_ip_address
uword unformat_ip_address(unformat_input_t *input, va_list *args)
Definition: ip_types.c:41
ipsec_sa_flags_t
enum ipsec_sad_flags_t_ ipsec_sa_flags_t
unformat_free
static void unformat_free(unformat_input_t *i)
Definition: format.h:155
ipsec_esp_backend_t::name
u8 * name
Definition: ipsec.h:56
vec_add1
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:606
ipsec_policy_mk_type
int ipsec_policy_mk_type(bool is_outbound, bool is_ipv6, ipsec_policy_action_t action, ipsec_spd_policy_type_t *type)
Definition: ipsec_spd_policy.c:100
ipsec_esp_backend_t::esp4_encrypt_next_index
u32 esp4_encrypt_next_index
Definition: ipsec.h:65
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
ipsec_sa_clear
void ipsec_sa_clear(index_t sai)
Definition: ipsec_sa.c:422
ipsec_sa_counters
vlib_combined_counter_main_t ipsec_sa_counters
SA packet & bytes counters.
Definition: ipsec_sa.c:27
ip46_address_range_t::stop
ip46_address_t stop
Definition: ipsec_spd_policy.h:37
format_ipsec6_tunnel_kv
u8 * format_ipsec6_tunnel_kv(u8 *s, va_list *args)
Definition: ipsec_format.c:399
ipsec_main_t
Definition: ipsec.h:108
unformat_check_input
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:163
show_ipsec_sa_command
static vlib_cli_command_t show_ipsec_sa_command
(constructor) VLIB_CLI_COMMAND (show_ipsec_sa_command)
Definition: ipsec_cli.c:552
ipsec_policy_add_del_command
static vlib_cli_command_t ipsec_policy_add_del_command
(constructor) VLIB_CLI_COMMAND (ipsec_policy_add_del_command)
Definition: ipsec_cli.c:399
index_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:43
peer
vl_api_address_t peer
Definition: teib.api:28
ipsec_tun_protect6_hash_show_one
static int ipsec_tun_protect6_hash_show_one(clib_bihash_kv_24_16_t *kv, void *arg)
Definition: ipsec_cli.c:866
ipsec_tun_protect_update
int ipsec_tun_protect_update(u32 sw_if_index, const ip_address_t *nh, u32 sa_out, u32 *sas_in)
Definition: ipsec_tun.c:564
ipsec_main
ipsec_main_t ipsec_main
Definition: ipsec.c:29
ipsec_tun_protect_show_node
static vlib_cli_command_t ipsec_tun_protect_show_node
show IPSEC tunnel protection
Definition: ipsec_cli.c:846
ipsec_tun_protect_show_one
static walk_rc_t ipsec_tun_protect_show_one(index_t itpi, void *ctx)
Definition: ipsec_cli.c:452
vlib_get_node
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
Definition: node_funcs.h:86
interface.h
format_ipsec_spd
u8 * format_ipsec_spd(u8 *s, va_list *args)
Definition: ipsec_format.c:204
ipsec_spd_show_all
static void ipsec_spd_show_all(vlib_main_t *vm, ipsec_main_t *im)
Definition: ipsec_cli.c:422
IPSEC_FORMAT_INSECURE
@ IPSEC_FORMAT_INSECURE
Definition: ipsec.h:217
ipsec_select_backend_command_fn
static clib_error_t * ipsec_select_backend_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:687
ipsec_key_t_
Definition: ipsec_sa.h:80
format_unformat_error
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
format_ipsec_sa
u8 * format_ipsec_sa(u8 *s, va_list *args)
Definition: ipsec_format.c:270
sa_in
u32 sa_in[n_sa_in]
Definition: ipsec.api:300
VLIB_CLI_COMMAND
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:163
show_ipsec_sa_command_fn
static clib_error_t * show_ipsec_sa_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:491
ipsec_esp_backend_t::esp6_encrypt_next_index
u32 esp6_encrypt_next_index
Definition: ipsec.h:69
ipsec_tun_protect_cmd
static clib_error_t * ipsec_tun_protect_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:775
ipsec6_tunnel_kv_t_
Definition: ipsec_tun.h:77
IPSEC_FORMAT_BRIEF
@ IPSEC_FORMAT_BRIEF
Definition: ipsec.h:215
ipsec_policy_t_::sa_id
u32 sa_id
Definition: ipsec_spd_policy.h:72
vlib_cli_output
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:716
clear_ipsec_counters_command_fn
static clib_error_t * clear_ipsec_counters_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:756
ipsec_ah_backend_t::ah6_decrypt_node_index
u32 ah6_decrypt_node_index
Definition: ipsec.h:49
ipsec_esp_backend_t::esp4_decrypt_next_index
u32 esp4_decrypt_next_index
Definition: ipsec.h:66
ipsec_ah_backend_t::ah6_decrypt_next_index
u32 ah6_decrypt_next_index
Definition: ipsec.h:51
id
u8 id[64]
Definition: dhcp.api:160
set_interface_spd_command_fn
static clib_error_t * set_interface_spd_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:29
vnet_main_t
Definition: vnet.h:76
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
ip46_address_range_t::start
ip46_address_t start
Definition: ipsec_spd_policy.h:37
clib_bihash_kv_8_16_t
8 octet key, 8 octet key value pair
Definition: bihash_8_16.h:41
ipsec_policy_add_del_command_fn
static clib_error_t * ipsec_policy_add_del_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:268
pool_foreach_index
#define pool_foreach_index(i, v)
Definition: pool.h:572
ipsec_policy_t_::rport
port_range_t rport
Definition: ipsec_spd_policy.h:68
spi
u32 spi
Definition: flow_types.api:140
unformat_vnet_sw_interface
unformat_function_t unformat_vnet_sw_interface
Definition: interface_funcs.h:462
format
description fragment has unexpected format
Definition: map.api:433
ipsec_spd_policy_counters
vlib_combined_counter_main_t ipsec_spd_policy_counters
Policy packet & bytes counters.
Definition: ipsec_spd_policy.c:22
clear_ipsec_counters_command
static vlib_cli_command_t clear_ipsec_counters_command
(constructor) VLIB_CLI_COMMAND (clear_ipsec_counters_command)
Definition: ipsec_cli.c:767
ip.h
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
integ_alg
u8 integ_alg
Definition: ikev2_types.api:59
ipsec_policy_t_
A Secruity Policy.
Definition: ipsec_spd_policy.h:54
ipsec_tun_protect_del
int ipsec_tun_protect_del(u32 sw_if_index, const ip_address_t *nh)
Definition: ipsec_tun.c:714
ipsec_ah_backend_t::ah4_encrypt_node_index
u32 ah4_encrypt_node_index
Definition: ipsec.h:44
ipsec_esp_backend_t
Definition: ipsec.h:54
ipsec_add_del_policy
int ipsec_add_del_policy(vlib_main_t *vm, ipsec_policy_t *policy, int is_add, u32 *stat_index)
Add/Delete a SPD.
Definition: ipsec_spd_policy.c:140
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
ipsec_set_async_mode
void ipsec_set_async_mode(u32 is_enabled)
Definition: ipsec.c:328
ipsec_spd_t
A Secruity Policy Database.
Definition: ipsec_spd.h:46
ipsec_show_backends_command_fn
static clib_error_t * ipsec_show_backends_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ipsec_cli.c:620
IPSEC_PROTOCOL_AH
@ IPSEC_PROTOCOL_AH
Definition: ipsec_sa.h:75
AF_IP6
@ AF_IP6
Definition: ip_types.h:24
port_range_t::start
u16 start
Definition: ipsec_spd_policy.h:42
ipsec_policy_t_::lport
port_range_t lport
Definition: ipsec_spd_policy.h:67
ipsec_select_backend_command
static vlib_cli_command_t ipsec_select_backend_command
(constructor) VLIB_CLI_COMMAND (ipsec_select_backend_command)
Definition: ipsec_cli.c:747
ipsec_ah_backend_t::ah6_encrypt_next_index
u32 ah6_encrypt_next_index
Definition: ipsec.h:50
ipsec_show_backends_command
static vlib_cli_command_t ipsec_show_backends_command
(constructor) VLIB_CLI_COMMAND (ipsec_show_backends_command)
Definition: ipsec_cli.c:679
salt
u32 salt
Definition: ipsec_types.api:139
ipsec_policy_t_::type
ipsec_spd_policy_type_t type
Definition: ipsec_spd_policy.h:60
ipsec_sa_show_all
static void ipsec_sa_show_all(vlib_main_t *vm, ipsec_main_t *im, u8 detail)
Definition: ipsec_cli.c:408
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
vlib_node_t
Definition: node.h:247
u8
unsigned char u8
Definition: types.h:56
ipsec_policy_t_::laddr
ip46_address_range_t laddr
Definition: ipsec_spd_policy.h:64
clib_error_t
Definition: clib_error.h:21
unformat_ipsec_policy_action
uword unformat_ipsec_policy_action(unformat_input_t *input, va_list *args)
Definition: ipsec_format.c:65
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
ipsec_policy_t_::id
u32 id
Definition: ipsec_spd_policy.h:56
IPSEC_FORMAT_DETAIL
@ IPSEC_FORMAT_DETAIL
Definition: ipsec.h:216
i
int i
Definition: flowhash_template.h:376
ipsec_select_esp_backend
int ipsec_select_esp_backend(ipsec_main_t *im, u32 backend_idx)
Definition: ipsec.c:281
ipsec_select_ah_backend
int ipsec_select_ah_backend(ipsec_main_t *im, u32 backend_idx)
Definition: ipsec.c:258
ipsec_ah_backend_t::ah6_encrypt_node_index
u32 ah6_encrypt_node_index
Definition: ipsec.h:48
ipsec_ah_backend_t::name
u8 * name
Definition: ipsec.h:39
ipip.h
unformat_ip6_address
unformat_function_t unformat_ip6_address
Definition: format.h:89
unformat_ipsec_integ_alg
uword unformat_ipsec_integ_alg(unformat_input_t *input, va_list *args)
Definition: ipsec_format.c:129
set_interface_spd_command
static vlib_cli_command_t set_interface_spd_command
(constructor) VLIB_CLI_COMMAND (set_interface_spd_command)
Definition: ipsec_cli.c:75
clear_ipsec_sa_command
static vlib_cli_command_t clear_ipsec_sa_command
(constructor) VLIB_CLI_COMMAND (clear_ipsec_sa_command)
Definition: ipsec_cli.c:558
rv
int __clib_unused rv
Definition: application.c:491
unformat_ip4_address
unformat_function_t unformat_ip4_address
Definition: format.h:68
ipsec_sa_add_and_lock
int ipsec_sa_add_and_lock(u32 id, u32 spi, ipsec_protocol_t proto, ipsec_crypto_alg_t crypto_alg, const ipsec_key_t *ck, ipsec_integ_alg_t integ_alg, const ipsec_key_t *ik, ipsec_sa_flags_t flags, u32 salt, u16 src_port, u16 dst_port, const tunnel_t *tun, u32 *sa_out_index)
Definition: ipsec_sa.c:170
vnet.h
api_errno.h
proto
vl_api_ip_proto_t proto
Definition: acl_types.api:51
ipsec_policy_t_::policy
ipsec_policy_action_t policy
Definition: ipsec_spd_policy.h:71
vlib_cli_command_t
Definition: cli.h:92
format_ipsec_policy_action
u8 * format_ipsec_policy_action(u8 *s, va_list *args)
Definition: ipsec_format.c:29
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
tun
vl_api_gbp_endpoint_tun_t tun
Definition: gbp.api:134
ipsec_sa_add_del_command
static vlib_cli_command_t ipsec_sa_add_del_command
(constructor) VLIB_CLI_COMMAND (ipsec_sa_add_del_command)
Definition: ipsec_cli.c:206
walk_rc_t
enum walk_rc_t_ walk_rc_t
Walk return code.
ipsec_sa_unlock_id
int ipsec_sa_unlock_id(u32 id)
Definition: ipsec_sa.c:406
ipsec_sa_pool
ipsec_sa_t * ipsec_sa_pool
Pool of IPSec SAs.
Definition: ipsec_sa.c:32
ipsec_tun_protect_walk
void ipsec_tun_protect_walk(ipsec_tun_protect_walk_cb_t fn, void *ctx)
Definition: ipsec_tun.c:746
vlib_node_t::name
u8 * name
Definition: node.h:253
set_async_mode_command
static vlib_cli_command_t set_async_mode_command
(constructor) VLIB_CLI_COMMAND (set_async_mode_command)
Definition: ipsec_cli.c:946
UNFORMAT_END_OF_INPUT
#define UNFORMAT_END_OF_INPUT
Definition: format.h:137
ipsec_policy_t_::protocol
u8 protocol
Definition: ipsec_spd_policy.h:66
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105