]> git.proxmox.com Git - mirror_frr.git/blame - pimd/pim_instance.h
pimd: fix missing igmp mtrace length check
[mirror_frr.git] / pimd / pim_instance.h
CommitLineData
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
d6749d74
DS
24#include <mlag.h>
25
2ad78035
DS
26#include "pim_str.h"
27#include "pim_msdp.h"
d17612dd 28#include "pim_assert.h"
361b5843 29#include "pim_bsm.h"
b583b035 30#include "pim_vxlan_instance.h"
2ad78035 31
f88df3a6
DS
32#if defined(HAVE_LINUX_MROUTE_H)
33#include <linux/mroute.h>
34#else
35/*
36 Below: from <linux/mroute.h>
37*/
38
39#ifndef MAXVIFS
40#define MAXVIFS (256)
41#endif
42#endif
d17612dd 43
c2cf4b02
DS
44enum pim_spt_switchover {
45 PIM_SPT_IMMEDIATE,
46 PIM_SPT_INFINITY,
47};
48
36417fcc
DS
49struct pim_router {
50 struct thread_master *master;
046b1aa7
DS
51
52 uint32_t debugs;
5b45753e
DS
53
54 int t_periodic;
d17612dd 55 struct pim_assert_metric infinite_assert_metric;
da03883e 56 long rpf_cache_refresh_delay_msec;
2925dff5 57 int32_t register_suppress_time;
75373cca 58 int packet_process;
a6c5db59 59 int32_t register_probe_time;
4dfe9ad2
DS
60
61 /*
62 * What is the default vrf that we work in
63 */
64 vrf_id_t vrf_id;
d6749d74
DS
65
66 enum mlag_role role;
36b5b98f
SK
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
72 */
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;
36417fcc
DS
78};
79
c2cf4b02
DS
80/* Per VRF PIM DB */
81struct pim_instance {
82 vrf_id_t vrf_id;
83 struct vrf *vrf;
84
85 struct {
86 enum pim_spt_switchover switchover;
87 char *plist;
88 } spt;
89
90 struct hash *rpf_hash;
91
92 void *ssm_info; /* per-vrf SSM configuration */
93
94 int send_v6_secondary;
95
96 struct thread *thread;
97 int mroute_socket;
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;
103
104 struct interface *regiface;
4e0bc0f0
DS
105
106 // List of static routes;
107 struct list *static_routes;
9b29ea95
DS
108
109 // Upstream vrf specific information
110 struct list *upstream_list;
111 struct hash *upstream_hash;
112 struct timer_wheel *upstream_sg_wheel;
d9c9a9ee 113
89b68082
DS
114 /*
115 * RP information
116 */
d9c9a9ee 117 struct list *rp_list;
89b68082 118 struct route_table *rp_table;
f88df3a6 119
f88df3a6 120 int iface_vif_index[MAXVIFS];
611925dc
DS
121
122 struct list *channel_oil_list;
123 struct hash *channel_oil_hash;
2ad78035
DS
124
125 struct pim_msdp msdp;
b583b035 126 struct pim_vxlan_instance vxlan;
71ad9915
DS
127
128 struct list *ssmpingd_list;
129 struct in_addr ssmpingd_group_addr;
19b807ca
DS
130
131 unsigned int keep_alive_time;
132 unsigned int rp_keep_alive_time;
da11e325 133
4795fff7
DS
134 bool ecmp_enable;
135 bool ecmp_rebalance_enable;
36b5b98f
SK
136 /* No. of Dual active I/fs in pim_instance */
137 uint32_t inst_mlag_intf_cnt;
138
361b5843 139 /* Bsm related */
140 struct bsm_scope global_scope;
141 uint64_t bsm_rcvd;
142 uint64_t bsm_sent;
143 uint64_t bsm_dropped;
4795fff7 144
da11e325
DS
145 /* If we need to rescan all our upstreams */
146 struct thread *rpf_cache_refresher;
bfc92019
DS
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;
152
153 int64_t nexthop_lookups;
154 int64_t nexthop_lookups_avoided;
155 int64_t last_route_change_time;
c2cf4b02
DS
156};
157
158void pim_vrf_init(void);
159void pim_vrf_terminate(void);
160
161struct pim_instance *pim_get_pim_instance(vrf_id_t vrf_id);
162
163#endif