]>
Commit | Line | Data |
---|---|---|
c43ed2e4 DS |
1 | /** |
2 | * bgp_bfd.h: BGP BFD definitions and structures | |
3 | * | |
4 | * @copyright Copyright (C) 2015 Cumulus Networks, Inc. | |
5 | * | |
6 | * This file is part of GNU Zebra. | |
7 | * | |
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 | |
11 | * later version. | |
12 | * | |
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. | |
17 | * | |
896014f4 DL |
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 | |
c43ed2e4 DS |
21 | */ |
22 | ||
23 | #ifndef _QUAGGA_BGP_BFD_H | |
24 | #define _QUAGGA_BGP_BFD_H | |
25 | ||
21bfce98 RZ |
26 | #define PEER_IS_MULTIHOP(peer) \ |
27 | ((((peer)->sort == BGP_PEER_IBGP) && !(peer)->shared_network) \ | |
28 | || is_ebgp_multihop_configured((peer))) | |
c43ed2e4 | 29 | |
21bfce98 | 30 | extern void bgp_bfd_init(struct thread_master *tm); |
c43ed2e4 | 31 | |
21bfce98 RZ |
32 | extern void bgp_bfd_peer_config_write(struct vty *vty, const struct peer *peer, |
33 | const char *addr); | |
c43ed2e4 | 34 | |
21bfce98 RZ |
35 | /** |
36 | * Show BFD information helper. | |
37 | * | |
38 | * \param vty the VTY pointer. | |
39 | * \param peer the BGP configuration pointer. | |
40 | * \param use_json unused. | |
41 | * \param json_neigh JSON object when called as JSON command. | |
42 | */ | |
43 | extern void bgp_bfd_show_info(struct vty *vty, const struct peer *peer, | |
44 | json_object *json_neigh); | |
c43ed2e4 | 45 | |
21bfce98 RZ |
46 | /** |
47 | * When called on a group it applies configuration to all peers in that group, | |
48 | * otherwise just applies the configuration to a single peer. | |
49 | * | |
50 | * This function should be called when configuration changes either on group | |
51 | * or peer. | |
52 | * | |
53 | * \param p the BGP peer pointer. | |
54 | * \param pg the BGP group to copy configuration from (it is usually | |
55 | * `p->group` exception when copying new group configuration | |
56 | * see `peer_group2peer_config_copy` function case). | |
57 | */ | |
58 | extern void bgp_peer_config_apply(struct peer *p, struct peer_group *pg); | |
fe0c4ed7 | 59 | |
21bfce98 RZ |
60 | /** |
61 | * Allocates and configure BFD session for peer. If it is already configured, | |
62 | * then it does nothing. | |
4a0872fc RZ |
63 | * |
64 | * Always call `bgp_peer_config_apply` afterwards if you need the changes | |
65 | * immediately applied. | |
21bfce98 RZ |
66 | */ |
67 | extern void bgp_peer_configure_bfd(struct peer *p, bool manual); | |
c43ed2e4 | 68 | |
21bfce98 RZ |
69 | /** |
70 | * Removes BFD configuration from either peer or peer group. | |
71 | */ | |
72 | extern void bgp_peer_remove_bfd_config(struct peer *p); | |
c43ed2e4 | 73 | |
21bfce98 RZ |
74 | /** |
75 | * Special function to handle the case of changing source address. This | |
76 | * happens when the peer/group is configured with `neigbor X update-source Y`. | |
77 | */ | |
78 | extern void bgp_peer_bfd_update_source(struct peer *p); | |
8c4f6381 | 79 | |
c43ed2e4 | 80 | #endif /* _QUAGGA_BGP_BFD_H */ |