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__
28 #include "pim_assert.h"
30 #include "pim_vxlan_instance.h"
32 #if defined(HAVE_LINUX_MROUTE_H)
33 #include <linux/mroute.h>
36 Below: from <linux/mroute.h>
44 enum pim_spt_switchover
{
50 struct thread_master
*master
;
55 struct pim_assert_metric infinite_assert_metric
;
56 long rpf_cache_refresh_delay_msec
;
57 int32_t register_suppress_time
;
59 int32_t register_probe_time
;
62 * What is the default vrf that we work in
67 uint32_t pim_mlag_intf_cnt
;
68 /* if true we have registered with MLAG */
69 bool mlag_process_register
;
70 /* if true local MLAG process reported that it is connected
71 * with the peer MLAG process
73 bool connected_to_mlag
;
74 /* Holds the client data(unencoded) that need to be pushed to MCLAGD*/
75 struct stream_fifo
*mlag_fifo
;
76 struct stream
*mlag_stream
;
77 struct thread
*zpthread_mlag_write
;
86 enum pim_spt_switchover switchover
;
90 struct hash
*rpf_hash
;
92 void *ssm_info
; /* per-vrf SSM configuration */
94 int send_v6_secondary
;
96 struct thread
*thread
;
98 int64_t mroute_socket_creation
;
99 int64_t mroute_add_events
;
100 int64_t mroute_add_last
;
101 int64_t mroute_del_events
;
102 int64_t mroute_del_last
;
104 struct interface
*regiface
;
106 // List of static routes;
107 struct list
*static_routes
;
109 // Upstream vrf specific information
110 struct list
*upstream_list
;
111 struct hash
*upstream_hash
;
112 struct timer_wheel
*upstream_sg_wheel
;
117 struct list
*rp_list
;
118 struct route_table
*rp_table
;
120 int iface_vif_index
[MAXVIFS
];
122 struct list
*channel_oil_list
;
123 struct hash
*channel_oil_hash
;
125 struct pim_msdp msdp
;
126 struct pim_vxlan_instance vxlan
;
128 struct list
*ssmpingd_list
;
129 struct in_addr ssmpingd_group_addr
;
131 unsigned int keep_alive_time
;
132 unsigned int rp_keep_alive_time
;
135 bool ecmp_rebalance_enable
;
136 /* No. of Dual active I/fs in pim_instance */
137 uint32_t inst_mlag_intf_cnt
;
140 struct bsm_scope global_scope
;
143 uint64_t bsm_dropped
;
145 /* If we need to rescan all our upstreams */
146 struct thread
*rpf_cache_refresher
;
147 int64_t rpf_cache_refresh_requests
;
148 int64_t rpf_cache_refresh_events
;
149 int64_t rpf_cache_refresh_last
;
150 int64_t scan_oil_events
;
151 int64_t scan_oil_last
;
153 int64_t nexthop_lookups
;
154 int64_t nexthop_lookups_avoided
;
155 int64_t last_route_change_time
;
158 void pim_vrf_init(void);
159 void pim_vrf_terminate(void);
161 struct pim_instance
*pim_get_pim_instance(vrf_id_t vrf_id
);