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 #include "pim_upstream.h"
34 #if defined(HAVE_LINUX_MROUTE_H)
35 #include <linux/mroute.h>
38 Below: from <linux/mroute.h>
46 enum pim_spt_switchover
{
52 struct thread_master
*master
;
57 struct pim_assert_metric infinite_assert_metric
;
58 long rpf_cache_refresh_delay_msec
;
59 int32_t register_suppress_time
;
61 int32_t register_probe_time
;
64 * What is the default vrf that we work in
69 uint32_t pim_mlag_intf_cnt
;
70 /* if true we have registered with MLAG */
71 bool mlag_process_register
;
72 /* if true local MLAG process reported that it is connected
73 * with the peer MLAG process
75 bool connected_to_mlag
;
76 /* Holds the client data(unencoded) that need to be pushed to MCLAGD*/
77 struct stream_fifo
*mlag_fifo
;
78 struct stream
*mlag_stream
;
79 struct thread
*zpthread_mlag_write
;
88 enum pim_spt_switchover switchover
;
92 struct hash
*rpf_hash
;
94 void *ssm_info
; /* per-vrf SSM configuration */
96 int send_v6_secondary
;
98 struct thread
*thread
;
100 int64_t mroute_socket_creation
;
101 int64_t mroute_add_events
;
102 int64_t mroute_add_last
;
103 int64_t mroute_del_events
;
104 int64_t mroute_del_last
;
106 struct interface
*regiface
;
108 // List of static routes;
109 struct list
*static_routes
;
111 // Upstream vrf specific information
112 struct rb_pim_upstream_head upstream_head
;
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
);