]>
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 | ||
f88df3a6 DS |
24 | #if defined(HAVE_LINUX_MROUTE_H) |
25 | #include <linux/mroute.h> | |
26 | #else | |
27 | /* | |
28 | Below: from <linux/mroute.h> | |
29 | */ | |
30 | ||
31 | #ifndef MAXVIFS | |
32 | #define MAXVIFS (256) | |
33 | #endif | |
34 | #endif | |
c2cf4b02 DS |
35 | extern struct pim_instance *pimg; // Pim Global Instance |
36 | ||
37 | enum pim_spt_switchover { | |
38 | PIM_SPT_IMMEDIATE, | |
39 | PIM_SPT_INFINITY, | |
40 | }; | |
41 | ||
42 | /* Per VRF PIM DB */ | |
43 | struct pim_instance { | |
44 | vrf_id_t vrf_id; | |
45 | struct vrf *vrf; | |
46 | ||
47 | struct { | |
48 | enum pim_spt_switchover switchover; | |
49 | char *plist; | |
50 | } spt; | |
51 | ||
52 | struct hash *rpf_hash; | |
53 | ||
54 | void *ssm_info; /* per-vrf SSM configuration */ | |
55 | ||
56 | int send_v6_secondary; | |
57 | ||
58 | struct thread *thread; | |
59 | int mroute_socket; | |
60 | int64_t mroute_socket_creation; | |
61 | int64_t mroute_add_events; | |
62 | int64_t mroute_add_last; | |
63 | int64_t mroute_del_events; | |
64 | int64_t mroute_del_last; | |
65 | ||
66 | struct interface *regiface; | |
4e0bc0f0 DS |
67 | |
68 | // List of static routes; | |
69 | struct list *static_routes; | |
9b29ea95 DS |
70 | |
71 | // Upstream vrf specific information | |
72 | struct list *upstream_list; | |
73 | struct hash *upstream_hash; | |
74 | struct timer_wheel *upstream_sg_wheel; | |
d9c9a9ee DS |
75 | |
76 | struct list *rp_list; | |
f88df3a6 DS |
77 | |
78 | struct list *ifchannel_list; | |
79 | int iface_vif_index[MAXVIFS]; | |
611925dc DS |
80 | |
81 | struct list *channel_oil_list; | |
82 | struct hash *channel_oil_hash; | |
c2cf4b02 DS |
83 | }; |
84 | ||
85 | void pim_vrf_init(void); | |
86 | void pim_vrf_terminate(void); | |
87 | ||
88 | struct pim_instance *pim_get_pim_instance(vrf_id_t vrf_id); | |
89 | ||
90 | #endif |