Patch contains 1. ALIAS functions added for show ip bgp dampening commands
Signed-off-by: Balaji.G <[email protected]> --- bgpd/bgp_route.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 103 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index d537058..64e1070 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6380,6 +6380,8 @@ bgp_show_table (struct vty *vty, struct bgp_table *table, struct in_addr *router return CMD_SUCCESS; } + + static int bgp_show (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, enum bgp_show_type type, void *output_arg) @@ -6396,6 +6398,12 @@ bgp_show (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, return CMD_WARNING; } + if (!CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)) + { + vty_out (vty, "dampening not enabled for %s%s", + afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE); + return CMD_WARNING; + } table = bgp->rib[afi][safi]; @@ -7154,6 +7162,7 @@ DEFUN (show_ip_bgp_regexp, bgp_show_type_regexp); } + DEFUN (show_ip_bgp_flap_regexp, show_ip_bgp_flap_regexp_cmd, "show ip bgp flap-statistics regexp .LINE", @@ -7168,6 +7177,18 @@ DEFUN (show_ip_bgp_flap_regexp, bgp_show_type_flap_regexp); } +ALIAS (show_ip_bgp_flap_regexp, + show_ip_bgp_damp_flap_regexp_cmd, + "show ip bgp dampening flap-statistics regexp .LINE", + SHOW_STR + IP_STR + BGP_STR + "Display detailed information about dampening\n" + "Display flap statistics of routes\n" + "Display routes matching the AS path regular expression\n" + "A regular-expression to match the BGP AS paths\n") + + DEFUN (show_ip_bgp_ipv4_regexp, show_ip_bgp_ipv4_regexp_cmd, "show ip bgp ipv4 (unicast|multicast) regexp .LINE", @@ -7283,6 +7304,19 @@ DEFUN (show_ip_bgp_flap_prefix_list, bgp_show_type_flap_prefix_list); } +ALIAS (show_ip_bgp_flap_prefix_list, + show_ip_bgp_damp_flap_prefix_list_cmd, + "show ip bgp dampening flap-statistics prefix-list WORD", + SHOW_STR + IP_STR + BGP_STR + "Display detailed information about dampening\n" + "Display flap statistics of routes\n" + "Display routes conforming to the prefix-list\n" + "IP prefix-list name\n") + + + DEFUN (show_ip_bgp_ipv4_prefix_list, show_ip_bgp_ipv4_prefix_list_cmd, "show ip bgp ipv4 (unicast|multicast) prefix-list WORD", @@ -7397,6 +7431,17 @@ DEFUN (show_ip_bgp_flap_filter_list, bgp_show_type_flap_filter_list); } +ALIAS (show_ip_bgp_flap_filter_list, + show_ip_bgp_damp_flap_filter_list_cmd, + "show ip bgp dampening flap-statistics filter-list WORD", + SHOW_STR + IP_STR + BGP_STR + "Display detailed information about dampening\n" + "Display flap statistics of routes\n" + "Display routes conforming to the filter-list\n" + "Regular expression access list name\n") + DEFUN (show_ip_bgp_ipv4_filter_list, show_ip_bgp_ipv4_filter_list_cmd, "show ip bgp ipv4 (unicast|multicast) filter-list WORD", @@ -7512,6 +7557,17 @@ DEFUN (show_ip_bgp_flap_route_map, bgp_show_type_flap_route_map); } +ALIAS (show_ip_bgp_flap_route_map, + show_ip_bgp_damp_flap_route_map_cmd, + "show ip bgp dampening flap-statistics route-map WORD", + SHOW_STR + IP_STR + BGP_STR + "Display detailed information about dampening\n" + "Display flap statistics of routes\n" + "Display routes matching the route-map\n" + "A route-map to match on\n") + DEFUN (show_ip_bgp_ipv4_route_map, show_ip_bgp_ipv4_route_map_cmd, "show ip bgp ipv4 (unicast|multicast) route-map WORD", @@ -7578,6 +7634,16 @@ DEFUN (show_ip_bgp_flap_cidr_only, bgp_show_type_flap_cidr_only, NULL); } +ALIAS (show_ip_bgp_flap_cidr_only, + show_ip_bgp_damp_flap_cidr_only_cmd, + "show ip bgp dampening flap-statistics cidr-only", + SHOW_STR + IP_STR + BGP_STR + "Display detailed information about dampening\n" + "Display flap statistics of routes\n" + "Display only routes with non-natural netmasks\n") + DEFUN (show_ip_bgp_ipv4_cidr_only, show_ip_bgp_ipv4_cidr_only_cmd, "show ip bgp ipv4 (unicast|multicast) cidr-only", @@ -9102,6 +9168,17 @@ DEFUN (show_ip_bgp_flap_prefix_longer, bgp_show_type_flap_prefix_longer); } +ALIAS (show_ip_bgp_flap_prefix_longer, + show_ip_bgp_damp_flap_prefix_longer_cmd, + "show ip bgp dampening flap-statistics A.B.C.D/M longer-prefixes", + SHOW_STR + IP_STR + BGP_STR + "Display detailed information about dampening\n" + "Display flap statistics of routes\n" + "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n" + "Display route and more specific routes\n") + DEFUN (show_ip_bgp_ipv4_prefix_longer, show_ip_bgp_ipv4_prefix_longer_cmd, "show ip bgp ipv4 (unicast|multicast) A.B.C.D/M longer-prefixes", @@ -9135,6 +9212,16 @@ DEFUN (show_ip_bgp_flap_address, bgp_show_type_flap_address); } +ALIAS (show_ip_bgp_flap_address, + show_ip_bgp_damp_flap_address_cmd, + "show ip bgp dampening flap-statistics A.B.C.D", + SHOW_STR + IP_STR + BGP_STR + "Display detailed information about dampening\n" + "Display flap statistics of routes\n" + "Network in the BGP routing table to display\n") + DEFUN (show_ip_bgp_flap_prefix, show_ip_bgp_flap_prefix_cmd, "show ip bgp flap-statistics A.B.C.D/M", @@ -9147,6 +9234,17 @@ DEFUN (show_ip_bgp_flap_prefix, return bgp_show_prefix_longer (vty, argv[0], AFI_IP, SAFI_UNICAST, bgp_show_type_flap_prefix); } + +ALIAS (show_ip_bgp_flap_prefix, + show_ip_bgp_damp_flap_prefix_cmd, + "show ip bgp dampening flap-statistics A.B.C.D/M", + SHOW_STR + IP_STR + BGP_STR + "Display detailed information about dampening\n" + "Display flap statistics of routes\n" + "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n") + #ifdef HAVE_IPV6 DEFUN (show_bgp_prefix_longer, show_bgp_prefix_longer_cmd, @@ -10138,6 +10236,7 @@ DEFUN (ipv6_mbgp_neighbor_advertised_route, DEFUN (show_ip_bgp_dampening_info, show_ip_bgp_dampening_info_cmd, "show ip bgp dampening (dampened-paths|flap-statistics|parameters)", + SHOW_STR IP_STR BGP_STR "Display detailed information about dampening\n" @@ -12065,7 +12164,7 @@ DEFUN (show_ip_bgp_flap_statistics, SHOW_STR IP_STR BGP_STR - "Display flap statistics of routes\n") + "Display flap-statistics of routes\n") { return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_flap_statistics, NULL); @@ -12585,7 +12684,8 @@ bgp_route_init (void) install_element (VIEW_NODE, &show_ip_bgp_neighbor_received_prefix_filter_cmd); install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd); install_element (VIEW_NODE, &show_ip_bgp_dampened_paths_cmd); - install_element (VIEW_NODE, &show_ip_bgp_flap_statistics_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_flap_statistics_cmd); + install_element (VIEW_NODE, &show_ip_bgp_dampening_info_cmd); install_element (VIEW_NODE, &show_ip_bgp_flap_address_cmd); install_element (VIEW_NODE, &show_ip_bgp_flap_prefix_cmd); install_element (VIEW_NODE, &show_ip_bgp_flap_cidr_only_cmd); @@ -12719,6 +12819,7 @@ bgp_route_init (void) install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd); install_element (ENABLE_NODE, &show_ip_bgp_dampened_paths_cmd); install_element (ENABLE_NODE, &show_ip_bgp_flap_statistics_cmd); + install_element (ENABLE_NODE, &show_ip_bgp_dampening_info_cmd); install_element (ENABLE_NODE, &show_ip_bgp_flap_address_cmd); install_element (ENABLE_NODE, &show_ip_bgp_flap_prefix_cmd); install_element (ENABLE_NODE, &show_ip_bgp_flap_cidr_only_cmd); -- 1.9.1 _______________________________________________ Quagga-dev mailing list [email protected] https://lists.quagga.net/mailman/listinfo/quagga-dev
