diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-21 05:10:57 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-29 19:31:28 +0200 |
commit | 96ade3ed7716c89b8047a1c0ab3377985d461cf8 (patch) | |
tree | 1c3061738c2c0027612b6cdb3e5d5eccb08587bf /pimd/pim_vty.c | |
parent | lib: add vty_outln() (diff) | |
download | frr-96ade3ed7716c89b8047a1c0ab3377985d461cf8.tar.xz frr-96ade3ed7716c89b8047a1c0ab3377985d461cf8.zip |
*: use vty_outln
Saves 400 lines
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_vty.c')
-rw-r--r-- | pimd/pim_vty.c | 114 |
1 files changed, 54 insertions, 60 deletions
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index f87484ad5..426241ac0 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -46,97 +46,97 @@ pim_debug_config_write (struct vty *vty) int writes = 0; if (PIM_DEBUG_MSDP_EVENTS) { - vty_out(vty, "debug msdp events%s", VTY_NEWLINE); + vty_outln (vty, "debug msdp events"); ++writes; } if (PIM_DEBUG_MSDP_PACKETS) { - vty_out(vty, "debug msdp packets%s", VTY_NEWLINE); + vty_outln (vty, "debug msdp packets"); ++writes; } if (PIM_DEBUG_MSDP_INTERNAL) { - vty_out(vty, "debug msdp internal%s", VTY_NEWLINE); + vty_outln (vty, "debug msdp internal"); ++writes; } if (PIM_DEBUG_IGMP_EVENTS) { - vty_out(vty, "debug igmp events%s", VTY_NEWLINE); + vty_outln (vty, "debug igmp events"); ++writes; } if (PIM_DEBUG_IGMP_PACKETS) { - vty_out(vty, "debug igmp packets%s", VTY_NEWLINE); + vty_outln (vty, "debug igmp packets"); ++writes; } if (PIM_DEBUG_IGMP_TRACE) { - vty_out(vty, "debug igmp trace%s", VTY_NEWLINE); + vty_outln (vty, "debug igmp trace"); ++writes; } if (PIM_DEBUG_IGMP_TRACE_DETAIL) { - vty_out(vty, "debug igmp trace detail%s", VTY_NEWLINE); + vty_outln (vty, "debug igmp trace detail"); ++writes; } if (PIM_DEBUG_MROUTE) { - vty_out(vty, "debug mroute%s", VTY_NEWLINE); + vty_outln (vty, "debug mroute"); ++writes; } if (PIM_DEBUG_MROUTE_DETAIL) { - vty_out (vty, "debug mroute detail%s", VTY_NEWLINE); + vty_outln (vty, "debug mroute detail"); ++writes; } if (PIM_DEBUG_PIM_EVENTS) { - vty_out(vty, "debug pim events%s", VTY_NEWLINE); + vty_outln (vty, "debug pim events"); ++writes; } if (PIM_DEBUG_PIM_PACKETS) { - vty_out(vty, "debug pim packets%s", VTY_NEWLINE); + vty_outln (vty, "debug pim packets"); ++writes; } if (PIM_DEBUG_PIM_PACKETDUMP_SEND) { - vty_out(vty, "debug pim packet-dump send%s", VTY_NEWLINE); + vty_outln (vty, "debug pim packet-dump send"); ++writes; } if (PIM_DEBUG_PIM_PACKETDUMP_RECV) { - vty_out(vty, "debug pim packet-dump receive%s", VTY_NEWLINE); + vty_outln (vty, "debug pim packet-dump receive"); ++writes; } if (PIM_DEBUG_PIM_TRACE) { - vty_out(vty, "debug pim trace%s", VTY_NEWLINE); + vty_outln (vty, "debug pim trace"); ++writes; } if (PIM_DEBUG_PIM_TRACE_DETAIL) { - vty_out(vty, "debug pim trace detail%s", VTY_NEWLINE); + vty_outln (vty, "debug pim trace detail"); ++writes; } if (PIM_DEBUG_ZEBRA) { - vty_out(vty, "debug pim zebra%s", VTY_NEWLINE); + vty_outln (vty, "debug pim zebra"); ++writes; } if (PIM_DEBUG_SSMPINGD) { - vty_out(vty, "debug ssmpingd%s", VTY_NEWLINE); + vty_outln (vty, "debug ssmpingd"); ++writes; } if (PIM_DEBUG_PIM_HELLO) { - vty_out (vty, "debug pim packets hello%s", VTY_NEWLINE); + vty_outln (vty, "debug pim packets hello"); ++writes; } if (PIM_DEBUG_PIM_J_P) { - vty_out (vty, "debug pim packets joins%s", VTY_NEWLINE); + vty_outln (vty, "debug pim packets joins"); ++writes; } if (PIM_DEBUG_PIM_REG) { - vty_out (vty, "debug pim packets register%s", VTY_NEWLINE); + vty_outln (vty, "debug pim packets register"); ++writes; } if (PIM_DEBUG_STATIC) { - vty_out (vty, "debug pim static%s", VTY_NEWLINE); + vty_outln (vty, "debug pim static"); ++writes; } @@ -152,7 +152,7 @@ int pim_global_config_write(struct vty *vty) if (!pimg->send_v6_secondary) { - vty_out (vty, "no ip pim send-v6-secondary%s", VTY_NEWLINE); + vty_outln (vty, "no ip pim send-v6-secondary"); ++writes; } @@ -160,63 +160,62 @@ int pim_global_config_write(struct vty *vty) if (qpim_register_suppress_time != PIM_REGISTER_SUPPRESSION_TIME_DEFAULT) { - vty_out (vty, "ip pim register-suppress-time %d%s", - qpim_register_suppress_time, VTY_NEWLINE); + vty_outln (vty, "ip pim register-suppress-time %d", + qpim_register_suppress_time); ++writes; } if (qpim_t_periodic != PIM_DEFAULT_T_PERIODIC) { - vty_out (vty, "ip pim join-prune-interval %d%s", - qpim_t_periodic, VTY_NEWLINE); + vty_outln (vty, "ip pim join-prune-interval %d", + qpim_t_periodic); ++writes; } if (qpim_keep_alive_time != PIM_KEEPALIVE_PERIOD) { - vty_out (vty, "ip pim keep-alive-timer %d%s", - qpim_keep_alive_time, VTY_NEWLINE); + vty_outln (vty, "ip pim keep-alive-timer %d", + qpim_keep_alive_time); ++writes; } if (qpim_packet_process != PIM_DEFAULT_PACKET_PROCESS) { - vty_out (vty, "ip pim packets %d%s", - qpim_packet_process, VTY_NEWLINE); + vty_outln (vty, "ip pim packets %d", + qpim_packet_process); ++writes; } if (ssm->plist_name) { - vty_out (vty, "ip pim ssm prefix-list %s%s", - ssm->plist_name, VTY_NEWLINE); + vty_outln (vty, "ip pim ssm prefix-list %s", + ssm->plist_name); ++writes; } if (pimg->spt.switchover == PIM_SPT_INFINITY) { if (pimg->spt.plist) - vty_out (vty, "ip pim spt-switchover infinity-and-beyond prefix-list %s%s", - pimg->spt.plist, VTY_NEWLINE); + vty_outln (vty, "ip pim spt-switchover infinity-and-beyond prefix-list %s", + pimg->spt.plist); else - vty_out (vty, "ip pim spt-switchover infinity-and-beyond%s", - VTY_NEWLINE); + vty_outln (vty,"ip pim spt-switchover infinity-and-beyond"); ++writes; } if (qpim_ecmp_rebalance_enable) { - vty_out (vty, "ip pim ecmp rebalance%s", VTY_NEWLINE); + vty_outln (vty, "ip pim ecmp rebalance"); ++writes; } else if (qpim_ecmp_enable) { - vty_out (vty, "ip pim ecmp%s", VTY_NEWLINE); + vty_outln (vty, "ip pim ecmp"); ++writes; } if (qpim_ssmpingd_list) { struct listnode *node; struct ssmpingd_sock *ss; - vty_out(vty, "!%s", VTY_NEWLINE); + vty_outln (vty, "!"); ++writes; for (ALL_LIST_ELEMENTS_RO(qpim_ssmpingd_list, node, ss)) { char source_str[INET_ADDRSTRLEN]; pim_inet4_dump("<src?>", ss->source_addr, source_str, sizeof(source_str)); - vty_out(vty, "ip ssmpingd %s%s", source_str, VTY_NEWLINE); + vty_outln (vty, "ip ssmpingd %s", source_str); ++writes; } } @@ -233,21 +232,20 @@ int pim_interface_config_write(struct vty *vty) for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) { /* IF name */ - vty_out(vty, "interface %s%s", ifp->name, VTY_NEWLINE); + vty_outln (vty, "interface %s", ifp->name); ++writes; if (ifp->info) { struct pim_interface *pim_ifp = ifp->info; if (PIM_IF_TEST_PIM(pim_ifp->options)) { - vty_out(vty, " ip pim sm%s", VTY_NEWLINE); + vty_outln (vty, " ip pim sm"); ++writes; } /* IF ip pim drpriority */ if (pim_ifp->pim_dr_priority != PIM_DEFAULT_DR_PRIORITY) { - vty_out(vty, " ip pim drpriority %u%s", pim_ifp->pim_dr_priority, - VTY_NEWLINE); + vty_outln (vty, " ip pim drpriority %u",pim_ifp->pim_dr_priority); ++writes; } @@ -256,7 +254,7 @@ int pim_interface_config_write(struct vty *vty) 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, "%s", VTY_NEWLINE); + vty_outln (vty, ""); } /* update source */ @@ -264,40 +262,37 @@ int pim_interface_config_write(struct vty *vty) char src_str[INET_ADDRSTRLEN]; pim_inet4_dump("<src?>", pim_ifp->update_source, src_str, sizeof(src_str)); - vty_out(vty, " ip pim use-source %s%s", src_str, VTY_NEWLINE); + vty_outln (vty, " ip pim use-source %s", src_str); ++writes; } /* IF ip igmp */ if (PIM_IF_TEST_IGMP(pim_ifp->options)) { - vty_out(vty, " ip igmp%s", VTY_NEWLINE); + vty_outln (vty, " ip igmp"); ++writes; } /* ip igmp version */ if (pim_ifp->igmp_version != IGMP_DEFAULT_VERSION) { - vty_out(vty, " ip igmp version %d%s", - pim_ifp->igmp_version, - VTY_NEWLINE); + vty_outln (vty, " ip igmp version %d", + pim_ifp->igmp_version); ++writes; } /* IF ip igmp query-interval */ if (pim_ifp->igmp_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL) { - vty_out(vty, " ip igmp query-interval %d%s", - pim_ifp->igmp_default_query_interval, - VTY_NEWLINE); + vty_outln (vty, " ip igmp query-interval %d", + pim_ifp->igmp_default_query_interval); ++writes; } /* IF ip igmp query-max-response-time */ if (pim_ifp->igmp_query_max_response_time_dsec != IGMP_QUERY_MAX_RESPONSE_TIME_DSEC) { - vty_out(vty, " ip igmp query-max-response-time %d%s", - pim_ifp->igmp_query_max_response_time_dsec, - VTY_NEWLINE); + vty_outln (vty, " ip igmp query-max-response-time %d", + pim_ifp->igmp_query_max_response_time_dsec); ++writes; } @@ -310,16 +305,15 @@ int pim_interface_config_write(struct vty *vty) char source_str[INET_ADDRSTRLEN]; pim_inet4_dump("<grp?>", ij->group_addr, group_str, sizeof(group_str)); inet_ntop(AF_INET, &ij->source_addr, source_str, sizeof(source_str)); - vty_out(vty, " ip igmp join %s %s%s", - group_str, source_str, - VTY_NEWLINE); + vty_outln (vty, " ip igmp join %s %s", + group_str,source_str); ++writes; } } writes += pim_static_write_mroute (vty, ifp); } - vty_out(vty, "!%s", VTY_NEWLINE); + vty_outln (vty, "!"); ++writes; /* PIM BFD write */ pim_bfd_write_config (vty, ifp); |