diff options
Diffstat (limited to 'pimd/pim_vty.c')
-rw-r--r-- | pimd/pim_vty.c | 131 |
1 files changed, 79 insertions, 52 deletions
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 0f6547ee..b633e81d 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -165,6 +165,11 @@ int pim_debug_config_write(struct vty *vty) ++writes; } + if (PIM_DEBUG_AUTORP) { + vty_out(vty, "debug pim autorp\n"); + ++writes; + } + return writes; } @@ -172,89 +177,70 @@ int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty) { int writes = 0; struct pim_ssm *ssm = pim->ssm_info; - char spaces[10]; - - if (pim->vrf->vrf_id == VRF_DEFAULT) - snprintf(spaces, sizeof(spaces), "%s", ""); - else - snprintf(spaces, sizeof(spaces), "%s", " "); - writes += pim_msdp_peer_config_write(vty, pim, spaces); - writes += pim_msdp_config_write(pim, vty, spaces); + writes += pim_msdp_peer_config_write(vty, pim); + writes += pim_msdp_config_write(pim, vty); if (!pim->send_v6_secondary) { - vty_out(vty, "%sno ip pim send-v6-secondary\n", spaces); + vty_out(vty, " no send-v6-secondary\n"); ++writes; } - writes += pim_rp_config_write(pim, vty, spaces); + writes += pim_rp_config_write(pim, vty); +#if PIM_IPV == 4 + writes += pim_autorp_config_write(pim, vty); +#endif + writes += pim_cand_config_write(pim, vty); if (pim->vrf->vrf_id == VRF_DEFAULT) { if (router->register_suppress_time != PIM_REGISTER_SUPPRESSION_TIME_DEFAULT) { - vty_out(vty, "%s" PIM_AF_NAME " pim register-suppress-time %d\n", - spaces, router->register_suppress_time); + vty_out(vty, " register-suppress-time %d\n", + router->register_suppress_time); ++writes; } if (router->t_periodic != PIM_DEFAULT_T_PERIODIC) { - vty_out(vty, "%s" PIM_AF_NAME " pim join-prune-interval %d\n", - spaces, router->t_periodic); + vty_out(vty, " join-prune-interval %d\n", + router->t_periodic); ++writes; } if (router->packet_process != PIM_DEFAULT_PACKET_PROCESS) { - vty_out(vty, "%s" PIM_AF_NAME " pim packets %d\n", spaces, - router->packet_process); + vty_out(vty, " packets %d\n", router->packet_process); ++writes; } } if (pim->keep_alive_time != PIM_KEEPALIVE_PERIOD) { - vty_out(vty, "%s" PIM_AF_NAME " pim keep-alive-timer %d\n", - spaces, pim->keep_alive_time); + vty_out(vty, " keep-alive-timer %d\n", pim->keep_alive_time); ++writes; } if (pim->rp_keep_alive_time != (unsigned int)PIM_RP_KEEPALIVE_PERIOD) { - vty_out(vty, "%s" PIM_AF_NAME " pim rp keep-alive-timer %d\n", - spaces, pim->rp_keep_alive_time); + vty_out(vty, " rp keep-alive-timer %d\n", + pim->rp_keep_alive_time); ++writes; } if (ssm->plist_name) { - vty_out(vty, "%sip pim ssm prefix-list %s\n", spaces, - ssm->plist_name); + vty_out(vty, " ssm prefix-list %s\n", ssm->plist_name); ++writes; } if (pim->register_plist) { - vty_out(vty, "%sip pim register-accept-list %s\n", spaces, - pim->register_plist); + vty_out(vty, " register-accept-list %s\n", pim->register_plist); ++writes; } if (pim->spt.switchover == PIM_SPT_INFINITY) { if (pim->spt.plist) vty_out(vty, - "%s" PIM_AF_NAME " pim spt-switchover infinity-and-beyond prefix-list %s\n", - spaces, pim->spt.plist); + " spt-switchover infinity-and-beyond prefix-list %s\n", + pim->spt.plist); else - vty_out(vty, - "%s" PIM_AF_NAME " pim spt-switchover infinity-and-beyond\n", - spaces); + vty_out(vty, " spt-switchover infinity-and-beyond\n"); ++writes; } if (pim->ecmp_rebalance_enable) { - vty_out(vty, "%sip pim ecmp rebalance\n", spaces); + vty_out(vty, " ecmp rebalance\n"); ++writes; } else if (pim->ecmp_enable) { - vty_out(vty, "%sip pim ecmp\n", spaces); - ++writes; - } - - if (pim->gm_watermark_limit != 0) { -#if PIM_IPV == 4 - vty_out(vty, "%s" PIM_AF_NAME " igmp watermark-warn %u\n", - spaces, pim->gm_watermark_limit); -#else - vty_out(vty, "%s" PIM_AF_NAME " mld watermark-warn %u\n", - spaces, pim->gm_watermark_limit); -#endif + vty_out(vty, " ecmp\n"); ++writes; } @@ -263,8 +249,7 @@ int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty) struct ssmpingd_sock *ss; ++writes; for (ALL_LIST_ELEMENTS_RO(pim->ssmpingd_list, node, ss)) { - vty_out(vty, "%s" PIM_AF_NAME " ssmpingd %pPA\n", - spaces, &ss->source_addr); + vty_out(vty, " ssmpingd %pPA\n", &ss->source_addr); ++writes; } } @@ -272,8 +257,8 @@ int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty) if (pim->msdp.hold_time != PIM_MSDP_PEER_HOLD_TIME || pim->msdp.keep_alive != PIM_MSDP_PEER_KA_TIME || pim->msdp.connection_retry != PIM_MSDP_PEER_CONNECT_RETRY_TIME) { - vty_out(vty, "%sip msdp timers %u %u", spaces, - pim->msdp.hold_time, pim->msdp.keep_alive); + vty_out(vty, " msdp timers %u %u", pim->msdp.hold_time, + pim->msdp.keep_alive); if (pim->msdp.connection_retry != PIM_MSDP_PEER_CONNECT_RETRY_TIME) vty_out(vty, " %u", pim->msdp.connection_retry); @@ -293,6 +278,11 @@ static int gm_config_write(struct vty *vty, int writes, ++writes; } + if (pim_ifp->gm_proxy) { + vty_out(vty, " ip igmp proxy\n"); + ++writes; + } + /* ip igmp version */ if (pim_ifp->igmp_version != IGMP_DEFAULT_VERSION) { vty_out(vty, " ip igmp version %d\n", pim_ifp->igmp_version); @@ -330,21 +320,38 @@ static int gm_config_write(struct vty *vty, int writes, ++writes; } - /* IF ip igmp join */ + /* IF ip igmp join-group */ if (pim_ifp->gm_join_list) { struct listnode *node; struct gm_join *ij; for (ALL_LIST_ELEMENTS_RO(pim_ifp->gm_join_list, node, ij)) { if (pim_addr_is_any(ij->source_addr)) - vty_out(vty, " ip igmp join %pPAs\n", + vty_out(vty, " ip igmp join-group %pPAs\n", &ij->group_addr); else - vty_out(vty, " ip igmp join %pPAs %pPAs\n", + vty_out(vty, " ip igmp join-group %pPAs %pPAs\n", &ij->group_addr, &ij->source_addr); ++writes; } } + /* IF ip igmp static-group */ + if (pim_ifp->static_group_list) { + struct listnode *node; + struct static_group *stgrp; + for (ALL_LIST_ELEMENTS_RO(pim_ifp->static_group_list, node, + stgrp)) { + if (pim_addr_is_any(stgrp->source_addr)) + vty_out(vty, " ip igmp static-group %pPAs\n", + &stgrp->group_addr); + else + vty_out(vty, + " ip igmp static-group %pPAs %pPAs\n", + &stgrp->group_addr, &stgrp->source_addr); + ++writes; + } + } + return writes; } #else @@ -382,21 +389,41 @@ static int gm_config_write(struct vty *vty, int writes, vty_out(vty, " ipv6 mld last-member-query-interval %d\n", pim_ifp->gm_specific_query_max_response_time_dsec); - /* IF ipv6 mld join */ + /* IF ipv6 mld join-group */ if (pim_ifp->gm_join_list) { struct listnode *node; struct gm_join *ij; + for (ALL_LIST_ELEMENTS_RO(pim_ifp->gm_join_list, node, ij)) { if (pim_addr_is_any(ij->source_addr)) - vty_out(vty, " ipv6 mld join %pPAs\n", + vty_out(vty, " ipv6 mld join-group %pPAs\n", &ij->group_addr); else - vty_out(vty, " ipv6 mld join %pPAs %pPAs\n", + vty_out(vty, + " ipv6 mld join-group %pPAs %pPAs\n", &ij->group_addr, &ij->source_addr); ++writes; } } + /* IF ipv6 mld static-group */ + if (pim_ifp->static_group_list) { + struct listnode *node; + struct static_group *stgrp; + + for (ALL_LIST_ELEMENTS_RO(pim_ifp->static_group_list, node, + stgrp)) { + if (pim_addr_is_any(stgrp->source_addr)) + vty_out(vty, " ipv6 mld static-group %pPAs\n", + &stgrp->group_addr); + else + vty_out(vty, + " ipv6 mld static-group %pPAs %pPAs\n", + &stgrp->group_addr, &stgrp->source_addr); + ++writes; + } + } + return writes; } #endif |