diff options
author | whitespace / reindent <invalid@invalid.invalid> | 2017-07-17 14:03:14 +0200 |
---|---|---|
committer | whitespace / reindent <invalid@invalid.invalid> | 2017-07-17 14:04:07 +0200 |
commit | d62a17aedeb0eebdba98238874bb13d62c48dbf9 (patch) | |
tree | 3b319b1d61c8b85b4d1f06adf8b844bb8a9b5107 /pimd/pim_vty.c | |
parent | *: add indent control files (diff) | |
download | frr-d62a17aedeb0eebdba98238874bb13d62c48dbf9.tar.xz frr-d62a17aedeb0eebdba98238874bb13d62c48dbf9.zip |
*: reindentreindent-master-after
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_vty.c')
-rw-r--r-- | pimd/pim_vty.c | 537 |
1 files changed, 270 insertions, 267 deletions
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 81b49c630..a78776791 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -40,284 +40,287 @@ #include "pim_ssm.h" #include "pim_bfd.h" -int -pim_debug_config_write (struct vty *vty) +int pim_debug_config_write(struct vty *vty) { - int writes = 0; - - if (PIM_DEBUG_MSDP_EVENTS) { - vty_out (vty, "debug msdp events\n"); - ++writes; - } - if (PIM_DEBUG_MSDP_PACKETS) { - vty_out (vty, "debug msdp packets\n"); - ++writes; - } - if (PIM_DEBUG_MSDP_INTERNAL) { - vty_out (vty, "debug msdp internal\n"); - ++writes; - } - if (PIM_DEBUG_IGMP_EVENTS) { - vty_out (vty, "debug igmp events\n"); - ++writes; - } - if (PIM_DEBUG_IGMP_PACKETS) { - vty_out (vty, "debug igmp packets\n"); - ++writes; - } - if (PIM_DEBUG_IGMP_TRACE) { - vty_out (vty, "debug igmp trace\n"); - ++writes; - } - if (PIM_DEBUG_IGMP_TRACE_DETAIL) { - vty_out (vty, "debug igmp trace detail\n"); - ++writes; - } - - if (PIM_DEBUG_MROUTE) { - vty_out (vty, "debug mroute\n"); - ++writes; - } - - if (PIM_DEBUG_MROUTE_DETAIL) { - vty_out (vty, "debug mroute detail\n"); - ++writes; - } - - if (PIM_DEBUG_PIM_EVENTS) { - vty_out (vty, "debug pim events\n"); - ++writes; - } - if (PIM_DEBUG_PIM_PACKETS) { - vty_out (vty, "debug pim packets\n"); - ++writes; - } - if (PIM_DEBUG_PIM_PACKETDUMP_SEND) { - vty_out (vty, "debug pim packet-dump send\n"); - ++writes; - } - if (PIM_DEBUG_PIM_PACKETDUMP_RECV) { - vty_out (vty, "debug pim packet-dump receive\n"); - ++writes; - } - - if (PIM_DEBUG_PIM_TRACE) { - vty_out (vty, "debug pim trace\n"); - ++writes; - } - if (PIM_DEBUG_PIM_TRACE_DETAIL) { - vty_out (vty, "debug pim trace detail\n"); - ++writes; - } - - if (PIM_DEBUG_ZEBRA) { - vty_out (vty, "debug pim zebra\n"); - ++writes; - } - - if (PIM_DEBUG_SSMPINGD) { - vty_out (vty, "debug ssmpingd\n"); - ++writes; - } - - if (PIM_DEBUG_PIM_HELLO) { - vty_out (vty, "debug pim packets hello\n"); - ++writes; - } - - if (PIM_DEBUG_PIM_J_P) { - vty_out (vty, "debug pim packets joins\n"); - ++writes; - } - - if (PIM_DEBUG_PIM_REG) { - vty_out (vty, "debug pim packets register\n"); - ++writes; - } - - if (PIM_DEBUG_STATIC) { - vty_out (vty, "debug pim static\n"); - ++writes; - } - - return writes; + int writes = 0; + + if (PIM_DEBUG_MSDP_EVENTS) { + vty_out(vty, "debug msdp events\n"); + ++writes; + } + if (PIM_DEBUG_MSDP_PACKETS) { + vty_out(vty, "debug msdp packets\n"); + ++writes; + } + if (PIM_DEBUG_MSDP_INTERNAL) { + vty_out(vty, "debug msdp internal\n"); + ++writes; + } + if (PIM_DEBUG_IGMP_EVENTS) { + vty_out(vty, "debug igmp events\n"); + ++writes; + } + if (PIM_DEBUG_IGMP_PACKETS) { + vty_out(vty, "debug igmp packets\n"); + ++writes; + } + if (PIM_DEBUG_IGMP_TRACE) { + vty_out(vty, "debug igmp trace\n"); + ++writes; + } + if (PIM_DEBUG_IGMP_TRACE_DETAIL) { + vty_out(vty, "debug igmp trace detail\n"); + ++writes; + } + + if (PIM_DEBUG_MROUTE) { + vty_out(vty, "debug mroute\n"); + ++writes; + } + + if (PIM_DEBUG_MROUTE_DETAIL) { + vty_out(vty, "debug mroute detail\n"); + ++writes; + } + + if (PIM_DEBUG_PIM_EVENTS) { + vty_out(vty, "debug pim events\n"); + ++writes; + } + if (PIM_DEBUG_PIM_PACKETS) { + vty_out(vty, "debug pim packets\n"); + ++writes; + } + if (PIM_DEBUG_PIM_PACKETDUMP_SEND) { + vty_out(vty, "debug pim packet-dump send\n"); + ++writes; + } + if (PIM_DEBUG_PIM_PACKETDUMP_RECV) { + vty_out(vty, "debug pim packet-dump receive\n"); + ++writes; + } + + if (PIM_DEBUG_PIM_TRACE) { + vty_out(vty, "debug pim trace\n"); + ++writes; + } + if (PIM_DEBUG_PIM_TRACE_DETAIL) { + vty_out(vty, "debug pim trace detail\n"); + ++writes; + } + + if (PIM_DEBUG_ZEBRA) { + vty_out(vty, "debug pim zebra\n"); + ++writes; + } + + if (PIM_DEBUG_SSMPINGD) { + vty_out(vty, "debug ssmpingd\n"); + ++writes; + } + + if (PIM_DEBUG_PIM_HELLO) { + vty_out(vty, "debug pim packets hello\n"); + ++writes; + } + + if (PIM_DEBUG_PIM_J_P) { + vty_out(vty, "debug pim packets joins\n"); + ++writes; + } + + if (PIM_DEBUG_PIM_REG) { + vty_out(vty, "debug pim packets register\n"); + ++writes; + } + + if (PIM_DEBUG_STATIC) { + vty_out(vty, "debug pim static\n"); + ++writes; + } + + return writes; } int pim_global_config_write(struct vty *vty) { - int writes = 0; - struct pim_ssm *ssm = pimg->ssm_info; - - writes += pim_msdp_config_write (vty); - - if (!pimg->send_v6_secondary) - { - vty_out (vty, "no ip pim send-v6-secondary\n"); - ++writes; - } - - writes += pim_rp_config_write (vty); - - if (qpim_register_suppress_time != PIM_REGISTER_SUPPRESSION_TIME_DEFAULT) - { - vty_out (vty, "ip pim register-suppress-time %d\n", - qpim_register_suppress_time); - ++writes; - } - if (qpim_t_periodic != PIM_DEFAULT_T_PERIODIC) - { - vty_out (vty, "ip pim join-prune-interval %d\n", - qpim_t_periodic); - ++writes; - } - if (qpim_keep_alive_time != PIM_KEEPALIVE_PERIOD) - { - vty_out (vty, "ip pim keep-alive-timer %d\n", - qpim_keep_alive_time); - ++writes; - } - if (qpim_packet_process != PIM_DEFAULT_PACKET_PROCESS) - { - vty_out (vty, "ip pim packets %d\n", - qpim_packet_process); - ++writes; - } - if (ssm->plist_name) - { - vty_out (vty, "ip pim ssm prefix-list %s\n", - 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\n", - pimg->spt.plist); - else - vty_out (vty,"ip pim spt-switchover infinity-and-beyond\n"); - ++writes; - } - if (qpim_ecmp_rebalance_enable) - { - vty_out (vty, "ip pim ecmp rebalance\n"); - ++writes; - } - else if (qpim_ecmp_enable) - { - vty_out (vty, "ip pim ecmp\n"); - ++writes; - } - if (qpim_ssmpingd_list) { - struct listnode *node; - struct ssmpingd_sock *ss; - vty_out (vty, "!\n"); - ++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\n", source_str); - ++writes; - } - } - - return writes; -} + int writes = 0; + struct pim_ssm *ssm = pimg->ssm_info; -int pim_interface_config_write(struct vty *vty) -{ - int writes = 0; - struct listnode *node; - struct interface *ifp; - - for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp)) { - - /* IF name */ - vty_out (vty, "interface %s\n", 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\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"); - } - - /* update source */ - if (PIM_INADDR_ISNOT_ANY(pim_ifp->update_source)) { - 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\n", src_str); - ++writes; - } - - /* IF ip igmp */ - if (PIM_IF_TEST_IGMP(pim_ifp->options)) { - vty_out (vty, " ip igmp\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); - ++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\n", - pim_ifp->igmp_default_query_interval); - ++writes; + writes += pim_msdp_config_write(vty); + + if (!pimg->send_v6_secondary) { + vty_out(vty, "no ip pim send-v6-secondary\n"); + ++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\n", - pim_ifp->igmp_query_max_response_time_dsec); - ++writes; + writes += pim_rp_config_write(vty); + + if (qpim_register_suppress_time + != PIM_REGISTER_SUPPRESSION_TIME_DEFAULT) { + vty_out(vty, "ip pim register-suppress-time %d\n", + qpim_register_suppress_time); + ++writes; } + if (qpim_t_periodic != PIM_DEFAULT_T_PERIODIC) { + vty_out(vty, "ip pim join-prune-interval %d\n", + qpim_t_periodic); + ++writes; + } + if (qpim_keep_alive_time != PIM_KEEPALIVE_PERIOD) { + vty_out(vty, "ip pim keep-alive-timer %d\n", + qpim_keep_alive_time); + ++writes; + } + if (qpim_packet_process != PIM_DEFAULT_PACKET_PROCESS) { + vty_out(vty, "ip pim packets %d\n", qpim_packet_process); + ++writes; + } + if (ssm->plist_name) { + vty_out(vty, "ip pim ssm prefix-list %s\n", 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\n", + pimg->spt.plist); + else + vty_out(vty, + "ip pim spt-switchover infinity-and-beyond\n"); + ++writes; + } + if (qpim_ecmp_rebalance_enable) { + vty_out(vty, "ip pim ecmp rebalance\n"); + ++writes; + } else if (qpim_ecmp_enable) { + vty_out(vty, "ip pim ecmp\n"); + ++writes; + } + if (qpim_ssmpingd_list) { + struct listnode *node; + struct ssmpingd_sock *ss; + vty_out(vty, "!\n"); + ++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\n", source_str); + ++writes; + } + } + + return writes; +} - /* IF ip igmp join */ - if (pim_ifp->igmp_join_list) { +int pim_interface_config_write(struct vty *vty) +{ + int writes = 0; struct listnode *node; - struct igmp_join *ij; - for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_join_list, node, ij)) { - char group_str[INET_ADDRSTRLEN]; - 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\n", - group_str,source_str); - ++writes; + struct interface *ifp; + + for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) { + + /* IF name */ + vty_out(vty, "interface %s\n", 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\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"); + } + + /* update source */ + if (PIM_INADDR_ISNOT_ANY(pim_ifp->update_source)) { + 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\n", + src_str); + ++writes; + } + + /* IF ip igmp */ + if (PIM_IF_TEST_IGMP(pim_ifp->options)) { + vty_out(vty, " ip igmp\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); + ++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\n", + 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\n", + pim_ifp->igmp_query_max_response_time_dsec); + ++writes; + } + + /* IF ip igmp join */ + if (pim_ifp->igmp_join_list) { + struct listnode *node; + struct igmp_join *ij; + for (ALL_LIST_ELEMENTS_RO( + pim_ifp->igmp_join_list, node, + ij)) { + char group_str[INET_ADDRSTRLEN]; + 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\n", + group_str, source_str); + ++writes; + } + } + + writes += pim_static_write_mroute(vty, ifp); + } + vty_out(vty, "!\n"); + ++writes; + /* PIM BFD write */ + pim_bfd_write_config(vty, ifp); } - } - - writes += pim_static_write_mroute (vty, ifp); - } - vty_out (vty, "!\n"); - ++writes; - /* PIM BFD write */ - pim_bfd_write_config (vty, ifp); - } - return writes; + return writes; } |