]>
Commit | Line | Data |
---|---|---|
acddc0ed | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
c43ed2e4 DS |
2 | /** |
3 | * bgp_bfd.h: BGP BFD definitions and structures | |
4 | * | |
5 | * @copyright Copyright (C) 2015 Cumulus Networks, Inc. | |
c43ed2e4 DS |
6 | */ |
7 | ||
8 | #ifndef _QUAGGA_BGP_BFD_H | |
9 | #define _QUAGGA_BGP_BFD_H | |
10 | ||
21bfce98 RZ |
11 | #define PEER_IS_MULTIHOP(peer) \ |
12 | ((((peer)->sort == BGP_PEER_IBGP) && !(peer)->shared_network) \ | |
13 | || is_ebgp_multihop_configured((peer))) | |
c43ed2e4 | 14 | |
21bfce98 | 15 | extern void bgp_bfd_init(struct thread_master *tm); |
c43ed2e4 | 16 | |
21bfce98 RZ |
17 | extern void bgp_bfd_peer_config_write(struct vty *vty, const struct peer *peer, |
18 | const char *addr); | |
c43ed2e4 | 19 | |
21bfce98 RZ |
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); | |
c43ed2e4 | 30 | |
21bfce98 RZ |
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); | |
fe0c4ed7 | 44 | |
21bfce98 RZ |
45 | /** |
46 | * Allocates and configure BFD session for peer. If it is already configured, | |
47 | * then it does nothing. | |
4a0872fc RZ |
48 | * |
49 | * Always call `bgp_peer_config_apply` afterwards if you need the changes | |
50 | * immediately applied. | |
21bfce98 RZ |
51 | */ |
52 | extern void bgp_peer_configure_bfd(struct peer *p, bool manual); | |
c43ed2e4 | 53 | |
21bfce98 RZ |
54 | /** |
55 | * Removes BFD configuration from either peer or peer group. | |
56 | */ | |
57 | extern void bgp_peer_remove_bfd_config(struct peer *p); | |
c43ed2e4 | 58 | |
21bfce98 RZ |
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); | |
8c4f6381 | 64 | |
c43ed2e4 | 65 | #endif /* _QUAGGA_BGP_BFD_H */ |