]>
Commit | Line | Data |
---|---|---|
c2cf4b02 DS |
1 | /* |
2 | * PIM for FRR - PIM Instance | |
3 | * Copyright (C) 2017 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. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program; see the file COPYING; if not, write to the | |
18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, | |
19 | * MA 02110-1301 USA | |
20 | */ | |
21 | #ifndef __PIM_INSTANCE_H__ | |
22 | #define __PIM_INSTANCE_H__ | |
23 | ||
2ad78035 DS |
24 | #include "pim_str.h" |
25 | #include "pim_msdp.h" | |
26 | ||
f88df3a6 DS |
27 | #if defined(HAVE_LINUX_MROUTE_H) |
28 | #include <linux/mroute.h> | |
29 | #else | |
30 | /* | |
31 | Below: from <linux/mroute.h> | |
32 | */ | |
33 | ||
34 | #ifndef MAXVIFS | |
35 | #define MAXVIFS (256) | |
36 | #endif | |
37 | #endif | |
c2cf4b02 DS |
38 | extern struct pim_instance *pimg; // Pim Global Instance |
39 | ||
40 | enum pim_spt_switchover { | |
41 | PIM_SPT_IMMEDIATE, | |
42 | PIM_SPT_INFINITY, | |
43 | }; | |
44 | ||
45 | /* Per VRF PIM DB */ | |
46 | struct pim_instance { | |
47 | vrf_id_t vrf_id; | |
48 | struct vrf *vrf; | |
49 | ||
50 | struct { | |
51 | enum pim_spt_switchover switchover; | |
52 | char *plist; | |
53 | } spt; | |
54 | ||
55 | struct hash *rpf_hash; | |
56 | ||
57 | void *ssm_info; /* per-vrf SSM configuration */ | |
58 | ||
59 | int send_v6_secondary; | |
60 | ||
61 | struct thread *thread; | |
62 | int mroute_socket; | |
63 | int64_t mroute_socket_creation; | |
64 | int64_t mroute_add_events; | |
65 | int64_t mroute_add_last; | |
66 | int64_t mroute_del_events; | |
67 | int64_t mroute_del_last; | |
68 | ||
69 | struct interface *regiface; | |
4e0bc0f0 DS |
70 | |
71 | // List of static routes; | |
72 | struct list *static_routes; | |
9b29ea95 DS |
73 | |
74 | // Upstream vrf specific information | |
75 | struct list *upstream_list; | |
76 | struct hash *upstream_hash; | |
77 | struct timer_wheel *upstream_sg_wheel; | |
d9c9a9ee | 78 | |
89b68082 DS |
79 | /* |
80 | * RP information | |
81 | */ | |
d9c9a9ee | 82 | struct list *rp_list; |
89b68082 | 83 | struct route_table *rp_table; |
f88df3a6 | 84 | |
f88df3a6 | 85 | int iface_vif_index[MAXVIFS]; |
611925dc DS |
86 | |
87 | struct list *channel_oil_list; | |
88 | struct hash *channel_oil_hash; | |
2ad78035 DS |
89 | |
90 | struct pim_msdp msdp; | |
71ad9915 DS |
91 | |
92 | struct list *ssmpingd_list; | |
93 | struct in_addr ssmpingd_group_addr; | |
19b807ca DS |
94 | |
95 | unsigned int keep_alive_time; | |
96 | unsigned int rp_keep_alive_time; | |
da11e325 | 97 | |
4795fff7 DS |
98 | bool ecmp_enable; |
99 | bool ecmp_rebalance_enable; | |
100 | ||
da11e325 DS |
101 | /* If we need to rescan all our upstreams */ |
102 | struct thread *rpf_cache_refresher; | |
bfc92019 DS |
103 | int64_t rpf_cache_refresh_requests; |
104 | int64_t rpf_cache_refresh_events; | |
105 | int64_t rpf_cache_refresh_last; | |
106 | int64_t scan_oil_events; | |
107 | int64_t scan_oil_last; | |
108 | ||
109 | int64_t nexthop_lookups; | |
110 | int64_t nexthop_lookups_avoided; | |
111 | int64_t last_route_change_time; | |
c2cf4b02 DS |
112 | }; |
113 | ||
114 | void pim_vrf_init(void); | |
115 | void pim_vrf_terminate(void); | |
116 | ||
117 | struct pim_instance *pim_get_pim_instance(vrf_id_t vrf_id); | |
118 | ||
119 | #endif |