2 * bgp_bfd.c: BGP BFD handling routines
4 * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
6 * This file is part of GNU Zebra.
8 * GNU Zebra is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
13 * GNU Zebra is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
37 #include "bgpd/bgpd.h"
39 #include "bgpd/bgp_bfd.h"
40 #include "bgpd/bgp_debug.h"
41 #include "bgpd/bgp_vty.h"
43 extern struct zclient
*zclient
;
46 * bgp_bfd_peer_group2peer_copy - Copy the BFD information from peer group
50 void bgp_bfd_peer_group2peer_copy(struct peer
*conf
, struct peer
*peer
)
52 struct bfd_info
*bfd_info
;
53 struct bfd_info
*conf_bfd_info
;
58 conf_bfd_info
= (struct bfd_info
*)conf
->bfd_info
;
60 peer
->bfd_info
= bfd_info_create();
62 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
64 /* Copy BFD parameter values */
65 bfd_info
->required_min_rx
= conf_bfd_info
->required_min_rx
;
66 bfd_info
->desired_min_tx
= conf_bfd_info
->desired_min_tx
;
67 bfd_info
->detect_mult
= conf_bfd_info
->detect_mult
;
68 bfd_info
->type
= conf_bfd_info
->type
;
72 * bgp_bfd_is_peer_multihop - returns whether BFD peer is multi-hop or single
75 int bgp_bfd_is_peer_multihop(struct peer
*peer
)
77 struct bfd_info
*bfd_info
;
79 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
84 if ((bfd_info
->type
== BFD_TYPE_MULTIHOP
)
85 || ((peer
->sort
== BGP_PEER_IBGP
) && !peer
->shared_network
)
86 || is_ebgp_multihop_configured(peer
))
93 * bgp_bfd_peer_sendmsg - Format and send a Peer register/Unregister
94 * command to Zebra to be forwarded to BFD
96 static void bgp_bfd_peer_sendmsg(struct peer
*peer
, int command
)
98 struct bfd_info
*bfd_info
;
99 int multihop
, cbit
= 0;
102 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
104 vrf_id
= peer
->bgp
->vrf_id
;
106 if (command
== ZEBRA_BFD_DEST_DEREGISTER
) {
108 CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_TYPE_MULTIHOP
);
109 UNSET_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_TYPE_MULTIHOP
);
111 multihop
= bgp_bfd_is_peer_multihop(peer
);
112 if ((command
== ZEBRA_BFD_DEST_REGISTER
) && multihop
)
113 SET_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_TYPE_MULTIHOP
);
115 /* while graceful restart with fwd path preserved
116 * and bfd controlplane check not configured is not kept
117 * keep bfd independent controlplane bit set to 1
119 if (!bgp_flag_check(peer
->bgp
, BGP_FLAG_GRACEFUL_RESTART
)
120 && !bgp_flag_check(peer
->bgp
, BGP_FLAG_GR_PRESERVE_FWD
)
121 && !CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
))
122 SET_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CBIT_ON
);
124 cbit
= CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CBIT_ON
);
126 if (peer
->su
.sa
.sa_family
== AF_INET
)
128 zclient
, bfd_info
, AF_INET
, &peer
->su
.sin
.sin_addr
,
129 (peer
->su_local
) ? &peer
->su_local
->sin
.sin_addr
: NULL
,
130 (peer
->nexthop
.ifp
) ? peer
->nexthop
.ifp
->name
: NULL
,
131 peer
->ttl
, multihop
, cbit
, command
, 1, vrf_id
);
132 else if (peer
->su
.sa
.sa_family
== AF_INET6
)
134 zclient
, bfd_info
, AF_INET6
, &peer
->su
.sin6
.sin6_addr
,
135 (peer
->su_local
) ? &peer
->su_local
->sin6
.sin6_addr
137 (peer
->nexthop
.ifp
) ? peer
->nexthop
.ifp
->name
: NULL
,
138 peer
->ttl
, multihop
, cbit
, command
, 1, vrf_id
);
142 * bgp_bfd_register_peer - register a peer with BFD through zebra
143 * for monitoring the peer rechahability.
145 void bgp_bfd_register_peer(struct peer
*peer
)
147 struct bfd_info
*bfd_info
;
151 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
153 /* Check if BFD is enabled and peer has already been registered with BFD
155 if (CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_REG
))
158 bgp_bfd_peer_sendmsg(peer
, ZEBRA_BFD_DEST_REGISTER
);
162 * bgp_bfd_deregister_peer - deregister a peer with BFD through zebra
163 * for stopping the monitoring of the peer
166 void bgp_bfd_deregister_peer(struct peer
*peer
)
168 struct bfd_info
*bfd_info
;
172 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
174 /* Check if BFD is eanbled and peer has not been registered */
175 if (!CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_REG
))
178 bfd_info
->status
= BFD_STATUS_DOWN
;
179 bfd_info
->last_update
= bgp_clock();
181 bgp_bfd_peer_sendmsg(peer
, ZEBRA_BFD_DEST_DEREGISTER
);
185 * bgp_bfd_update_peer - update peer with BFD with new BFD paramters
188 static void bgp_bfd_update_peer(struct peer
*peer
)
190 struct bfd_info
*bfd_info
;
194 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
196 /* Check if the peer has been registered with BFD*/
197 if (!CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_REG
))
200 bgp_bfd_peer_sendmsg(peer
, ZEBRA_BFD_DEST_UPDATE
);
204 * bgp_bfd_update_type - update session type with BFD through zebra.
206 static void bgp_bfd_update_type(struct peer
*peer
)
208 struct bfd_info
*bfd_info
;
213 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
215 /* Check if the peer has been registered with BFD*/
216 if (!CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_REG
))
219 if (bfd_info
->type
== BFD_TYPE_NOT_CONFIGURED
) {
220 multihop
= bgp_bfd_is_peer_multihop(peer
);
222 && !CHECK_FLAG(bfd_info
->flags
,
223 BFD_FLAG_BFD_TYPE_MULTIHOP
))
224 || (!multihop
&& CHECK_FLAG(bfd_info
->flags
,
225 BFD_FLAG_BFD_TYPE_MULTIHOP
))) {
226 bgp_bfd_peer_sendmsg(peer
, ZEBRA_BFD_DEST_DEREGISTER
);
227 bgp_bfd_peer_sendmsg(peer
, ZEBRA_BFD_DEST_REGISTER
);
230 if ((bfd_info
->type
== BFD_TYPE_MULTIHOP
231 && !CHECK_FLAG(bfd_info
->flags
,
232 BFD_FLAG_BFD_TYPE_MULTIHOP
))
233 || (bfd_info
->type
== BFD_TYPE_SINGLEHOP
234 && CHECK_FLAG(bfd_info
->flags
,
235 BFD_FLAG_BFD_TYPE_MULTIHOP
))) {
236 bgp_bfd_peer_sendmsg(peer
, ZEBRA_BFD_DEST_DEREGISTER
);
237 bgp_bfd_peer_sendmsg(peer
, ZEBRA_BFD_DEST_REGISTER
);
243 * bgp_bfd_dest_replay - Replay all the peers that have BFD enabled
246 static int bgp_bfd_dest_replay(ZAPI_CALLBACK_ARGS
)
248 struct listnode
*mnode
, *node
, *nnode
;
252 if (BGP_DEBUG(zebra
, ZEBRA
))
253 zlog_debug("Zebra: BFD Dest replay request");
255 /* Send the client registration */
256 bfd_client_sendmsg(zclient
, ZEBRA_BFD_CLIENT_REGISTER
, vrf_id
);
258 /* Replay the peer, if BFD is enabled in BGP */
260 for (ALL_LIST_ELEMENTS_RO(bm
->bgp
, mnode
, bgp
))
261 for (ALL_LIST_ELEMENTS(bgp
->peer
, node
, nnode
, peer
)) {
262 bgp_bfd_update_peer(peer
);
269 * bgp_bfd_peer_status_update - Update the BFD status if it has changed. Bring
270 * down the peer if the BFD session went down from
273 static void bgp_bfd_peer_status_update(struct peer
*peer
, int status
,
276 struct bfd_info
*bfd_info
;
279 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
281 if (bfd_info
->status
== status
)
284 old_status
= bfd_info
->status
;
285 bfd_info
->status
= status
;
286 bfd_info
->last_update
= bgp_clock();
288 if (status
!= old_status
) {
289 if (BGP_DEBUG(neighbor_events
, NEIGHBOR_EVENTS
))
290 zlog_debug("[%s]: BFD %s", peer
->host
,
291 bfd_get_status_str(status
));
293 if ((status
== BFD_STATUS_DOWN
) && (old_status
== BFD_STATUS_UP
)) {
294 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_NSF_MODE
) &&
295 CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
) &&
297 zlog_info("%s BFD DOWN message ignored in the process"
298 " of graceful restart when C bit is cleared",
302 peer
->last_reset
= PEER_DOWN_BFD_DOWN
;
303 BGP_EVENT_ADD(peer
, BGP_Stop
);
305 if ((status
== BFD_STATUS_UP
) && (old_status
== BFD_STATUS_DOWN
)
306 && peer
->status
!= Established
) {
307 if (!BGP_PEER_START_SUPPRESSED(peer
)) {
308 bgp_fsm_event_update(peer
, 1);
309 BGP_EVENT_ADD(peer
, BGP_Start
);
315 * bgp_bfd_dest_update - Find the peer for which the BFD status
316 * has changed and bring down the peer
317 * connectivity if the BFD session went down.
319 static int bgp_bfd_dest_update(ZAPI_CALLBACK_ARGS
)
321 struct interface
*ifp
;
327 ifp
= bfd_get_peer_info(zclient
->ibuf
, &dp
, &sp
, &status
,
328 &remote_cbit
, vrf_id
);
330 if (BGP_DEBUG(zebra
, ZEBRA
)) {
331 char buf
[2][PREFIX2STR_BUFFER
];
332 prefix2str(&dp
, buf
[0], sizeof(buf
[0]));
335 "Zebra: vrf %u interface %s bfd destination %s %s %s",
336 vrf_id
, ifp
->name
, buf
[0],
337 bfd_get_status_str(status
),
338 remote_cbit
? "(cbit on)" : "");
340 prefix2str(&sp
, buf
[1], sizeof(buf
[1]));
342 "Zebra: vrf %u source %s bfd destination %s %s %s",
343 vrf_id
, buf
[1], buf
[0],
344 bfd_get_status_str(status
),
345 remote_cbit
? "(cbit on)" : "");
349 /* Bring the peer down if BFD is enabled in BGP */
351 struct listnode
*mnode
, *node
, *nnode
;
355 for (ALL_LIST_ELEMENTS_RO(bm
->bgp
, mnode
, bgp
))
356 for (ALL_LIST_ELEMENTS(bgp
->peer
, node
, nnode
, peer
)) {
360 if ((dp
.family
== AF_INET
)
361 && (peer
->su
.sa
.sa_family
== AF_INET
)) {
362 if (dp
.u
.prefix4
.s_addr
363 != peer
->su
.sin
.sin_addr
.s_addr
)
365 } else if ((dp
.family
== AF_INET6
)
366 && (peer
->su
.sa
.sa_family
368 if (memcmp(&dp
.u
.prefix6
,
369 &peer
->su
.sin6
.sin6_addr
,
370 sizeof(struct in6_addr
)))
375 if (ifp
&& (ifp
== peer
->nexthop
.ifp
)) {
376 bgp_bfd_peer_status_update(peer
,
383 if ((sp
.family
== AF_INET
)
384 && (peer
->su_local
->sa
.sa_family
386 if (sp
.u
.prefix4
.s_addr
387 != peer
->su_local
->sin
390 } else if ((sp
.family
== AF_INET6
)
391 && (peer
->su_local
->sa
394 if (memcmp(&sp
.u
.prefix6
,
395 &peer
->su_local
->sin6
403 if ((vrf_id
!= VRF_DEFAULT
)
404 && (peer
->bgp
->vrf_id
!= vrf_id
))
407 bgp_bfd_peer_status_update(peer
,
418 * bgp_bfd_peer_param_set - Set the configured BFD paramter values for peer.
420 static int bgp_bfd_peer_param_set(struct peer
*peer
, uint32_t min_rx
,
421 uint32_t min_tx
, uint8_t detect_mult
,
424 struct peer_group
*group
;
425 struct listnode
*node
, *nnode
;
428 bfd_set_param((struct bfd_info
**)&(peer
->bfd_info
), min_rx
, min_tx
,
429 detect_mult
, defaults
, &command
);
431 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
)) {
433 for (ALL_LIST_ELEMENTS(group
->peer
, node
, nnode
, peer
)) {
435 bfd_set_param((struct bfd_info
**)&(peer
->bfd_info
),
436 min_rx
, min_tx
, detect_mult
, defaults
,
439 if ((peer
->status
== Established
)
440 && (command
== ZEBRA_BFD_DEST_REGISTER
))
441 bgp_bfd_register_peer(peer
);
442 else if (command
== ZEBRA_BFD_DEST_UPDATE
)
443 bgp_bfd_update_peer(peer
);
446 if ((peer
->status
== Established
)
447 && (command
== ZEBRA_BFD_DEST_REGISTER
))
448 bgp_bfd_register_peer(peer
);
449 else if (command
== ZEBRA_BFD_DEST_UPDATE
)
450 bgp_bfd_update_peer(peer
);
456 * bgp_bfd_peer_param_unset - Delete the configured BFD paramter values for
459 static int bgp_bfd_peer_param_unset(struct peer
*peer
)
461 struct peer_group
*group
;
462 struct listnode
*node
, *nnode
;
467 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
)) {
468 bfd_info_free(&(peer
->bfd_info
));
470 for (ALL_LIST_ELEMENTS(group
->peer
, node
, nnode
, peer
)) {
471 bgp_bfd_deregister_peer(peer
);
472 bfd_info_free(&(peer
->bfd_info
));
475 bgp_bfd_deregister_peer(peer
);
476 bfd_info_free(&(peer
->bfd_info
));
482 * bgp_bfd_peer_param_type_set - set the BFD session type (multihop or
485 static int bgp_bfd_peer_param_type_set(struct peer
*peer
,
486 enum bfd_sess_type type
)
488 struct peer_group
*group
;
489 struct listnode
*node
, *nnode
;
491 struct bfd_info
*bfd_info
;
494 bfd_set_param((struct bfd_info
**)&(peer
->bfd_info
),
495 BFD_DEF_MIN_RX
, BFD_DEF_MIN_TX
,
496 BFD_DEF_DETECT_MULT
, 1, &command
);
498 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
499 bfd_info
->type
= type
;
501 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
)) {
503 for (ALL_LIST_ELEMENTS(group
->peer
, node
, nnode
, peer
)) {
507 (struct bfd_info
**)&(peer
->bfd_info
),
508 BFD_DEF_MIN_RX
, BFD_DEF_MIN_TX
,
509 BFD_DEF_DETECT_MULT
, 1, &command
);
511 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
512 bfd_info
->type
= type
;
514 if (peer
->status
== Established
) {
515 if (command
== ZEBRA_BFD_DEST_REGISTER
)
516 bgp_bfd_register_peer(peer
);
518 bgp_bfd_update_type(peer
);
522 if (peer
->status
== Established
) {
523 if (command
== ZEBRA_BFD_DEST_REGISTER
)
524 bgp_bfd_register_peer(peer
);
526 bgp_bfd_update_type(peer
);
534 * bgp_bfd_peer_config_write - Write the peer BFD configuration.
536 void bgp_bfd_peer_config_write(struct vty
*vty
, struct peer
*peer
, char *addr
)
538 struct bfd_info
*bfd_info
;
543 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
545 if (CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_PARAM_CFG
))
547 vty_out(vty
, " neighbor %s bfd\n", addr
);
549 vty_out(vty
, " neighbor %s bfd %d %d %d\n", addr
,
550 bfd_info
->detect_mult
, bfd_info
->required_min_rx
,
551 bfd_info
->desired_min_tx
);
552 #endif /* HAVE_BFDD */
554 if (bfd_info
->type
!= BFD_TYPE_NOT_CONFIGURED
)
555 vty_out(vty
, " neighbor %s bfd %s\n", addr
,
556 (bfd_info
->type
== BFD_TYPE_MULTIHOP
) ? "multihop"
559 if (!CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_PARAM_CFG
)
560 && (bfd_info
->type
== BFD_TYPE_NOT_CONFIGURED
))
561 vty_out(vty
, " neighbor %s bfd\n", addr
);
563 if (CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
))
564 vty_out(vty
, " neighbor %s bfd check-control-plane-failure\n", addr
);
568 * bgp_bfd_show_info - Show the peer BFD information.
570 void bgp_bfd_show_info(struct vty
*vty
, struct peer
*peer
, bool use_json
,
571 json_object
*json_neigh
)
573 bfd_show_info(vty
, (struct bfd_info
*)peer
->bfd_info
,
574 bgp_bfd_is_peer_multihop(peer
), 0, use_json
, json_neigh
);
579 "neighbor <A.B.C.D|X:X::X:X|WORD> bfd",
582 "Enables BFD support\n")
588 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
590 return CMD_WARNING_CONFIG_FAILED
;
592 ret
= bgp_bfd_peer_param_set(peer
, BFD_DEF_MIN_RX
, BFD_DEF_MIN_TX
,
593 BFD_DEF_DETECT_MULT
, 1);
595 return bgp_vty_return(vty
, ret
);
604 #endif /* HAVE_BFDD */
606 neighbor_bfd_param_cmd
,
607 "neighbor <A.B.C.D|X:X::X:X|WORD> bfd (2-255) (50-60000) (50-60000)",
610 "Enables BFD support\n"
611 "Detect Multiplier\n"
612 "Required min receive interval\n"
613 "Desired min transmit interval\n")
616 int idx_number_1
= 3;
617 int idx_number_2
= 4;
618 int idx_number_3
= 5;
625 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
627 return CMD_WARNING_CONFIG_FAILED
;
629 if ((ret
= bfd_validate_param(
630 vty
, argv
[idx_number_1
]->arg
, argv
[idx_number_2
]->arg
,
631 argv
[idx_number_3
]->arg
, &dm_val
, &rx_val
, &tx_val
))
635 ret
= bgp_bfd_peer_param_set(peer
, rx_val
, tx_val
, dm_val
, 0);
637 return bgp_vty_return(vty
, ret
);
642 DEFUN_HIDDEN (neighbor_bfd_type
,
643 neighbor_bfd_type_cmd
,
644 "neighbor <A.B.C.D|X:X::X:X|WORD> bfd <multihop|singlehop>",
647 "Enables BFD support\n"
649 "Single hop session\n")
654 enum bfd_sess_type type
;
657 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
659 return CMD_WARNING_CONFIG_FAILED
;
661 if (strmatch(argv
[idx_hop
]->text
, "singlehop"))
662 type
= BFD_TYPE_SINGLEHOP
;
663 else if (strmatch(argv
[idx_hop
]->text
, "multihop"))
664 type
= BFD_TYPE_MULTIHOP
;
666 return CMD_WARNING_CONFIG_FAILED
;
668 ret
= bgp_bfd_peer_param_type_set(peer
, type
);
670 return bgp_vty_return(vty
, ret
);
675 static int bgp_bfd_set_check_controlplane_failure_peer(struct vty
*vty
, struct peer
*peer
,
678 struct bfd_info
*bfd_info
;
680 if (!peer
->bfd_info
) {
683 vty_out(vty
, "%% Specify bfd command first\n");
684 return CMD_WARNING_CONFIG_FAILED
;
686 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
688 if (!CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
)) {
689 SET_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
);
690 bgp_bfd_update_peer(peer
);
693 if (CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
)) {
694 UNSET_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
);
695 bgp_bfd_update_peer(peer
);
702 DEFUN (neighbor_bfd_check_controlplane_failure
,
703 neighbor_bfd_check_controlplane_failure_cmd
,
704 "[no] neighbor <A.B.C.D|X:X::X:X|WORD> bfd check-control-plane-failure",
709 "Link dataplane status with BGP controlplane\n")
711 const char *no
= strmatch(argv
[0]->text
, "no") ? "no" : NULL
;
714 struct peer_group
*group
;
715 struct listnode
*node
, *nnode
;
716 int ret
= CMD_SUCCESS
;
722 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
724 vty_out(vty
, "%% Specify remote-as or peer-group commands first\n");
725 return CMD_WARNING_CONFIG_FAILED
;
727 if (!peer
->bfd_info
) {
730 vty_out(vty
, "%% Specify bfd command first\n");
731 return CMD_WARNING_CONFIG_FAILED
;
733 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
)) {
735 for (ALL_LIST_ELEMENTS(group
->peer
, node
, nnode
, peer
))
736 ret
= bgp_bfd_set_check_controlplane_failure_peer(vty
, peer
, no
);
738 ret
= bgp_bfd_set_check_controlplane_failure_peer(vty
, peer
, no
);
742 DEFUN (no_neighbor_bfd
,
745 "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd",
747 "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd [(2-255) (50-60000) (50-60000)]",
748 #endif /* HAVE_BFDD */
752 "Disables BFD support\n"
754 "Detect Multiplier\n"
755 "Required min receive interval\n"
756 "Desired min transmit interval\n"
757 #endif /* !HAVE_BFDD */
764 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
766 return CMD_WARNING_CONFIG_FAILED
;
768 ret
= bgp_bfd_peer_param_unset(peer
);
770 return bgp_vty_return(vty
, ret
);
776 DEFUN_HIDDEN (no_neighbor_bfd_type
,
777 no_neighbor_bfd_type_cmd
,
778 "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd <multihop|singlehop>",
782 "Disables BFD support\n"
784 "Singlehop session\n")
790 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
792 return CMD_WARNING_CONFIG_FAILED
;
797 ret
= bgp_bfd_peer_param_type_set(peer
, BFD_TYPE_NOT_CONFIGURED
);
799 return bgp_vty_return(vty
, ret
);
804 void bgp_bfd_init(void)
808 /* Initialize BFD client functions */
809 zclient
->interface_bfd_dest_update
= bgp_bfd_dest_update
;
810 zclient
->bfd_dest_replay
= bgp_bfd_dest_replay
;
812 /* "neighbor bfd" commands. */
813 install_element(BGP_NODE
, &neighbor_bfd_cmd
);
814 install_element(BGP_NODE
, &neighbor_bfd_param_cmd
);
815 install_element(BGP_NODE
, &neighbor_bfd_type_cmd
);
816 install_element(BGP_NODE
, &neighbor_bfd_check_controlplane_failure_cmd
);
817 install_element(BGP_NODE
, &no_neighbor_bfd_cmd
);
818 install_element(BGP_NODE
, &no_neighbor_bfd_type_cmd
);