2 * PIM for FRR - PIM Instance
3 * Copyright (C) 2017 Cumulus Networks, Inc.
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.
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.
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,
21 #ifndef __PIM_INSTANCE_H__
22 #define __PIM_INSTANCE_H__
27 #if defined(HAVE_LINUX_MROUTE_H)
28 #include <linux/mroute.h>
31 Below: from <linux/mroute.h>
38 extern struct pim_instance
*pimg
; // Pim Global Instance
40 enum pim_spt_switchover
{
46 struct thread_master
*master
;
55 enum pim_spt_switchover switchover
;
59 struct hash
*rpf_hash
;
61 void *ssm_info
; /* per-vrf SSM configuration */
63 int send_v6_secondary
;
65 struct thread
*thread
;
67 int64_t mroute_socket_creation
;
68 int64_t mroute_add_events
;
69 int64_t mroute_add_last
;
70 int64_t mroute_del_events
;
71 int64_t mroute_del_last
;
73 struct interface
*regiface
;
75 // List of static routes;
76 struct list
*static_routes
;
78 // Upstream vrf specific information
79 struct list
*upstream_list
;
80 struct hash
*upstream_hash
;
81 struct timer_wheel
*upstream_sg_wheel
;
87 struct route_table
*rp_table
;
89 int iface_vif_index
[MAXVIFS
];
91 struct list
*channel_oil_list
;
92 struct hash
*channel_oil_hash
;
96 struct list
*ssmpingd_list
;
97 struct in_addr ssmpingd_group_addr
;
99 unsigned int keep_alive_time
;
100 unsigned int rp_keep_alive_time
;
103 bool ecmp_rebalance_enable
;
105 /* If we need to rescan all our upstreams */
106 struct thread
*rpf_cache_refresher
;
107 int64_t rpf_cache_refresh_requests
;
108 int64_t rpf_cache_refresh_events
;
109 int64_t rpf_cache_refresh_last
;
110 int64_t scan_oil_events
;
111 int64_t scan_oil_last
;
113 int64_t nexthop_lookups
;
114 int64_t nexthop_lookups_avoided
;
115 int64_t last_route_change_time
;
118 void pim_vrf_init(void);
119 void pim_vrf_terminate(void);
121 struct pim_instance
*pim_get_pim_instance(vrf_id_t vrf_id
);