]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_bfd.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / bgpd / bgp_bfd.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /**
3 * bgp_bfd.h: BGP BFD definitions and structures
4 *
5 * @copyright Copyright (C) 2015 Cumulus Networks, Inc.
6 */
7
8 #ifndef _QUAGGA_BGP_BFD_H
9 #define _QUAGGA_BGP_BFD_H
10
11 #define PEER_IS_MULTIHOP(peer) \
12 ((((peer)->sort == BGP_PEER_IBGP) && !(peer)->shared_network) \
13 || is_ebgp_multihop_configured((peer)))
14
15 extern void bgp_bfd_init(struct event_loop *tm);
16
17 extern void bgp_bfd_peer_config_write(struct vty *vty, const struct peer *peer,
18 const char *addr);
19
20 /**
21 * Show BFD information helper.
22 *
23 * \param vty the VTY pointer.
24 * \param peer the BGP configuration pointer.
25 * \param use_json unused.
26 * \param json_neigh JSON object when called as JSON command.
27 */
28 extern void bgp_bfd_show_info(struct vty *vty, const struct peer *peer,
29 json_object *json_neigh);
30
31 /**
32 * When called on a group it applies configuration to all peers in that group,
33 * otherwise just applies the configuration to a single peer.
34 *
35 * This function should be called when configuration changes either on group
36 * or peer.
37 *
38 * \param p the BGP peer pointer.
39 * \param pg the BGP group to copy configuration from (it is usually
40 * `p->group` exception when copying new group configuration
41 * see `peer_group2peer_config_copy` function case).
42 */
43 extern void bgp_peer_config_apply(struct peer *p, struct peer_group *pg);
44
45 /**
46 * Allocates and configure BFD session for peer. If it is already configured,
47 * then it does nothing.
48 *
49 * Always call `bgp_peer_config_apply` afterwards if you need the changes
50 * immediately applied.
51 */
52 extern void bgp_peer_configure_bfd(struct peer *p, bool manual);
53
54 /**
55 * Removes BFD configuration from either peer or peer group.
56 */
57 extern void bgp_peer_remove_bfd_config(struct peer *p);
58
59 /**
60 * Special function to handle the case of changing source address. This
61 * happens when the peer/group is configured with `neigbor X update-source Y`.
62 */
63 extern void bgp_peer_bfd_update_source(struct peer *p);
64
65 #endif /* _QUAGGA_BGP_BFD_H */