diff options
| author | Mobashshera Rasool <mrasool@vmware.com> | 2022-02-25 03:01:57 -0800 | 
|---|---|---|
| committer | Mobashshera Rasool <mrasool@vmware.com> | 2022-02-28 01:38:41 -0800 | 
| commit | 078c5867a1e09cd2dd7e0a984860e82d4208e7f9 (patch) | |
| tree | 22572226ec62456a4aa85f8bd68716a80198f212 /pimd/pim_vty.c | |
| parent | ebde3825c4bfebd7756a8b8e7dc528c34fc57bae (diff) | |
pimd: Moving igmp "show running-config" to a function
Moving the igmp related commands running config to
a new function specific to pimv4.
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
Diffstat (limited to 'pimd/pim_vty.c')
| -rw-r--r-- | pimd/pim_vty.c | 74 | 
1 files changed, 42 insertions, 32 deletions
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index a70479d3da..6558068895 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -282,39 +282,9 @@ int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty)  }  #if PIM_IPV == 4 -int pim_config_write(struct vty *vty, int writes, struct interface *ifp, -		     struct pim_instance *pim) +static int pim_igmp_config_write(struct vty *vty, int writes, +				 struct pim_interface *pim_ifp)  { -	struct pim_interface *pim_ifp = ifp->info; - -	if (PIM_IF_TEST_PIM(pim_ifp->options)) { -		vty_out(vty, " ip pim\n"); -		++writes; -	} - -	/* IF ip pim drpriority */ -	if (pim_ifp->pim_dr_priority != PIM_DEFAULT_DR_PRIORITY) { -		vty_out(vty, " ip pim drpriority %u\n", -			pim_ifp->pim_dr_priority); -		++writes; -	} - -	/* IF ip pim hello */ -	if (pim_ifp->pim_hello_period != PIM_DEFAULT_HELLO_PERIOD) { -		vty_out(vty, " ip pim hello %d", pim_ifp->pim_hello_period); -		if (pim_ifp->pim_default_holdtime != -1) -			vty_out(vty, " %d", pim_ifp->pim_default_holdtime); -		vty_out(vty, "\n"); -		++writes; -	} - -	/* update source */ -	if (!pim_addr_is_any(pim_ifp->update_source)) { -		vty_out(vty, " ip pim use-source %pPA\n", -			&pim_ifp->update_source); -		++writes; -	} -  	/* IF ip igmp */  	if (PIM_IF_TEST_IGMP(pim_ifp->options)) {  		vty_out(vty, " ip igmp\n"); @@ -379,6 +349,46 @@ int pim_config_write(struct vty *vty, int writes, struct interface *ifp,  		}  	} +	return writes; +} +#endif + +#if PIM_IPV == 4 +int pim_config_write(struct vty *vty, int writes, struct interface *ifp, +		     struct pim_instance *pim) +{ +	struct pim_interface *pim_ifp = ifp->info; + +	if (PIM_IF_TEST_PIM(pim_ifp->options)) { +		vty_out(vty, " ip pim\n"); +		++writes; +	} + +	/* IF ip pim drpriority */ +	if (pim_ifp->pim_dr_priority != PIM_DEFAULT_DR_PRIORITY) { +		vty_out(vty, " ip pim drpriority %u\n", +			pim_ifp->pim_dr_priority); +		++writes; +	} + +	/* IF ip pim hello */ +	if (pim_ifp->pim_hello_period != PIM_DEFAULT_HELLO_PERIOD) { +		vty_out(vty, " ip pim hello %d", pim_ifp->pim_hello_period); +		if (pim_ifp->pim_default_holdtime != -1) +			vty_out(vty, " %d", pim_ifp->pim_default_holdtime); +		vty_out(vty, "\n"); +		++writes; +	} + +	writes += pim_igmp_config_write(vty, writes, pim_ifp); + +	/* update source */ +	if (!pim_addr_is_any(pim_ifp->update_source)) { +		vty_out(vty, " ip pim use-source %pPA\n", +			&pim_ifp->update_source); +		++writes; +	} +  	if (pim_ifp->activeactive)  		vty_out(vty, " ip pim active-active\n");  | 
