diff options
Diffstat (limited to 'pimd/pim_vty.c')
| -rw-r--r-- | pimd/pim_vty.c | 123 |
1 files changed, 105 insertions, 18 deletions
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 07c65e4e53..5b6a79b95a 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -22,7 +22,10 @@ #include "if.h" #include "linklist.h" +#include "prefix.h" +#include "vty.h" #include "vrf.h" +#include "plist.h" #include "pimd.h" #include "pim_vty.h" @@ -33,11 +36,26 @@ #include "pim_pim.h" #include "pim_oil.h" #include "pim_static.h" +#include "pim_rp.h" +#include "pim_msdp.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%s", VTY_NEWLINE); + ++writes; + } + if (PIM_DEBUG_MSDP_PACKETS) { + vty_out(vty, "debug msdp packets%s", VTY_NEWLINE); + ++writes; + } + if (PIM_DEBUG_MSDP_INTERNAL) { + vty_out(vty, "debug msdp internal%s", VTY_NEWLINE); + ++writes; + } if (PIM_DEBUG_IGMP_EVENTS) { vty_out(vty, "debug igmp events%s", VTY_NEWLINE); ++writes; @@ -50,12 +68,21 @@ int pim_debug_config_write(struct vty *vty) vty_out(vty, "debug igmp trace%s", VTY_NEWLINE); ++writes; } + if (PIM_DEBUG_IGMP_TRACE_DETAIL) { + vty_out(vty, "debug igmp trace detail%s", VTY_NEWLINE); + ++writes; + } if (PIM_DEBUG_MROUTE) { vty_out(vty, "debug mroute%s", VTY_NEWLINE); ++writes; } + if (PIM_DEBUG_MROUTE_DETAIL) { + vty_out (vty, "debug mroute detail%s", VTY_NEWLINE); + ++writes; + } + if (PIM_DEBUG_PIM_EVENTS) { vty_out(vty, "debug pim events%s", VTY_NEWLINE); ++writes; @@ -72,10 +99,15 @@ int pim_debug_config_write(struct vty *vty) vty_out(vty, "debug pim packet-dump receive%s", VTY_NEWLINE); ++writes; } + if (PIM_DEBUG_PIM_TRACE) { vty_out(vty, "debug pim trace%s", VTY_NEWLINE); ++writes; } + if (PIM_DEBUG_PIM_TRACE_DETAIL) { + vty_out(vty, "debug pim trace detail%s", VTY_NEWLINE); + ++writes; + } if (PIM_DEBUG_ZEBRA) { vty_out(vty, "debug pim zebra%s", VTY_NEWLINE); @@ -87,22 +119,61 @@ int pim_debug_config_write(struct vty *vty) ++writes; } + if (PIM_DEBUG_PIM_HELLO) { + vty_out (vty, "debug pim packets hello%s", VTY_NEWLINE); + ++writes; + } + + if (PIM_DEBUG_PIM_J_P) { + vty_out (vty, "debug pim packets joins%s", VTY_NEWLINE); + ++writes; + } + + if (PIM_DEBUG_PIM_REG) { + vty_out (vty, "debug pim packets register%s", VTY_NEWLINE); + ++writes; + } + + if (PIM_DEBUG_STATIC) { + vty_out (vty, "debug pim static%s", VTY_NEWLINE); + ++writes; + } + return writes; } int pim_global_config_write(struct vty *vty) { int writes = 0; - char buffer[32]; - if (PIM_MROUTE_IS_ENABLED) { - vty_out(vty, "%s%s", PIM_CMD_IP_MULTICAST_ROUTING, VTY_NEWLINE); - ++writes; - } - if (qpim_rp.rpf_addr.s_addr != INADDR_NONE) { - vty_out(vty, "ip pim rp %s%s", inet_ntop(AF_INET, &qpim_rp.rpf_addr, buffer, 32), VTY_NEWLINE); - ++writes; - } + writes += pim_msdp_config_write (vty); + + 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%s", + qpim_register_suppress_time, VTY_NEWLINE); + ++writes; + } + if (qpim_t_periodic != PIM_DEFAULT_T_PERIODIC) + { + vty_out (vty, "ip pim join-prune-interval %d%s", + qpim_t_periodic, VTY_NEWLINE); + ++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); + ++writes; + } + if (qpim_packet_process != PIM_DEFAULT_PACKET_PROCESS) + { + vty_out (vty, "ip pim packets %d%s", + qpim_packet_process, VTY_NEWLINE); + ++writes; + } if (qpim_ssmpingd_list) { struct listnode *node; @@ -110,7 +181,7 @@ int pim_global_config_write(struct vty *vty) vty_out(vty, "!%s", VTY_NEWLINE); ++writes; for (ALL_LIST_ELEMENTS_RO(qpim_ssmpingd_list, node, ss)) { - char source_str[100]; + 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); ++writes; @@ -159,17 +230,34 @@ int pim_interface_config_write(struct vty *vty) vty_out(vty, "%s", VTY_NEWLINE); } + /* 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%s", src_str, VTY_NEWLINE); + ++writes; + } + /* IF ip igmp */ if (PIM_IF_TEST_IGMP(pim_ifp->options)) { vty_out(vty, " ip igmp%s", VTY_NEWLINE); ++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); + ++writes; + } + /* IF ip igmp query-interval */ if (pim_ifp->igmp_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL) { - vty_out(vty, " %s %d%s", - PIM_CMD_IP_IGMP_QUERY_INTERVAL, + vty_out(vty, " ip igmp query-interval %d%s", pim_ifp->igmp_default_query_interval, VTY_NEWLINE); ++writes; @@ -178,8 +266,7 @@ int pim_interface_config_write(struct vty *vty) /* 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, " %s %d%s", - PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC, + vty_out(vty, " ip igpm query-max-response-time %d%s", pim_ifp->igmp_query_max_response_time_dsec, VTY_NEWLINE); ++writes; @@ -190,10 +277,10 @@ int pim_interface_config_write(struct vty *vty) struct listnode *node; struct igmp_join *ij; for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_join_list, node, ij)) { - char group_str[100]; - char source_str[100]; + char group_str[INET_ADDRSTRLEN]; + char source_str[INET_ADDRSTRLEN]; pim_inet4_dump("<grp?>", ij->group_addr, group_str, sizeof(group_str)); - pim_inet4_dump("<src?>", ij->source_addr, source_str, sizeof(source_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); |
