FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
bfd_cli.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 /**
16  * @file
17  * @brief BFD CLI implementation
18  */
19 
20 #include <vlib/vlib.h>
21 #include <vlib/cli.h>
22 #include <vppinfra/format.h>
23 #include <vppinfra/warnings.h>
24 #include <vnet/api_errno.h>
25 #include <vnet/ip/format.h>
26 #include <vnet/bfd/bfd_api.h>
27 #include <vnet/bfd/bfd_main.h>
28 
29 static u8 *
30 format_bfd_session_cli (u8 * s, va_list * args)
31 {
32  vlib_main_t *vm = va_arg (*args, vlib_main_t *);
33  bfd_session_t *bs = va_arg (*args, bfd_session_t *);
34  switch (bs->transport)
35  {
36  case BFD_TRANSPORT_UDP4:
37  s = format (s, "%=10u %-32s %20U %20U\n", bs->bs_idx, "IPv4 address",
38  format_ip4_address, bs->udp.key.local_addr.ip4.as_u8,
39  format_ip4_address, bs->udp.key.peer_addr.ip4.as_u8);
40  break;
41  case BFD_TRANSPORT_UDP6:
42  s = format (s, "%=10u %-32s %20U %20U\n", bs->bs_idx, "IPv6 address",
43  format_ip6_address, &bs->udp.key.local_addr.ip6,
44  format_ip6_address, &bs->udp.key.peer_addr.ip6);
45  break;
46  }
47  s = format (s, "%10s %-32s %20s %20s\n", "", "Session state",
50  s = format (s, "%10s %-32s %20s %20s\n", "", "Diagnostic code",
53  s = format (s, "%10s %-32s %20u %20u\n", "", "Detect multiplier",
55  s = format (s, "%10s %-32s %20u %20llu\n", "",
56  "Required Min Rx Interval (usec)",
58  s = format (s, "%10s %-32s %20u %20u\n", "",
59  "Desired Min Tx Interval (usec)",
62  s =
63  format (s, "%10s %-32s %20u\n", "", "Transmit interval",
66  u8 *tmp = NULL;
67  if (bs->last_tx_nsec > 0)
68  {
69  tmp = format (tmp, "%.2fs ago", (now - bs->last_tx_nsec) *
71  s = format (s, "%10s %-32s %20v\n", "", "Last control frame tx", tmp);
73  }
74  if (bs->last_rx_nsec)
75  {
76  tmp = format (tmp, "%.2fs ago", (now - bs->last_rx_nsec) *
78  s = format (s, "%10s %-32s %20v\n", "", "Last control frame rx", tmp);
80  }
81  s =
82  format (s, "%10s %-32s %20u %20llu\n", "", "Min Echo Rx Interval (usec)",
84  if (bs->echo)
85  {
86  s =
87  format (s, "%10s %-32s %20u\n", "", "Echo transmit interval",
89  tmp =
90  format (tmp, "%.2fs ago",
91  (now -
93  s = format (s, "%10s %-32s %20v\n", "", "Last echo frame tx", tmp);
95  tmp = format (tmp, "%.6fs",
98  s =
99  format (s, "%10s %-32s %20v\n", "", "Last echo frame roundtrip time",
100  tmp);
101  }
102  vec_free (tmp);
103  tmp = NULL;
104  s = format (s, "%10s %-32s %20s %20s\n", "", "Demand mode", "no",
105  bs->remote_demand ? "yes" : "no");
106  s = format (s, "%10s %-32s %20s\n", "", "Poll state",
108  if (bs->auth.curr_key)
109  {
110  s = format (s, "%10s %-32s %20u\n", "", "Authentication config key ID",
111  bs->auth.curr_key->conf_key_id);
112  s = format (s, "%10s %-32s %20u\n", "", "Authentication BFD key ID",
113  bs->auth.curr_bfd_key_id);
114  s = format (s, "%10s %-32s %20u %20u\n", "", "Sequence number",
116  }
117  return s;
118 }
119 
120 static clib_error_t *
123 {
124  bfd_main_t *bm = &bfd_main;
125  bfd_session_t *bs = NULL;
126  unformat_input_t _line_input, *line_input = &_line_input;
127 
128  /* Get a line of input. */
129  if (!unformat_user (input, unformat_line_input, line_input))
130  return 0;
131 
132  if (unformat (line_input, "keys"))
133  {
134  bfd_auth_key_t *key = NULL;
135  u8 *s = format (NULL, "%=10s %=25s %=10s\n", "Configuration Key ID",
136  "Type", "Use Count");
137  /* *INDENT-OFF* */
138  pool_foreach (key, bm->auth_keys) {
139  s = format (s, "%10u %-25s %10u\n", key->conf_key_id,
140  bfd_auth_type_str (key->auth_type), key->use_count);
141  }
142  /* *INDENT-ON* */
143  vlib_cli_output (vm, "%v\n", s);
144  vec_free (s);
145  vlib_cli_output (vm, "Number of configured BFD keys: %lu\n",
146  (u64) pool_elts (bm->auth_keys));
147  }
148  else if (unformat (line_input, "sessions"))
149  {
150  u8 *s = format (NULL, "%=10s %=32s %=20s %=20s\n", "Index", "Property",
151  "Local value", "Remote value");
152  /* *INDENT-OFF* */
153  pool_foreach (bs, bm->sessions) {
154  s = format (s, "%U", format_bfd_session_cli, vm, bs);
155  }
156  /* *INDENT-ON* */
157  vlib_cli_output (vm, "%v", s);
158  vec_free (s);
159  vlib_cli_output (vm, "Number of configured BFD sessions: %lu\n",
160  (u64) pool_elts (bm->sessions));
161  }
162  else if (unformat (line_input, "echo-source"))
163  {
164  int is_set;
166  int have_usable_ip4;
168  int have_usable_ip6;
169  ip6_address_t ip6;
170  bfd_udp_get_echo_source (&is_set, &sw_if_index, &have_usable_ip4, &ip4,
171  &have_usable_ip6, &ip6);
172  if (is_set)
173  {
174  vnet_sw_interface_t *sw_if =
176  vnet_hw_interface_t *hw_if =
178  u8 *s = format (NULL, "UDP echo source is: %v\n", hw_if->name);
179  s = format (s, "IPv4 address usable as echo source: ");
180  if (have_usable_ip4)
181  {
182  s = format (s, "%U\n", format_ip4_address, &ip4);
183  }
184  else
185  {
186  s = format (s, "none\n");
187  }
188  s = format (s, "IPv6 address usable as echo source: ");
189  if (have_usable_ip6)
190  {
191  s = format (s, "%U\n", format_ip6_address, &ip6);
192  }
193  else
194  {
195  s = format (s, "none\n");
196  }
197  vlib_cli_output (vm, "%v", s);
198  vec_free (s);
199  }
200  else
201  {
202  vlib_cli_output (vm, "UDP echo source is not set.\n");
203  }
204  }
205  else
206  {
207  vlib_cli_output (vm, "Number of configured BFD sessions: %lu\n",
208  (u64) pool_elts (bm->sessions));
209  vlib_cli_output (vm, "Number of configured BFD keys: %lu\n",
210  (u64) pool_elts (bm->auth_keys));
211  }
212  return 0;
213 }
214 
215 /* *INDENT-OFF* */
217  .path = "show bfd",
218  .short_help = "show bfd [keys|sessions|echo-source]",
219  .function = show_bfd,
220 };
221 /* *INDENT-ON* */
222 
223 static clib_error_t *
226 {
227  clib_error_t *ret = NULL;
228  int have_key_id = 0;
229  u32 key_id = 0;
230  u8 *vec_auth_type = NULL;
231  bfd_auth_type_e auth_type = BFD_AUTH_TYPE_reserved;
232  u8 *secret = NULL;
233  unformat_input_t _line_input, *line_input = &_line_input;
234  static const u8 keyed_sha1[] = "keyed-sha1";
235  static const u8 meticulous_keyed_sha1[] = "meticulous-keyed-sha1";
236 
237  /* Get a line of input. */
238  if (!unformat_user (input, unformat_line_input, line_input))
239  return 0;
240 
241  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
242  {
243  if (unformat (line_input, "conf-key-id %u", &key_id))
244  {
245  have_key_id = 1;
246  }
247  else if (unformat (line_input, "type %U", unformat_token, "a-zA-Z0-9-",
248  &vec_auth_type))
249  {
250  if (vec_len (vec_auth_type) == sizeof (keyed_sha1) - 1 &&
251  0 == memcmp (vec_auth_type, keyed_sha1,
252  sizeof (keyed_sha1) - 1))
253  {
254  auth_type = BFD_AUTH_TYPE_keyed_sha1;
255  }
256  else if (vec_len (vec_auth_type) ==
257  sizeof (meticulous_keyed_sha1) - 1 &&
258  0 == memcmp (vec_auth_type, meticulous_keyed_sha1,
259  sizeof (meticulous_keyed_sha1) - 1))
260  {
261  auth_type = BFD_AUTH_TYPE_meticulous_keyed_sha1;
262  }
263  else
264  {
265  ret = clib_error_return (0, "invalid type `%v'", vec_auth_type);
266  goto out;
267  }
268  }
269  else
270  if (unformat (line_input, "secret %U", unformat_hex_string, &secret))
271  {
272  /* nothing to do here */
273  }
274  else
275  {
276  ret = clib_error_return (0, "Unknown input `%U'",
277  format_unformat_error, line_input);
278  goto out;
279  }
280  }
281 
282  if (!have_key_id)
283  {
284  ret =
285  clib_error_return (0, "required parameter missing: `conf-key-id'");
286  goto out;
287  }
288  if (!vec_auth_type)
289  {
290  ret = clib_error_return (0, "required parameter missing: `type'");
291  goto out;
292  }
293  if (!secret)
294  {
295  ret = clib_error_return (0, "required parameter missing: `secret'");
296  goto out;
297  }
298 
300  bfd_auth_set_key (key_id, auth_type, vec_len (secret), secret);
301  if (rv)
302  {
303  ret =
304  clib_error_return (0, "`bfd_auth_set_key' API call failed, rv=%d:%U",
305  (int) rv, format_vnet_api_errno, rv);
306  }
307 
308 out:
309  vec_free (vec_auth_type);
310  return ret;
311 }
312 
313 /* *INDENT-OFF* */
315  .path = "bfd key set",
316  .short_help = "bfd key set"
317  " conf-key-id <id>"
318  " type <keyed-sha1|meticulous-keyed-sha1> "
319  " secret <secret>",
320  .function = bfd_cli_key_add,
321 };
322 /* *INDENT-ON* */
323 
324 static clib_error_t *
327 {
328  clib_error_t *ret = NULL;
329  u32 key_id = 0;
330  unformat_input_t _line_input, *line_input = &_line_input;
331 
332  /* Get a line of input. */
333  if (!unformat_user (input, unformat_line_input, line_input))
334  return 0;
335 
336  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
337  {
338  if (!unformat (line_input, "conf-key-id %u", &key_id))
339  {
340  ret = clib_error_return (0, "Unknown input `%U'",
341  format_unformat_error, line_input);
342  goto out;
343  }
344  }
345 
347  if (rv)
348  {
349  ret =
350  clib_error_return (0, "`bfd_auth_del_key' API call failed, rv=%d:%U",
351  (int) rv, format_vnet_api_errno, rv);
352  }
353 
354 out:
355  return ret;
356 }
357 
358 /* *INDENT-OFF* */
360  .path = "bfd key del",
361  .short_help = "bfd key del conf-key-id <id>",
362  .function = bfd_cli_key_del,
363 };
364 /* *INDENT-ON* */
365 
366 #define INTERFACE_STR "interface"
367 #define LOCAL_ADDR_STR "local-addr"
368 #define PEER_ADDR_STR "peer-addr"
369 #define CONF_KEY_ID_STR "conf-key-id"
370 #define BFD_KEY_ID_STR "bfd-key-id"
371 #define DESIRED_MIN_TX_STR "desired-min-tx"
372 #define REQUIRED_MIN_RX_STR "required-min-rx"
373 #define DETECT_MULT_STR "detect-mult"
374 #define ADMIN_STR "admin"
375 #define DELAYED_STR "delayed"
376 
377 static const unsigned mandatory = 1;
378 static const unsigned optional = 0;
379 
380 #define DECLARE(t, n, s, r, ...) \
381  int have_##n = 0; \
382  t n;
383 
384 #define UNFORMAT(t, n, s, r, ...) \
385  if (unformat (line_input, s " " __VA_ARGS__, &n)) \
386  { \
387  something_parsed = 1; \
388  have_##n = 1; \
389  }
390 
391 #define CHECK_MANDATORY(t, n, s, r, ...) \
392 WARN_OFF(tautological-compare) \
393  if (mandatory == r && !have_##n) \
394  { \
395  WARN_ON(tautological-compare) \
396  ret = clib_error_return (0, "Required parameter `%s' missing.", s); \
397  goto out; \
398  }
399 
400 static clib_error_t *
403 {
404  clib_error_t *ret = NULL;
405  unformat_input_t _line_input, *line_input = &_line_input;
406 #define foreach_bfd_cli_udp_session_add_cli_param(F) \
407  F (u32, sw_if_index, INTERFACE_STR, mandatory, "%U", \
408  unformat_vnet_sw_interface, &vnet_main) \
409  F (ip46_address_t, local_addr, LOCAL_ADDR_STR, mandatory, "%U", \
410  unformat_ip46_address) \
411  F (ip46_address_t, peer_addr, PEER_ADDR_STR, mandatory, "%U", \
412  unformat_ip46_address) \
413  F (u32, desired_min_tx, DESIRED_MIN_TX_STR, mandatory, "%u") \
414  F (u32, required_min_rx, REQUIRED_MIN_RX_STR, mandatory, "%u") \
415  F (u32, detect_mult, DETECT_MULT_STR, mandatory, "%u") \
416  F (u32, conf_key_id, CONF_KEY_ID_STR, optional, "%u") \
417  F (u32, bfd_key_id, BFD_KEY_ID_STR, optional, "%u")
418 
420 
421  /* Get a line of input. */
422  if (!unformat_user (input, unformat_line_input, line_input))
423  return 0;
424 
425  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
426  {
427  int something_parsed = 0;
429 
430  if (!something_parsed)
431  {
432  ret = clib_error_return (0, "Unknown input `%U'",
433  format_unformat_error, line_input);
434  goto out;
435  }
436  }
437 
439 
440  if (1 == have_conf_key_id + have_bfd_key_id)
441  {
442  ret = clib_error_return (0, "Incompatible parameter combination, `%s' "
443  "and `%s' must be either both specified or none",
445  goto out;
446  }
447 
448  if (detect_mult > 255)
449  {
450  ret = clib_error_return (0, "%s value `%u' out of range <1,255>",
451  DETECT_MULT_STR, detect_mult);
452  goto out;
453  }
454 
455  if (have_bfd_key_id && bfd_key_id > 255)
456  {
457  ret = clib_error_return (0, "%s value `%u' out of range <1,255>",
458  BFD_KEY_ID_STR, bfd_key_id);
459  goto out;
460  }
461 
463  bfd_udp_add_session (sw_if_index, &local_addr, &peer_addr, desired_min_tx,
464  required_min_rx,
465  detect_mult, have_conf_key_id, conf_key_id,
466  bfd_key_id);
467  if (rv)
468  {
469  ret =
471  "`bfd_add_add_session' API call failed, rv=%d:%U",
472  (int) rv, format_vnet_api_errno, rv);
473  goto out;
474  }
475 
476 out:
477  return ret;
478 }
479 
480 /* *INDENT-OFF* */
482  .path = "bfd udp session add",
483  .short_help = "bfd udp session add"
484  " interface <interface>"
485  " local-addr <local-address>"
486  " peer-addr <peer-address>"
487  " desired-min-tx <desired min tx interval>"
488  " required-min-rx <required min rx interval>"
489  " detect-mult <detect multiplier> "
490  "["
491  " conf-key-id <config key ID>"
492  " bfd-key-id <BFD key ID>"
493  "]",
494  .function = bfd_cli_udp_session_add,
495 };
496 /* *INDENT-ON* */
497 
498 static clib_error_t *
501 {
502  clib_error_t *ret = NULL;
503  unformat_input_t _line_input, *line_input = &_line_input;
504 #define foreach_bfd_cli_udp_session_mod_cli_param(F) \
505  F (u32, sw_if_index, INTERFACE_STR, mandatory, "%U", \
506  unformat_vnet_sw_interface, &vnet_main) \
507  F (ip46_address_t, local_addr, LOCAL_ADDR_STR, mandatory, "%U", \
508  unformat_ip46_address) \
509  F (ip46_address_t, peer_addr, PEER_ADDR_STR, mandatory, "%U", \
510  unformat_ip46_address) \
511  F (u32, desired_min_tx, DESIRED_MIN_TX_STR, mandatory, "%u") \
512  F (u32, required_min_rx, REQUIRED_MIN_RX_STR, mandatory, "%u") \
513  F (u32, detect_mult, DETECT_MULT_STR, mandatory, "%u")
514 
516 
517  /* Get a line of input. */
518  if (!unformat_user (input, unformat_line_input, line_input))
519  return 0;
520 
521  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
522  {
523  int something_parsed = 0;
525 
526  if (!something_parsed)
527  {
528  ret = clib_error_return (0, "Unknown input `%U'",
529  format_unformat_error, line_input);
530  goto out;
531  }
532  }
533 
535 
536  if (detect_mult > 255)
537  {
538  ret = clib_error_return (0, "%s value `%u' out of range <1,255>",
539  DETECT_MULT_STR, detect_mult);
540  goto out;
541  }
542 
544  bfd_udp_mod_session (sw_if_index, &local_addr, &peer_addr,
545  desired_min_tx, required_min_rx, detect_mult);
546  if (rv)
547  {
548  ret =
550  "`bfd_udp_mod_session' API call failed, rv=%d:%U",
551  (int) rv, format_vnet_api_errno, rv);
552  goto out;
553  }
554 
555 out:
556  return ret;
557 }
558 
559 /* *INDENT-OFF* */
561  .path = "bfd udp session mod",
562  .short_help = "bfd udp session mod interface"
563  " <interface> local-addr"
564  " <local-address> peer-addr"
565  " <peer-address> desired-min-tx"
566  " <desired min tx interval> required-min-rx"
567  " <required min rx interval> detect-mult"
568  " <detect multiplier> ",
569  .function = bfd_cli_udp_session_mod,
570 };
571 /* *INDENT-ON* */
572 
573 static clib_error_t *
576 {
577  clib_error_t *ret = NULL;
578  unformat_input_t _line_input, *line_input = &_line_input;
579 #define foreach_bfd_cli_udp_session_del_cli_param(F) \
580  F (u32, sw_if_index, INTERFACE_STR, mandatory, "%U", \
581  unformat_vnet_sw_interface, &vnet_main) \
582  F (ip46_address_t, local_addr, LOCAL_ADDR_STR, mandatory, "%U", \
583  unformat_ip46_address) \
584  F (ip46_address_t, peer_addr, PEER_ADDR_STR, mandatory, "%U", \
585  unformat_ip46_address)
586 
588 
589  /* Get a line of input. */
590  if (!unformat_user (input, unformat_line_input, line_input))
591  return 0;
592 
593  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
594  {
595  int something_parsed = 0;
597 
598  if (!something_parsed)
599  {
600  ret = clib_error_return (0, "Unknown input `%U'",
601  format_unformat_error, line_input);
602  goto out;
603  }
604  }
605 
607 
609  bfd_udp_del_session (sw_if_index, &local_addr, &peer_addr);
610  if (rv)
611  {
612  ret =
614  "`bfd_udp_del_session' API call failed, rv=%d:%U",
615  (int) rv, format_vnet_api_errno, rv);
616  goto out;
617  }
618 
619 out:
620  return ret;
621 }
622 
623 /* *INDENT-OFF* */
625  .path = "bfd udp session del",
626  .short_help = "bfd udp session del interface"
627  " <interface> local-addr"
628  " <local-address> peer-addr"
629  "<peer-address> ",
630  .function = bfd_cli_udp_session_del,
631 };
632 /* *INDENT-ON* */
633 
634 static clib_error_t *
637 {
638  clib_error_t *ret = NULL;
639  unformat_input_t _line_input, *line_input = &_line_input;
640 #define foreach_bfd_cli_udp_session_set_flags_cli_param(F) \
641  F (u32, sw_if_index, INTERFACE_STR, mandatory, "%U", \
642  unformat_vnet_sw_interface, &vnet_main) \
643  F (ip46_address_t, local_addr, LOCAL_ADDR_STR, mandatory, "%U", \
644  unformat_ip46_address) \
645  F (ip46_address_t, peer_addr, PEER_ADDR_STR, mandatory, "%U", \
646  unformat_ip46_address) \
647  F (u8 *, admin_up_down_token, ADMIN_STR, mandatory, "%v", \
648  &admin_up_down_token)
649 
651 
652  /* Get a line of input. */
653  if (!unformat_user (input, unformat_line_input, line_input))
654  return 0;
655 
656  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
657  {
658  int something_parsed = 0;
660 
661  if (!something_parsed)
662  {
663  ret = clib_error_return (0, "Unknown input `%U'",
664  format_unformat_error, line_input);
665  goto out;
666  }
667  }
668 
670 
671  u8 admin_up_down;
672  static const char up[] = "up";
673  static const char down[] = "down";
674  if (!memcmp (admin_up_down_token, up, sizeof (up) - 1))
675  {
676  admin_up_down = 1;
677  }
678  else if (!memcmp (admin_up_down_token, down, sizeof (down) - 1))
679  {
680  admin_up_down = 0;
681  }
682  else
683  {
684  ret =
685  clib_error_return (0, "Unrecognized value for `%s' parameter: `%v'",
686  ADMIN_STR, admin_up_down_token);
687  goto out;
688  }
691  &peer_addr, admin_up_down);
692  if (rv)
693  {
694  ret =
696  "`bfd_udp_session_set_flags' API call failed, rv=%d:%U",
697  (int) rv, format_vnet_api_errno, rv);
698  goto out;
699  }
700 
701 out:
702  return ret;
703 }
704 
705 /* *INDENT-OFF* */
707  .path = "bfd udp session set-flags",
708  .short_help = "bfd udp session set-flags"
709  " interface <interface>"
710  " local-addr <local-address>"
711  " peer-addr <peer-address>"
712  " admin <up|down>",
713  .function = bfd_cli_udp_session_set_flags,
714 };
715 /* *INDENT-ON* */
716 
717 static clib_error_t *
719  unformat_input_t * input,
721 {
722  clib_error_t *ret = NULL;
723  unformat_input_t _line_input, *line_input = &_line_input;
724 #define foreach_bfd_cli_udp_session_auth_activate_cli_param(F) \
725  F (u32, sw_if_index, INTERFACE_STR, mandatory, "%U", \
726  unformat_vnet_sw_interface, &vnet_main) \
727  F (ip46_address_t, local_addr, LOCAL_ADDR_STR, mandatory, "%U", \
728  unformat_ip46_address) \
729  F (ip46_address_t, peer_addr, PEER_ADDR_STR, mandatory, "%U", \
730  unformat_ip46_address) \
731  F (u8 *, delayed_token, DELAYED_STR, optional, "%v") \
732  F (u32, conf_key_id, CONF_KEY_ID_STR, mandatory, "%u") \
733  F (u32, bfd_key_id, BFD_KEY_ID_STR, mandatory, "%u")
734 
736 
737  /* Get a line of input. */
738  if (!unformat_user (input, unformat_line_input, line_input))
739  return 0;
740 
741  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
742  {
743  int something_parsed = 0;
745 
746  if (!something_parsed)
747  {
748  ret = clib_error_return (0, "Unknown input `%U'",
749  format_unformat_error, line_input);
750  goto out;
751  }
752  }
753 
755 
756  u8 is_delayed = 0;
757  if (have_delayed_token)
758  {
759  static const char yes[] = "yes";
760  static const char no[] = "no";
761  if (!memcmp (delayed_token, yes, sizeof (yes) - 1))
762  {
763  is_delayed = 1;
764  }
765  else if (!memcmp (delayed_token, no, sizeof (no) - 1))
766  {
767  is_delayed = 0;
768  }
769  else
770  {
771  ret =
773  "Unrecognized value for `%s' parameter: `%v'",
774  DELAYED_STR, delayed_token);
775  goto out;
776  }
777  }
778 
779  if (have_bfd_key_id && bfd_key_id > 255)
780  {
781  ret = clib_error_return (0, "%s value `%u' out of range <1,255>",
782  BFD_KEY_ID_STR, bfd_key_id);
783  goto out;
784  }
785 
787  bfd_udp_auth_activate (sw_if_index, &local_addr, &peer_addr, conf_key_id,
788  bfd_key_id, is_delayed);
789  if (rv)
790  {
791  ret =
793  "`bfd_udp_auth_activate' API call failed, rv=%d:%U",
794  (int) rv, format_vnet_api_errno, rv);
795  goto out;
796  }
797 
798 out:
799  return ret;
800 }
801 
802 /* *INDENT-OFF* */
804  .path = "bfd udp session auth activate",
805  .short_help = "bfd udp session auth activate"
806  " interface <interface>"
807  " local-addr <local-address>"
808  " peer-addr <peer-address>"
809  " conf-key-id <config key ID>"
810  " bfd-key-id <BFD key ID>"
811  " [ delayed <yes|no> ]",
813 };
814 
815 static clib_error_t *
818 {
819  clib_error_t *ret = NULL;
820  unformat_input_t _line_input, *line_input = &_line_input;
821 #define foreach_bfd_cli_udp_session_auth_deactivate_cli_param(F) \
822  F (u32, sw_if_index, INTERFACE_STR, mandatory, "%U", \
823  unformat_vnet_sw_interface, &vnet_main) \
824  F (ip46_address_t, local_addr, LOCAL_ADDR_STR, mandatory, "%U", \
825  unformat_ip46_address) \
826  F (ip46_address_t, peer_addr, PEER_ADDR_STR, mandatory, "%U", \
827  unformat_ip46_address) \
828  F (u8 *, delayed_token, DELAYED_STR, optional, "%v")
829 
831 
832  /* Get a line of input. */
833  if (!unformat_user (input, unformat_line_input, line_input))
834  return 0;
835 
836  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
837  {
838  int something_parsed = 0;
840 
841  if (!something_parsed)
842  {
843  ret = clib_error_return (0, "Unknown input `%U'",
844  format_unformat_error, input);
845  goto out;
846  }
847  }
848 
850 
851  u8 is_delayed = 0;
852  if (have_delayed_token)
853  {
854  static const char yes[] = "yes";
855  static const char no[] = "no";
856  if (!memcmp (delayed_token, yes, sizeof (yes) - 1))
857  {
858  is_delayed = 1;
859  }
860  else if (!memcmp (delayed_token, no, sizeof (no) - 1))
861  {
862  is_delayed = 0;
863  }
864  else
865  {
866  ret = clib_error_return (
867  0, "Unrecognized value for `%s' parameter: `%v'", DELAYED_STR,
868  delayed_token);
869  goto out;
870  }
871  }
872 
874  &peer_addr, is_delayed);
875  if (rv)
876  {
877  ret = clib_error_return (
878  0, "`bfd_udp_auth_deactivate' API call failed, rv=%d:%U", (int)rv,
880  goto out;
881  }
882 
883 out:
884  return ret;
885 }
886 
887 /* *INDENT-OFF* */
889  .path = "bfd udp session auth deactivate",
890  .short_help = "bfd udp session auth deactivate"
891  " interface <interface>"
892  " local-addr <local-address>"
893  " peer-addr <peer-address>"
894  "[ delayed <yes|no> ]",
896 };
897 /* *INDENT-ON* */
898 
899 static clib_error_t *
902 {
903  clib_error_t *ret = NULL;
904  unformat_input_t _line_input, *line_input = &_line_input;
905 #define foreach_bfd_cli_udp_set_echo_source_cli_param(F) \
906  F (u32, sw_if_index, INTERFACE_STR, mandatory, "%U", \
907  unformat_vnet_sw_interface, &vnet_main)
908 
910 
911  /* Get a line of input. */
912  if (!unformat_user (input, unformat_line_input, line_input))
913  return 0;
914 
915  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
916  {
917  int something_parsed = 0;
919 
920  if (!something_parsed)
921  {
922  ret = clib_error_return (0, "Unknown input `%U'",
923  format_unformat_error, line_input);
924  goto out;
925  }
926  }
927 
929 
931  if (rv)
932  {
933  ret =
935  "`bfd_udp_set_echo_source' API call failed, rv=%d:%U",
936  (int) rv, format_vnet_api_errno, rv);
937  goto out;
938  }
939 
940 out:
941  return ret;
942 }
943 
944 /* *INDENT-OFF* */
946  .path = "bfd udp echo-source set",
947  .short_help = "bfd udp echo-source set interface <interface>",
948  .function = bfd_cli_udp_set_echo_source,
949 };
950 /* *INDENT-ON* */
951 
952 static clib_error_t *
955 {
957  if (rv)
958  {
959  return clib_error_return (0,
960  "`bfd_udp_del_echo_source' API call failed, rv=%d:%U",
961  (int) rv, format_vnet_api_errno, rv);
962  }
963 
964  return 0;
965 }
966 
967 /* *INDENT-OFF* */
969  .path = "bfd udp echo-source del",
970  .short_help = "bfd udp echo-source del",
971  .function = bfd_cli_udp_del_echo_source,
972 };
973 /* *INDENT-ON* */
974 
975 /*
976  * fd.io coding-style-patch-verification: ON
977  *
978  * Local Variables:
979  * eval: (c-set-style "gnu")
980  * End:
981  */
vec_reset_length
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
Definition: vec_bootstrap.h:194
bfd_session_s::remote_desired_min_tx_nsec
u64 remote_desired_min_tx_nsec
remote desired min tx interval (nsec)
Definition: bfd_main.h:142
vlib.h
bfd_cli_key_add
static clib_error_t * bfd_cli_key_add(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:224
tmp
u32 * tmp
Definition: interface_output.c:1078
bfd_session_s::last_rx_nsec
u64 last_rx_nsec
timestamp of last packet received
Definition: bfd_main.h:172
CHECK_MANDATORY
#define CHECK_MANDATORY(t, n, s, r,...)
Definition: bfd_cli.c:391
bfd_session_s::remote_diag
bfd_diag_code_e remote_diag
remote diagnostics
Definition: bfd_main.h:103
CONF_KEY_ID_STR
#define CONF_KEY_ID_STR
Definition: bfd_cli.c:369
bfd_cli_key_del
static clib_error_t * bfd_cli_key_del(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:325
bfd_session_s::transport
bfd_transport_e transport
transport type for this session
Definition: bfd_main.h:236
unformat_user
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:989
UNFORMAT
#define UNFORMAT(t, n, s, r,...)
Definition: bfd_cli.c:384
bfd_cli_udp_session_del_command
static vlib_cli_command_t bfd_cli_udp_session_del_command
(constructor) VLIB_CLI_COMMAND (bfd_cli_udp_session_del_command)
Definition: bfd_cli.c:624
bfd_udp_auth_deactivate
vnet_api_error_t bfd_udp_auth_deactivate(u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr, u8 is_delayed)
deactivate authentication for existing session
Definition: bfd_udp.c:876
vnet_sw_interface_t
Definition: interface.h:868
foreach_bfd_cli_udp_session_mod_cli_param
#define foreach_bfd_cli_udp_session_mod_cli_param(F)
bfd_session_s::last_tx_nsec
u64 last_tx_nsec
timestamp of last packet transmitted
Definition: bfd_main.h:169
bfd_auth_type_e
bfd_auth_type_e
Definition: bfd_protocol.h:36
vlib_main_t::clib_time
clib_time_t clib_time
Definition: main.h:106
bfd_cli_udp_del_echo_source_cmd
static vlib_cli_command_t bfd_cli_udp_del_echo_source_cmd
(constructor) VLIB_CLI_COMMAND (bfd_cli_udp_del_echo_source_cmd)
Definition: bfd_cli.c:968
format_ip4_address
format_function_t format_ip4_address
Definition: format.h:73
ip4
vl_api_ip4_address_t ip4
Definition: one.api:376
optional
static const unsigned optional
Definition: bfd_cli.c:378
unformat_line_input
unformat_function_t unformat_line_input
Definition: format.h:275
show_bfd
static clib_error_t * show_bfd(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:121
vnet_get_sw_interface_or_null
static vnet_sw_interface_t * vnet_get_sw_interface_or_null(vnet_main_t *vnm, u32 sw_if_index)
Definition: interface_funcs.h:64
bfd_session_s::config_desired_min_tx_usec
u32 config_desired_min_tx_usec
configured desired min tx interval (microseconds)
Definition: bfd_main.h:112
BFD_KEY_ID_STR
#define BFD_KEY_ID_STR
Definition: bfd_cli.c:370
clib_error_return
#define clib_error_return(e, args...)
Definition: error.h:99
vlib_cli_command_t::path
char * path
Definition: cli.h:96
show_bfd_command
static vlib_cli_command_t show_bfd_command
(constructor) VLIB_CLI_COMMAND (show_bfd_command)
Definition: bfd_cli.c:216
bfd_auth_set_key
vnet_api_error_t bfd_auth_set_key(u32 conf_key_id, u8 auth_type, u8 key_len, const u8 *key)
create or modify bfd authentication key
Definition: bfd_main.c:2153
bfd_auth_key_t::conf_key_id
u32 conf_key_id
global configuration key ID
Definition: bfd_main.h:43
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
bfd_cli_key_del_command
static vlib_cli_command_t bfd_cli_key_del_command
(constructor) VLIB_CLI_COMMAND (bfd_cli_key_del_command)
Definition: bfd_cli.c:359
bfd_poll_state_string
const char * bfd_poll_state_string(bfd_poll_state_e state)
Definition: bfd_main.c:150
bfd_session_s::transmit_interval_nsec
u64 transmit_interval_nsec
transmit interval
Definition: bfd_main.h:163
format_vnet_api_errno
static u8 * format_vnet_api_errno(u8 *s, va_list *args)
Definition: api_errno.h:172
foreach_bfd_cli_udp_session_set_flags_cli_param
#define foreach_bfd_cli_udp_session_set_flags_cli_param(F)
format_bfd_session_cli
static u8 * format_bfd_session_cli(u8 *s, va_list *args)
Definition: bfd_cli.c:30
unformat_input_t
struct _unformat_input_t unformat_input_t
bfd_session_s::local_seq_number
u32 local_seq_number
sequence number incremented occasionally or always (if meticulous)
Definition: bfd_main.h:214
bfd_cli_udp_session_add
static clib_error_t * bfd_cli_udp_session_add(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:401
bfd_cli_udp_session_del
static clib_error_t * bfd_cli_udp_session_del(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:574
bfd_udp_auth_activate
vnet_api_error_t bfd_udp_auth_activate(u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr, u32 conf_key_id, u8 bfd_key_id, u8 is_delayed)
activate authentication for existing session
Definition: bfd_udp.c:852
clib_time_t::seconds_per_clock
f64 seconds_per_clock
Definition: time.h:58
key
typedef key
Definition: ipsec_types.api:88
unformat_token
unformat_function_t unformat_token
Definition: format.h:278
bfd_session_s::bs_idx
u32 bs_idx
index in bfd_main.sessions pool
Definition: bfd_main.h:88
bfd_cli_udp_set_echo_source_cmd
static vlib_cli_command_t bfd_cli_udp_set_echo_source_cmd
(constructor) VLIB_CLI_COMMAND (bfd_cli_udp_set_echo_source_cmd)
Definition: bfd_cli.c:945
unformat
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:978
bfd_main_t
Definition: bfd_main.h:265
bfd_main.h
BFD global declarations.
pool_foreach
#define pool_foreach(VAR, POOL)
Iterate through pool.
Definition: pool.h:534
bfd_cli_udp_session_auth_activate_command
static vlib_cli_command_t bfd_cli_udp_session_auth_activate_command
(constructor) VLIB_CLI_COMMAND (bfd_cli_udp_session_auth_activate_command)
Definition: bfd_cli.c:803
bfd_session_s::remote_detect_mult
u8 remote_detect_mult
remote detect multiplier
Definition: bfd_main.h:151
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
bfd_cli_udp_session_mod_command
static vlib_cli_command_t bfd_cli_udp_session_mod_command
(constructor) VLIB_CLI_COMMAND (bfd_cli_udp_session_mod_command)
Definition: bfd_cli.c:560
bfd_session_s::remote_min_echo_rx_usec
u64 remote_min_echo_rx_usec
remote min echo rx interval (microseconds)
Definition: bfd_main.h:136
bfd_session_s
Definition: bfd_main.h:85
CLIB_UNUSED
#define CLIB_UNUSED(x)
Definition: clib.h:90
vnet_get_hw_interface
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
Definition: interface_funcs.h:44
format.h
bfd_session_s::local_state
bfd_state_e local_state
session state
Definition: bfd_main.h:91
unformat_check_input
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:163
bfd_nsec_to_usec
u32 bfd_nsec_to_usec(u64 nsec)
Definition: bfd_main.c:54
bfd_session_s::remote_seq_number
u32 remote_seq_number
remote sequence number
Definition: bfd_main.h:217
bfd_auth_type_str
const char * bfd_auth_type_str(bfd_auth_type_e auth_type)
Definition: bfd_protocol.c:151
foreach_bfd_cli_udp_session_auth_activate_cli_param
#define foreach_bfd_cli_udp_session_auth_activate_cli_param(F)
bfd_main_t::sessions
bfd_session_t * sessions
pool of bfd sessions context data
Definition: bfd_main.h:285
bfd_cli_udp_session_mod
static clib_error_t * bfd_cli_udp_session_mod(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:499
format_unformat_error
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
bfd_session_s::curr_key
bfd_auth_key_t * curr_key
current key in use
Definition: bfd_main.h:205
format.h
VLIB_CLI_COMMAND
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:163
ip4_address_t
Definition: ip4_packet.h:50
vlib_cli_output
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:716
bfd_udp_session_set_flags
vnet_api_error_t bfd_udp_session_set_flags(vlib_main_t *vm, u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr, u8 admin_up_down)
set session admin down/up
Definition: bfd_udp.c:831
foreach_bfd_cli_udp_session_del_cli_param
#define foreach_bfd_cli_udp_session_del_cli_param(F)
bfd_diag_code_string
const char * bfd_diag_code_string(bfd_diag_code_e diag)
Definition: bfd_protocol.c:164
unformat_hex_string
unformat_function_t unformat_hex_string
Definition: format.h:281
DECLARE
#define DECLARE(t, n, s, r,...)
Definition: bfd_cli.c:380
foreach_bfd_cli_udp_session_add_cli_param
#define foreach_bfd_cli_udp_session_add_cli_param(F)
bfd_udp_mod_session
vnet_api_error_t bfd_udp_mod_session(u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr, u32 desired_min_tx_usec, u32 required_min_rx_usec, u8 detect_mult)
modify existing session
Definition: bfd_udp.c:783
vnet_hw_interface_t
Definition: interface.h:638
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
bfd_session_s::curr_bfd_key_id
u8 curr_bfd_key_id
current key ID sent out in bfd packet
Definition: bfd_main.h:223
foreach_bfd_cli_udp_session_auth_deactivate_cli_param
#define foreach_bfd_cli_udp_session_auth_deactivate_cli_param(F)
bfd_session_s::local_detect_mult
u8 local_detect_mult
configured detect multiplier
Definition: bfd_main.h:145
bfd_auth_del_key
vnet_api_error_t bfd_auth_del_key(u32 conf_key_id)
delete existing authentication key
Definition: bfd_main.c:2203
u64
unsigned long u64
Definition: types.h:89
format
description fragment has unexpected format
Definition: map.api:433
bfd_session_s::local_diag
bfd_diag_code_e local_diag
local diagnostics
Definition: bfd_main.h:100
bfd_cli_udp_session_auth_activate
static clib_error_t * bfd_cli_udp_session_auth_activate(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:718
bfd_cli_udp_session_auth_deactivate
static clib_error_t * bfd_cli_udp_session_auth_deactivate(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:816
u32
unsigned int u32
Definition: types.h:88
bfd_udp_add_session
vnet_api_error_t bfd_udp_add_session(u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr, u32 desired_min_tx_usec, u32 required_min_rx_usec, u8 detect_mult, u8 is_authenticated, u32 conf_key_id, u8 bfd_key_id)
create a new bfd session
Definition: bfd_udp.c:742
bfd_session_s::remote_demand
u8 remote_demand
1 if remote system sets demand mode, 0 otherwise
Definition: bfd_main.h:148
ip6
vl_api_ip6_address_t ip6
Definition: one.api:424
bfd_cli_udp_session_auth_deactivate_command
static vlib_cli_command_t bfd_cli_udp_session_auth_deactivate_command
(constructor) VLIB_CLI_COMMAND (bfd_cli_udp_session_auth_deactivate_command)
Definition: bfd_cli.c:888
cli.h
bfd_udp_session_t::key
bfd_udp_key_t key
key identifying this session
Definition: bfd_udp.h:47
bfd_udp_del_session
vnet_api_error_t bfd_udp_del_session(u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr)
delete existing session
Definition: bfd_udp.c:810
bfd_cli_udp_session_add_command
static vlib_cli_command_t bfd_cli_udp_session_add_command
(constructor) VLIB_CLI_COMMAND (bfd_cli_udp_session_add_command)
Definition: bfd_cli.c:481
bfd_session_s::remote_state
bfd_state_e remote_state
remote session state
Definition: bfd_main.h:94
bfd_udp_get_echo_source
void bfd_udp_get_echo_source(int *is_set, u32 *sw_if_index, int *have_usable_ip4, ip4_address_t *ip4, int *have_usable_ip6, ip6_address_t *ip6)
get echo source information - used by CLI
Definition: bfd_udp.c:235
pool_elts
static uword pool_elts(void *v)
Number of active elements in a pool.
Definition: pool.h:127
bfd_cli_udp_session_set_flags
static clib_error_t * bfd_cli_udp_session_set_flags(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:635
DETECT_MULT_STR
#define DETECT_MULT_STR
Definition: bfd_cli.c:373
DELAYED_STR
#define DELAYED_STR
Definition: bfd_cli.c:375
bfd_cli_key_add_command
static vlib_cli_command_t bfd_cli_key_add_command
(constructor) VLIB_CLI_COMMAND (bfd_cli_key_add_command)
Definition: bfd_cli.c:314
bfd_cli_udp_session_set_flags_command
static vlib_cli_command_t bfd_cli_udp_session_set_flags_command
(constructor) VLIB_CLI_COMMAND (bfd_cli_udp_session_set_flags_command)
Definition: bfd_cli.c:706
now
f64 now
Definition: nat44_ei_out2in.c:710
bfd_main
bfd_main_t bfd_main
Definition: bfd_main.c:2236
vnet_main
vnet_main_t vnet_main
Definition: misc.c:43
vlib_main_t
Definition: main.h:102
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
foreach_bfd_cli_udp_set_echo_source_cli_param
#define foreach_bfd_cli_udp_set_echo_source_cli_param(F)
format_ip6_address
format_function_t format_ip6_address
Definition: format.h:91
bfd_udp_del_echo_source
vnet_api_error_t bfd_udp_del_echo_source()
unset echo-source interface
bfd_session_s::poll_state
bfd_poll_state_e poll_state
state info regarding poll sequence
Definition: bfd_main.h:193
vnet_sw_interface_t::hw_if_index
u32 hw_if_index
Definition: interface.h:886
vnet_hw_interface_t::name
u8 * name
Definition: interface.h:678
rv
int __clib_unused rv
Definition: application.c:491
bfd_state_string
const char * bfd_state_string(bfd_state_e state)
Definition: bfd_protocol.c:177
bfd_cli_udp_set_echo_source
static clib_error_t * bfd_cli_udp_set_echo_source(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:900
ADMIN_STR
#define ADMIN_STR
Definition: bfd_cli.c:374
api_errno.h
bfd_auth_key_t
Definition: bfd_main.h:40
bfd_session_s::remote_min_rx_usec
u64 remote_min_rx_usec
remote min rx interval (microseconds)
Definition: bfd_main.h:130
bfd_session_s::auth
struct bfd_session_s::@149 auth
authentication information
bfd_session_s::config_required_min_rx_usec
u32 config_required_min_rx_usec
configured required min rx interval (microseconds)
Definition: bfd_main.h:121
vlib_cli_command_t
Definition: cli.h:92
clib_cpu_time_now
static u64 clib_cpu_time_now(void)
Definition: time.h:81
mandatory
static const unsigned mandatory
Definition: bfd_cli.c:377
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
warnings.h
bfd_session_s::udp
bfd_udp_session_t udp
Definition: bfd_main.h:241
bfd_main_t::auth_keys
bfd_auth_key_t * auth_keys
pool of authentication keys
Definition: bfd_main.h:313
bfd_udp_set_echo_source
vnet_api_error_t bfd_udp_set_echo_source(u32 loopback_sw_if_index)
set echo-source interface
Definition: bfd_udp.c:83
bfd_session_s::echo_last_tx_nsec
u64 echo_last_tx_nsec
timestamp of last echo packet transmitted
Definition: bfd_main.h:181
bfd_api.h
BFD API declarations.
UNFORMAT_END_OF_INPUT
#define UNFORMAT_END_OF_INPUT
Definition: format.h:137
bfd_session_s::echo_transmit_interval_nsec
u64 echo_transmit_interval_nsec
transmit interval for echo packets
Definition: bfd_main.h:175
vnet_api_error_t
vnet_api_error_t
Definition: api_errno.h:162
bfd_cli_udp_del_echo_source
static clib_error_t * bfd_cli_udp_del_echo_source(vlib_main_t *vm, unformat_input_t *input, CLIB_UNUSED(vlib_cli_command_t *lmd))
Definition: bfd_cli.c:953
bfd_session_s::echo_last_rx_nsec
u64 echo_last_rx_nsec
timestamp of last echo packet received
Definition: bfd_main.h:184
bfd_session_s::echo
u8 echo
1 is echo function is active, 0 otherwise
Definition: bfd_main.h:154