summaryrefslogtreecommitdiffstats
path: root/pimd/pimd.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-12-20 16:34:04 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-01-04 18:21:00 +0100
commit36417fcc20b4a21b26a4e63902caca2eecbad4ed (patch)
treeda63cbef60f00c6ae2d61ad084ea3cab62d00f5f /pimd/pimd.c
parentzebra: Add test and show commands for mlag (diff)
downloadfrr-36417fcc20b4a21b26a4e63902caca2eecbad4ed.tar.xz
frr-36417fcc20b4a21b26a4e63902caca2eecbad4ed.zip
pimd: Create a `struct pim_router` and move thread master into it
Create a `struct pim_router` and move the thread master into it. Future commits will further move global varaibles into the pim_router structure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pimd.c')
-rw-r--r--pimd/pimd.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/pimd/pimd.c b/pimd/pimd.c
index 5d3018b2f..27a7d4973 100644
--- a/pimd/pimd.c
+++ b/pimd/pimd.c
@@ -47,7 +47,10 @@ const char *const PIM_ALL_ROUTERS = MCAST_ALL_ROUTERS;
const char *const PIM_ALL_PIM_ROUTERS = MCAST_ALL_PIM_ROUTERS;
const char *const PIM_ALL_IGMP_ROUTERS = MCAST_ALL_IGMP_ROUTERS;
-struct thread_master *master = NULL;
+DEFINE_MTYPE_STATIC(PIMD, ROUTER, "PIM Router information");
+
+struct pim_router *router = NULL;
+
uint32_t qpim_debugs = 0;
int qpim_t_periodic =
PIM_DEFAULT_T_PERIODIC; /* Period between Join/Prune Messages */
@@ -82,7 +85,19 @@ static void pim_free()
zclient_lookup_free();
}
-void pim_init()
+void pim_router_init(void)
+{
+ router = XCALLOC(MTYPE_ROUTER, sizeof(*router));
+
+ router->master = frr_init();
+}
+
+void pim_router_terminate(void)
+{
+ XFREE(MTYPE_ROUTER, router);
+}
+
+void pim_init(void)
{
if (!inet_aton(PIM_ALL_PIM_ROUTERS, &qpim_all_pim_routers_addr)) {
flog_err(
@@ -130,5 +145,6 @@ void pim_terminate()
zclient_free(zclient);
}
+ pim_router_terminate();
frr_fini();
}