]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Add `show ip bgp <afi> <safi> detail` command version
authorDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 20 Dec 2022 09:56:50 +0000 (11:56 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 20 Dec 2022 10:19:37 +0000 (12:19 +0200)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_route.c
bgpd/bgp_route.h

index 13290d213ddb67a5f404f23e6bf9f0d29281e4a6..1fc51803aba0b96efd9649ae594b55d8f1d1ff65 100644 (file)
@@ -11249,6 +11249,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
        bool wide = CHECK_FLAG(show_flags, BGP_SHOW_OPT_WIDE);
        bool all = CHECK_FLAG(show_flags, BGP_SHOW_OPT_AFI_ALL);
        bool detail_json = CHECK_FLAG(show_flags, BGP_SHOW_OPT_JSON_DETAIL);
+       bool detail_routes = CHECK_FLAG(show_flags, BGP_SHOW_OPT_ROUTES_DETAIL);
 
        if (output_cum && *output_cum != 0)
                header = false;
@@ -11545,7 +11546,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                                vty_out(vty, "Default local pref %u, ",
                                        bgp->default_local_pref);
                                vty_out(vty, "local AS %u\n", bgp->as);
-                               if (!detail_json) {
+                               if (!detail_routes) {
                                        vty_out(vty, BGP_SHOW_SCODE_HEADER);
                                        vty_out(vty, BGP_SHOW_NCODE_HEADER);
                                        vty_out(vty, BGP_SHOW_OCODE_HEADER);
@@ -11557,7 +11558,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                                else if (type == bgp_show_type_flap_statistics
                                         || type == bgp_show_type_flap_neighbor)
                                        vty_out(vty, BGP_SHOW_FLAP_HEADER);
-                               else if (!detail_json)
+                               else if (!detail_routes)
                                        vty_out(vty, (wide ? BGP_SHOW_HEADER_WIDE
                                                           : BGP_SHOW_HEADER));
                                header = false;
@@ -11600,7 +11601,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                                                   AFI_IP, safi, use_json,
                                                   json_paths);
                        else {
-                               if (detail_json) {
+                               if (detail_routes) {
                                        const struct prefix_rd *prd;
 
                                        prd = bgp_rd_from_dest(dest, safi);
@@ -12666,6 +12667,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
           |A.B.C.D/M longer-prefixes\
           |X:X::X:X/M longer-prefixes\
          |optimal-route-reflection [WORD$orr_group_name]\
+          |detail-routes$detail_routes\
           ] [json$uj [detail$detail_json] | wide$wide]",
       SHOW_STR IP_STR BGP_STR BGP_INSTANCE_HELP_STR BGP_AFI_HELP_STR
              BGP_SAFI_WITH_LABEL_HELP_STR
@@ -12716,6 +12718,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
       "Display route and more specific routes\n"
       "Display Optimal Route Reflection RR Clients\n"
       "ORR Group name\n"
+      "Display detailed version of all routes\n"
       JSON_STR
       "Display detailed version of JSON output\n"
       "Increase table width for longer prefixes\n")
@@ -12742,6 +12745,9 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
        if (detail_json)
                SET_FLAG(show_flags, BGP_SHOW_OPT_JSON_DETAIL);
 
+       if (detail_routes)
+               SET_FLAG(show_flags, BGP_SHOW_OPT_ROUTES_DETAIL);
+
        /* [<ipv4|ipv6> [all]] */
        if (all) {
                SET_FLAG(show_flags, BGP_SHOW_OPT_AFI_ALL);
index 2b91c048cb082ae06fe4f2334956abda3142c315..63dd69f805924aca5add4a50387e560c18b33f2e 100644 (file)
@@ -665,6 +665,7 @@ DECLARE_HOOK(bgp_process,
 #define BGP_SHOW_OPT_FAILED (1 << 6)
 #define BGP_SHOW_OPT_JSON_DETAIL (1 << 7)
 #define BGP_SHOW_OPT_TERSE (1 << 8)
+#define BGP_SHOW_OPT_ROUTES_DETAIL (1 << 9)
 
 /* Prototypes. */
 extern void bgp_rib_remove(struct bgp_dest *dest, struct bgp_path_info *pi,