diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-12-20 10:34:04 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-01-04 12:21:00 -0500 | 
| commit | 36417fcc20b4a21b26a4e63902caca2eecbad4ed (patch) | |
| tree | da63cbef60f00c6ae2d61ad084ea3cab62d00f5f /pimd/pimd.c | |
| parent | 763ec244cfbbcd61e9e3a2dfcdf134cc8ec48925 (diff) | |
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.c | 20 | 
1 files changed, 18 insertions, 2 deletions
diff --git a/pimd/pimd.c b/pimd/pimd.c index 5d3018b2fd..27a7d49734 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();  }  | 
