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"
33 #if defined(HAVE_LINUX_MROUTE_H)
34 #include <linux/mroute.h>
37 Below: from <linux/mroute.h>
45 enum pim_spt_switchover
{
51 struct thread_master
*master
;
56 struct pim_assert_metric infinite_assert_metric
;
57 long rpf_cache_refresh_delay_msec
;
58 int32_t register_suppress_time
;
60 int32_t register_probe_time
;
63 * What is the default vrf that we work in
68 uint32_t pim_mlag_intf_cnt
;
69 /* if true we have registered with MLAG */
70 bool mlag_process_register
;
71 /* if true local MLAG process reported that it is connected
72 * with the peer MLAG process
74 bool connected_to_mlag
;
75 /* Holds the client data(unencoded) that need to be pushed to MCLAGD*/
76 struct stream_fifo
*mlag_fifo
;
77 struct stream
*mlag_stream
;
78 struct thread
*zpthread_mlag_write
;
87 enum pim_spt_switchover switchover
;
91 struct hash
*rpf_hash
;
93 void *ssm_info
; /* per-vrf SSM configuration */
95 int send_v6_secondary
;
97 struct thread
*thread
;
99 int64_t mroute_socket_creation
;
100 int64_t mroute_add_events
;
101 int64_t mroute_add_last
;
102 int64_t mroute_del_events
;
103 int64_t mroute_del_last
;
105 struct interface
*regiface
;
107 // List of static routes;
108 struct list
*static_routes
;
110 // Upstream vrf specific information
111 struct list
*upstream_list
;
112 struct hash
*upstream_hash
;
113 struct timer_wheel
*upstream_sg_wheel
;
118 struct list
*rp_list
;
119 struct route_table
*rp_table
;
121 int iface_vif_index
[MAXVIFS
];
123 struct rb_pim_oil_head channel_oil_head
;
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
);