]>
Commit | Line | Data |
---|---|---|
8f5f5e91 DS |
1 | /* |
2 | * PIM for Quagga | |
3 | * Copyright (C) 2015 Cumulus Networks, Inc. | |
4 | * Donald Sharp | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation; either version 2 of the License, or | |
9 | * (at your option) any later version. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | * General Public License for more details. | |
896014f4 DL |
15 | * |
16 | * You should have received a copy of the GNU General Public License along | |
17 | * with this program; see the file COPYING; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
8f5f5e91 DS |
19 | */ |
20 | #ifndef PIM_RP_H | |
21 | #define PIM_RP_H | |
22 | ||
1bc98276 CS |
23 | #include <zebra.h> |
24 | #include "prefix.h" | |
25 | #include "vty.h" | |
26 | #include "plist.h" | |
1bc98276 | 27 | #include "pim_rpf.h" |
0095f482 | 28 | #include "lib/json.h" |
1bc98276 | 29 | |
e34e07e6 DL |
30 | struct pim_interface; |
31 | ||
e2d01c19 | 32 | enum rp_source { |
33 | RP_SRC_NONE = 0, | |
34 | RP_SRC_STATIC, | |
35 | RP_SRC_BSR | |
36 | }; | |
37 | ||
d62a17ae | 38 | struct rp_info { |
39 | struct prefix group; | |
40 | struct pim_rpf rp; | |
e2d01c19 | 41 | enum rp_source rp_src; |
d62a17ae | 42 | int i_am_rp; |
43 | char *plist; | |
1bc98276 CS |
44 | }; |
45 | ||
d9c9a9ee DS |
46 | void pim_rp_init(struct pim_instance *pim); |
47 | void pim_rp_free(struct pim_instance *pim); | |
48 | ||
c2cf4b02 | 49 | void pim_rp_list_hash_clean(void *data); |
36d6bd7d | 50 | |
6ed1cea1 MR |
51 | int pim_rp_new(struct pim_instance *pim, pim_addr rp_addr, struct prefix group, |
52 | const char *plist, enum rp_source rp_src_flag); | |
99384c6e MR |
53 | void pim_rp_del_config(struct pim_instance *pim, pim_addr rp_addr, |
54 | const char *group, const char *plist); | |
9dca52b9 MR |
55 | int pim_rp_del(struct pim_instance *pim, pim_addr rp_addr, struct prefix group, |
56 | const char *plist, enum rp_source rp_src_flag); | |
49b7b2c4 | 57 | int pim_rp_change(struct pim_instance *pim, pim_addr new_rp_addr, |
d0e418b4 | 58 | struct prefix group, enum rp_source rp_src_flag); |
d9c9a9ee DS |
59 | void pim_rp_prefix_list_update(struct pim_instance *pim, |
60 | struct prefix_list *plist); | |
75a26779 | 61 | |
0c8b717e DS |
62 | int pim_rp_config_write(struct pim_instance *pim, struct vty *vty, |
63 | const char *spaces); | |
75a26779 | 64 | |
fec883d9 | 65 | void pim_rp_setup(struct pim_instance *pim); |
75a26779 | 66 | |
5d99ebea | 67 | int pim_rp_i_am_rp(struct pim_instance *pim, pim_addr group); |
7176984f | 68 | void pim_rp_check_on_if_add(struct pim_interface *pim_ifp); |
fec883d9 | 69 | void pim_i_am_rp_re_evaluate(struct pim_instance *pim); |
75a26779 | 70 | |
f43593d9 DS |
71 | bool pim_rp_check_is_my_ip_address(struct pim_instance *pim, |
72 | struct in_addr dest_addr); | |
75a26779 | 73 | |
5d99ebea DL |
74 | int pim_rp_set_upstream_addr(struct pim_instance *pim, pim_addr *up, |
75 | pim_addr source, pim_addr group); | |
75a26779 | 76 | |
5d99ebea | 77 | struct pim_rpf *pim_rp_g(struct pim_instance *pim, pim_addr group); |
8f5f5e91 | 78 | |
d9c9a9ee | 79 | #define I_am_RP(P, G) pim_rp_i_am_rp ((P), (G)) |
fec883d9 | 80 | #define RP(P, G) pim_rp_g ((P), (G)) |
00d07c6f | 81 | |
8c0a7680 | 82 | void pim_rp_show_information(struct pim_instance *pim, struct prefix *range, |
0095f482 | 83 | struct vty *vty, json_object *json); |
c9cd7fbc | 84 | void pim_resolve_rp_nh(struct pim_instance *pim, struct pim_neighbor *nbr); |
d62a17ae | 85 | int pim_rp_list_cmp(void *v1, void *v2); |
28309df0 SP |
86 | struct rp_info *pim_rp_find_match_group(struct pim_instance *pim, |
87 | const struct prefix *group); | |
88 | void pim_upstream_update(struct pim_instance *pim, struct pim_upstream *up); | |
e7016ceb | 89 | void pim_rp_refresh_group_to_rp_mapping(struct pim_instance *pim); |
8f5f5e91 | 90 | #endif |