From b60f5275565c66b35ca8e630e9ffb12cc244e419 Mon Sep 17 00:00:00 2001 From: Don Slice Date: Thu, 9 Mar 2017 16:12:44 -0500 Subject: [PATCH] bgpd: labeled unicast display Implement 'show' and 'clear' commands for the labeled-unicast address-family. Signed-off-by: Don Slice --- bgpd/bgp_route.c | 9 ++++++--- bgpd/bgp_vty.c | 18 ++++++++++++++++-- bgpd/bgp_vty.h | 3 ++- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 77154b0f33..3114893c9d 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -8300,7 +8300,7 @@ bgp_show_lcommunity_list (struct vty *vty, struct bgp *bgp, const char *lcom, DEFUN (show_ip_bgp_large_community_list, show_ip_bgp_large_community_list_cmd, - "show [ip] bgp [ WORD] [ []] large-community-list <(1-500)|WORD> [json]", + "show [ip] bgp [ WORD] [ []] large-community-list <(1-500)|WORD> [json]", SHOW_STR IP_STR BGP_STR @@ -8311,6 +8311,7 @@ DEFUN (show_ip_bgp_large_community_list, "Address Family modifier\n" "Address Family modifier\n" "Address Family modifier\n" + "Address Family modifier\n" "Display routes matching the large-community-list\n" "large-community-list number\n" "large-community-list name\n" @@ -8346,7 +8347,7 @@ DEFUN (show_ip_bgp_large_community_list, } DEFUN (show_ip_bgp_large_community, show_ip_bgp_large_community_cmd, - "show [ip] bgp [ WORD] [ []] large-community [AA:BB:CC] [json]", + "show [ip] bgp [ WORD] [ []] large-community [AA:BB:CC] [json]", SHOW_STR IP_STR BGP_STR @@ -8357,6 +8358,7 @@ DEFUN (show_ip_bgp_large_community, "Address Family modifier\n" "Address Family modifier\n" "Address Family modifier\n" + "Address Family modifier\n" "Display routes matching the large-communities\n" "List of large-community numbers\n" JSON_STR) @@ -9300,7 +9302,7 @@ bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, u_c DEFUN (show_ip_bgp_instance_neighbor_prefix_counts, show_ip_bgp_instance_neighbor_prefix_counts_cmd, - "show [ip] bgp [ WORD] [ []] " + "show [ip] bgp [ WORD] [ []] " "neighbors prefix-counts [json]", SHOW_STR IP_STR @@ -9312,6 +9314,7 @@ DEFUN (show_ip_bgp_instance_neighbor_prefix_counts, "Address Family modifier\n" "Address Family modifier\n" "Address Family modifier\n" + "Address Family modifier\n" "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index b1819e2f03..ef5571c9ae 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -265,6 +265,12 @@ argv_find_and_parse_safi (struct cmd_token **argv, int argc, int *index, safi_t if (safi) *safi = SAFI_MULTICAST; } + else if (argv_find (argv, argc, "labeled-unicast", index)) + { + ret = 1; + if (safi) + *safi = SAFI_LABELED_UNICAST; + } else if (argv_find (argv, argc, "vpn", index)) { ret = 1; @@ -296,12 +302,12 @@ argv_find_and_parse_safi (struct cmd_token **argv, int argc, int *index, safi_t * that is being parsed. * * The show commands are generally of the form: - * "show [ip] bgp [ WORD] [ []] ..." + * "show [ip] bgp [ WORD] [ []] ..." * * Since we use argv_find if the show command in particular doesn't have: * [ip] * [ WORD] - * [ []] + * [ []] * The command parsing should still be ok. * * vty -> The vty for the command so we can output some useful data in @@ -6917,6 +6923,8 @@ afi_safi_print (afi_t afi, safi_t safi) return "IPv4 Unicast"; else if (afi == AFI_IP && safi == SAFI_MULTICAST) return "IPv4 Multicast"; + else if (afi == AFI_IP && safi == SAFI_LABELED_UNICAST) + return "IPv4 labeled-unicast"; else if (afi == AFI_IP && safi == SAFI_MPLS_VPN) return "IPv4 VPN"; else if (afi == AFI_IP && safi == SAFI_ENCAP) @@ -6925,6 +6933,8 @@ afi_safi_print (afi_t afi, safi_t safi) return "IPv6 Unicast"; else if (afi == AFI_IP6 && safi == SAFI_MULTICAST) return "IPv6 Multicast"; + else if (afi == AFI_IP6 && safi == SAFI_LABELED_UNICAST) + return "IPv6 labeled-unicast"; else if (afi == AFI_IP6 && safi == SAFI_MPLS_VPN) return "IPv6 VPN"; else if (afi == AFI_IP6 && safi == SAFI_ENCAP) @@ -6942,6 +6952,8 @@ afi_safi_json (afi_t afi, safi_t safi) return "IPv4Unicast"; else if (afi == AFI_IP && safi == SAFI_MULTICAST) return "IPv4Multicast"; + else if (afi == AFI_IP && safi == SAFI_LABELED_UNICAST) + return "IPv4LabeledUnicast"; else if (afi == AFI_IP && safi == SAFI_MPLS_VPN) return "IPv4VPN"; else if (afi == AFI_IP && safi == SAFI_ENCAP) @@ -6950,6 +6962,8 @@ afi_safi_json (afi_t afi, safi_t safi) return "IPv6Unicast"; else if (afi == AFI_IP6 && safi == SAFI_MULTICAST) return "IPv6Multicast"; + else if (afi == AFI_IP6 && safi == SAFI_LABELED_UNICAST) + return "IPv6LabeledUnicast"; else if (afi == AFI_IP6 && safi == SAFI_MPLS_VPN) return "IPv6VPN"; else if (afi == AFI_IP6 && safi == SAFI_ENCAP) diff --git a/bgpd/bgp_vty.h b/bgpd/bgp_vty.h index f0342c2c35..a0aabcbd2c 100644 --- a/bgpd/bgp_vty.h +++ b/bgpd/bgp_vty.h @@ -28,12 +28,13 @@ struct bgp; #define BGP_AFI_CMD_STR "" #define BGP_AFI_HELP_STR "Address Family\nAddress Family\n" -#define BGP_SAFI_CMD_STR "" +#define BGP_SAFI_CMD_STR "" #define BGP_SAFI_HELP_STR \ "Address Family modifier\n" \ "Address Family modifier\n" \ "Address Family modifier\n" \ "Address Family modifier\n" \ + "Address Family modifier\n" \ "Address Family modifier\n" #define BGP_AFI_SAFI_CMD_STR BGP_AFI_CMD_STR" "BGP_SAFI_CMD_STR #define BGP_AFI_SAFI_HELP_STR BGP_AFI_HELP_STR BGP_SAFI_HELP_STR -- 2.39.5