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_SET_CLIENT_STATUS(bfd_info
->status
, status
);
287 bfd_info
->last_update
= bgp_clock();
289 if (status
!= old_status
) {
290 if (BGP_DEBUG(neighbor_events
, NEIGHBOR_EVENTS
))
291 zlog_debug("[%s]: BFD %s", peer
->host
,
292 bfd_get_status_str(status
));
294 if ((status
== BFD_STATUS_DOWN
) && (old_status
== BFD_STATUS_UP
)) {
295 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_NSF_MODE
) &&
296 CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
) &&
298 zlog_info("%s BFD DOWN message ignored in the process"
299 " of graceful restart when C bit is cleared",
303 peer
->last_reset
= PEER_DOWN_BFD_DOWN
;
304 BGP_EVENT_ADD(peer
, BGP_Stop
);
306 if ((status
== BFD_STATUS_UP
) && (old_status
== BFD_STATUS_DOWN
)
307 && peer
->status
!= Established
) {
308 if (!BGP_PEER_START_SUPPRESSED(peer
)) {
309 bgp_fsm_event_update(peer
, 1);
310 BGP_EVENT_ADD(peer
, BGP_Start
);
316 * bgp_bfd_dest_update - Find the peer for which the BFD status
317 * has changed and bring down the peer
318 * connectivity if the BFD session went down.
320 static int bgp_bfd_dest_update(ZAPI_CALLBACK_ARGS
)
322 struct interface
*ifp
;
328 ifp
= bfd_get_peer_info(zclient
->ibuf
, &dp
, &sp
, &status
,
329 &remote_cbit
, vrf_id
);
331 if (BGP_DEBUG(zebra
, ZEBRA
)) {
332 char buf
[2][PREFIX2STR_BUFFER
];
333 prefix2str(&dp
, buf
[0], sizeof(buf
[0]));
336 "Zebra: vrf %u interface %s bfd destination %s %s %s",
337 vrf_id
, ifp
->name
, buf
[0],
338 bfd_get_status_str(status
),
339 remote_cbit
? "(cbit on)" : "");
341 prefix2str(&sp
, buf
[1], sizeof(buf
[1]));
343 "Zebra: vrf %u source %s bfd destination %s %s %s",
344 vrf_id
, buf
[1], buf
[0],
345 bfd_get_status_str(status
),
346 remote_cbit
? "(cbit on)" : "");
350 /* Bring the peer down if BFD is enabled in BGP */
352 struct listnode
*mnode
, *node
, *nnode
;
356 for (ALL_LIST_ELEMENTS_RO(bm
->bgp
, mnode
, bgp
))
357 for (ALL_LIST_ELEMENTS(bgp
->peer
, node
, nnode
, peer
)) {
361 if ((dp
.family
== AF_INET
)
362 && (peer
->su
.sa
.sa_family
== AF_INET
)) {
363 if (dp
.u
.prefix4
.s_addr
364 != peer
->su
.sin
.sin_addr
.s_addr
)
366 } else if ((dp
.family
== AF_INET6
)
367 && (peer
->su
.sa
.sa_family
369 if (memcmp(&dp
.u
.prefix6
,
370 &peer
->su
.sin6
.sin6_addr
,
371 sizeof(struct in6_addr
)))
376 if (ifp
&& (ifp
== peer
->nexthop
.ifp
)) {
377 bgp_bfd_peer_status_update(peer
,
384 if ((sp
.family
== AF_INET
)
385 && (peer
->su_local
->sa
.sa_family
387 if (sp
.u
.prefix4
.s_addr
388 != peer
->su_local
->sin
391 } else if ((sp
.family
== AF_INET6
)
392 && (peer
->su_local
->sa
395 if (memcmp(&sp
.u
.prefix6
,
396 &peer
->su_local
->sin6
404 if ((vrf_id
!= VRF_DEFAULT
)
405 && (peer
->bgp
->vrf_id
!= vrf_id
))
408 bgp_bfd_peer_status_update(peer
,
419 * bgp_bfd_peer_param_set - Set the configured BFD paramter values for peer.
421 static int bgp_bfd_peer_param_set(struct peer
*peer
, uint32_t min_rx
,
422 uint32_t min_tx
, uint8_t detect_mult
,
425 struct peer_group
*group
;
426 struct listnode
*node
, *nnode
;
429 bfd_set_param((struct bfd_info
**)&(peer
->bfd_info
), min_rx
, min_tx
,
430 detect_mult
, defaults
, &command
);
432 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
)) {
434 for (ALL_LIST_ELEMENTS(group
->peer
, node
, nnode
, peer
)) {
436 bfd_set_param((struct bfd_info
**)&(peer
->bfd_info
),
437 min_rx
, min_tx
, detect_mult
, defaults
,
440 if ((peer
->status
== Established
)
441 && (command
== ZEBRA_BFD_DEST_REGISTER
))
442 bgp_bfd_register_peer(peer
);
443 else if (command
== ZEBRA_BFD_DEST_UPDATE
)
444 bgp_bfd_update_peer(peer
);
447 if ((peer
->status
== Established
)
448 && (command
== ZEBRA_BFD_DEST_REGISTER
))
449 bgp_bfd_register_peer(peer
);
450 else if (command
== ZEBRA_BFD_DEST_UPDATE
)
451 bgp_bfd_update_peer(peer
);
457 * bgp_bfd_peer_param_unset - Delete the configured BFD paramter values for
460 static int bgp_bfd_peer_param_unset(struct peer
*peer
)
462 struct peer_group
*group
;
463 struct listnode
*node
, *nnode
;
468 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
)) {
469 bfd_info_free(&(peer
->bfd_info
));
471 for (ALL_LIST_ELEMENTS(group
->peer
, node
, nnode
, peer
)) {
472 bgp_bfd_deregister_peer(peer
);
473 bfd_info_free(&(peer
->bfd_info
));
476 bgp_bfd_deregister_peer(peer
);
477 bfd_info_free(&(peer
->bfd_info
));
483 * bgp_bfd_peer_param_type_set - set the BFD session type (multihop or
486 static int bgp_bfd_peer_param_type_set(struct peer
*peer
,
487 enum bfd_sess_type type
)
489 struct peer_group
*group
;
490 struct listnode
*node
, *nnode
;
492 struct bfd_info
*bfd_info
;
495 bfd_set_param((struct bfd_info
**)&(peer
->bfd_info
),
496 BFD_DEF_MIN_RX
, BFD_DEF_MIN_TX
,
497 BFD_DEF_DETECT_MULT
, 1, &command
);
499 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
500 bfd_info
->type
= type
;
502 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
)) {
504 for (ALL_LIST_ELEMENTS(group
->peer
, node
, nnode
, peer
)) {
508 (struct bfd_info
**)&(peer
->bfd_info
),
509 BFD_DEF_MIN_RX
, BFD_DEF_MIN_TX
,
510 BFD_DEF_DETECT_MULT
, 1, &command
);
512 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
513 bfd_info
->type
= type
;
515 if (peer
->status
== Established
) {
516 if (command
== ZEBRA_BFD_DEST_REGISTER
)
517 bgp_bfd_register_peer(peer
);
519 bgp_bfd_update_type(peer
);
523 if (peer
->status
== Established
) {
524 if (command
== ZEBRA_BFD_DEST_REGISTER
)
525 bgp_bfd_register_peer(peer
);
527 bgp_bfd_update_type(peer
);
535 * bgp_bfd_peer_config_write - Write the peer BFD configuration.
537 void bgp_bfd_peer_config_write(struct vty
*vty
, struct peer
*peer
, char *addr
)
539 struct bfd_info
*bfd_info
;
544 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
546 if (CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_PARAM_CFG
))
548 vty_out(vty
, " neighbor %s bfd\n", addr
);
550 vty_out(vty
, " neighbor %s bfd %d %d %d\n", addr
,
551 bfd_info
->detect_mult
, bfd_info
->required_min_rx
,
552 bfd_info
->desired_min_tx
);
553 #endif /* HAVE_BFDD */
555 if (bfd_info
->type
!= BFD_TYPE_NOT_CONFIGURED
)
556 vty_out(vty
, " neighbor %s bfd %s\n", addr
,
557 (bfd_info
->type
== BFD_TYPE_MULTIHOP
) ? "multihop"
560 if (!CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_PARAM_CFG
)
561 && (bfd_info
->type
== BFD_TYPE_NOT_CONFIGURED
))
562 vty_out(vty
, " neighbor %s bfd\n", addr
);
564 if (CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
))
565 vty_out(vty
, " neighbor %s bfd check-control-plane-failure\n", addr
);
569 * bgp_bfd_show_info - Show the peer BFD information.
571 void bgp_bfd_show_info(struct vty
*vty
, struct peer
*peer
, bool use_json
,
572 json_object
*json_neigh
)
574 bfd_show_info(vty
, (struct bfd_info
*)peer
->bfd_info
,
575 bgp_bfd_is_peer_multihop(peer
), 0, use_json
, json_neigh
);
580 "neighbor <A.B.C.D|X:X::X:X|WORD> bfd",
583 "Enables BFD support\n")
589 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
591 return CMD_WARNING_CONFIG_FAILED
;
593 ret
= bgp_bfd_peer_param_set(peer
, BFD_DEF_MIN_RX
, BFD_DEF_MIN_TX
,
594 BFD_DEF_DETECT_MULT
, 1);
596 return bgp_vty_return(vty
, ret
);
605 #endif /* HAVE_BFDD */
607 neighbor_bfd_param_cmd
,
608 "neighbor <A.B.C.D|X:X::X:X|WORD> bfd (2-255) (50-60000) (50-60000)",
611 "Enables BFD support\n"
612 "Detect Multiplier\n"
613 "Required min receive interval\n"
614 "Desired min transmit interval\n")
617 int idx_number_1
= 3;
618 int idx_number_2
= 4;
619 int idx_number_3
= 5;
626 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
628 return CMD_WARNING_CONFIG_FAILED
;
630 if ((ret
= bfd_validate_param(
631 vty
, argv
[idx_number_1
]->arg
, argv
[idx_number_2
]->arg
,
632 argv
[idx_number_3
]->arg
, &dm_val
, &rx_val
, &tx_val
))
636 ret
= bgp_bfd_peer_param_set(peer
, rx_val
, tx_val
, dm_val
, 0);
638 return bgp_vty_return(vty
, ret
);
643 DEFUN_HIDDEN (neighbor_bfd_type
,
644 neighbor_bfd_type_cmd
,
645 "neighbor <A.B.C.D|X:X::X:X|WORD> bfd <multihop|singlehop>",
648 "Enables BFD support\n"
650 "Single hop session\n")
655 enum bfd_sess_type type
;
658 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
660 return CMD_WARNING_CONFIG_FAILED
;
662 if (strmatch(argv
[idx_hop
]->text
, "singlehop"))
663 type
= BFD_TYPE_SINGLEHOP
;
664 else if (strmatch(argv
[idx_hop
]->text
, "multihop"))
665 type
= BFD_TYPE_MULTIHOP
;
667 return CMD_WARNING_CONFIG_FAILED
;
669 ret
= bgp_bfd_peer_param_type_set(peer
, type
);
671 return bgp_vty_return(vty
, ret
);
676 static int bgp_bfd_set_check_controlplane_failure_peer(struct vty
*vty
, struct peer
*peer
,
679 struct bfd_info
*bfd_info
;
681 if (!peer
->bfd_info
) {
684 vty_out(vty
, "%% Specify bfd command first\n");
685 return CMD_WARNING_CONFIG_FAILED
;
687 bfd_info
= (struct bfd_info
*)peer
->bfd_info
;
689 if (!CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
)) {
690 SET_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
);
691 bgp_bfd_update_peer(peer
);
694 if (CHECK_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
)) {
695 UNSET_FLAG(bfd_info
->flags
, BFD_FLAG_BFD_CHECK_CONTROLPLANE
);
696 bgp_bfd_update_peer(peer
);
703 DEFUN (neighbor_bfd_check_controlplane_failure
,
704 neighbor_bfd_check_controlplane_failure_cmd
,
705 "[no] neighbor <A.B.C.D|X:X::X:X|WORD> bfd check-control-plane-failure",
710 "Link dataplane status with BGP controlplane\n")
712 const char *no
= strmatch(argv
[0]->text
, "no") ? "no" : NULL
;
715 struct peer_group
*group
;
716 struct listnode
*node
, *nnode
;
717 int ret
= CMD_SUCCESS
;
723 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
725 vty_out(vty
, "%% Specify remote-as or peer-group commands first\n");
726 return CMD_WARNING_CONFIG_FAILED
;
728 if (!peer
->bfd_info
) {
731 vty_out(vty
, "%% Specify bfd command first\n");
732 return CMD_WARNING_CONFIG_FAILED
;
734 if (CHECK_FLAG(peer
->sflags
, PEER_STATUS_GROUP
)) {
736 for (ALL_LIST_ELEMENTS(group
->peer
, node
, nnode
, peer
))
737 ret
= bgp_bfd_set_check_controlplane_failure_peer(vty
, peer
, no
);
739 ret
= bgp_bfd_set_check_controlplane_failure_peer(vty
, peer
, no
);
743 DEFUN (no_neighbor_bfd
,
746 "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd",
748 "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd [(2-255) (50-60000) (50-60000)]",
749 #endif /* HAVE_BFDD */
753 "Disables BFD support\n"
755 "Detect Multiplier\n"
756 "Required min receive interval\n"
757 "Desired min transmit interval\n"
758 #endif /* !HAVE_BFDD */
765 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
767 return CMD_WARNING_CONFIG_FAILED
;
769 ret
= bgp_bfd_peer_param_unset(peer
);
771 return bgp_vty_return(vty
, ret
);
777 DEFUN_HIDDEN (no_neighbor_bfd_type
,
778 no_neighbor_bfd_type_cmd
,
779 "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd <multihop|singlehop>",
783 "Disables BFD support\n"
785 "Singlehop session\n")
791 peer
= peer_and_group_lookup_vty(vty
, argv
[idx_peer
]->arg
);
793 return CMD_WARNING_CONFIG_FAILED
;
798 ret
= bgp_bfd_peer_param_type_set(peer
, BFD_TYPE_NOT_CONFIGURED
);
800 return bgp_vty_return(vty
, ret
);
805 void bgp_bfd_init(void)
809 /* Initialize BFD client functions */
810 zclient
->interface_bfd_dest_update
= bgp_bfd_dest_update
;
811 zclient
->bfd_dest_replay
= bgp_bfd_dest_replay
;
813 /* "neighbor bfd" commands. */
814 install_element(BGP_NODE
, &neighbor_bfd_cmd
);
815 install_element(BGP_NODE
, &neighbor_bfd_param_cmd
);
816 install_element(BGP_NODE
, &neighbor_bfd_type_cmd
);
817 install_element(BGP_NODE
, &neighbor_bfd_check_controlplane_failure_cmd
);
818 install_element(BGP_NODE
, &no_neighbor_bfd_cmd
);
819 install_element(BGP_NODE
, &no_neighbor_bfd_type_cmd
);