summaryrefslogtreecommitdiff
path: root/pimd/pim_instance.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-05-18 18:51:31 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 13:51:35 -0400
commitc2cf4b0230faec3e0c478cb7ab14030a6ffe0593 (patch)
treeecd191d414d3ad8101f3537af7d88d835c417f02 /pimd/pim_instance.h
parent72ec4672899d4042c9f7dc2203b2e1771c90ac89 (diff)
pimd: Refactor code to be in better spots
1) Create pim_instance.[ch] to allow us to handle the instance information there 2) Refactor some pim_rpf_ and some pim_rp commands into appropriate files and appropriate includes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_instance.h')
-rw-r--r--pimd/pim_instance.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/pimd/pim_instance.h b/pimd/pim_instance.h
new file mode 100644
index 0000000000..33f81497fc
--- /dev/null
+++ b/pimd/pim_instance.h
@@ -0,0 +1,63 @@
+/*
+ * PIM for FRR - PIM Instance
+ * Copyright (C) 2017 Cumulus Networks, Inc.
+ * Donald Sharp
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+#ifndef __PIM_INSTANCE_H__
+#define __PIM_INSTANCE_H__
+
+extern struct pim_instance *pimg; // Pim Global Instance
+
+enum pim_spt_switchover {
+ PIM_SPT_IMMEDIATE,
+ PIM_SPT_INFINITY,
+};
+
+/* Per VRF PIM DB */
+struct pim_instance {
+ vrf_id_t vrf_id;
+ struct vrf *vrf;
+
+ struct {
+ enum pim_spt_switchover switchover;
+ char *plist;
+ } spt;
+
+ struct hash *rpf_hash;
+
+ void *ssm_info; /* per-vrf SSM configuration */
+
+ int send_v6_secondary;
+
+ struct thread *thread;
+ int mroute_socket;
+ int64_t mroute_socket_creation;
+ int64_t mroute_add_events;
+ int64_t mroute_add_last;
+ int64_t mroute_del_events;
+ int64_t mroute_del_last;
+
+ struct interface *regiface;
+};
+
+void pim_vrf_init(void);
+void pim_vrf_terminate(void);
+
+struct pim_instance *pim_get_pim_instance(vrf_id_t vrf_id);
+
+#endif