]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Remove deprecated JSON fields for `show bgp ... json`
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Wed, 1 Apr 2020 14:02:30 +0000 (17:02 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Wed, 1 Apr 2020 14:02:30 +0000 (17:02 +0300)
med --------> metric
localPref --> locPrf
aspath -----> path

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/bgp_route.c

index 9a3ab0d8eebad445f6ed3a09b3bca840168a0c1e..0b44ca3c26cb4b6cb7c7832fa645f535bf20a9af 100644 (file)
@@ -7819,32 +7819,19 @@ void route_vty_out(struct vty *vty, const struct prefix *p,
 
        /* MED/Metric */
        if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC))
-               if (json_paths) {
-
-                       /*
-                        * Adding "metric" field to match with corresponding
-                        * CLI. "med" will be deprecated in future.
-                        */
-                       json_object_int_add(json_path, "med", attr->med);
+               if (json_paths)
                        json_object_int_add(json_path, "metric", attr->med);
-               else
+               else
                        vty_out(vty, "%10u", attr->med);
        else if (!json_paths)
                vty_out(vty, "          ");
 
        /* Local Pref */
        if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF))
-               if (json_paths) {
-
-                       /*
-                        * Adding "locPrf" field to match with corresponding
-                        * CLI. "localPref" will be deprecated in future.
-                        */
-                       json_object_int_add(json_path, "localpref",
-                                           attr->local_pref);
+               if (json_paths)
                        json_object_int_add(json_path, "locPrf",
-                                               attr->local_pref);
-               else
+                                           attr->local_pref);
+               else
                        vty_out(vty, "%7u", attr->local_pref);
        else if (!json_paths)
                vty_out(vty, "       ");
@@ -7863,17 +7850,10 @@ void route_vty_out(struct vty *vty, const struct prefix *p,
 
        /* Print aspath */
        if (attr->aspath) {
-               if (json_paths) {
-
-                       /*
-                        * Adding "path" field to match with corresponding
-                        * CLI. "aspath" will be deprecated in future.
-                        */
-                       json_object_string_add(json_path, "aspath",
-                                              attr->aspath->str);
+               if (json_paths)
                        json_object_string_add(json_path, "path",
-                                               attr->aspath->str);
-               else
+                                              attr->aspath->str);
+               else
                        aspath_print_vty(vty, "%s", attr->aspath, " ");
        }
 
@@ -8016,34 +7996,16 @@ void route_vty_out_tmp(struct vty *vty, const struct prefix *p,
                                json_object_int_add(json_net, "metric",
                                                    attr->med);
 
-                       if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF)) {
-
-                               /*
-                                * Adding "locPrf" field to match with
-                                * corresponding CLI. "localPref" will be
-                                * deprecated in future.
-                                */
-                               json_object_int_add(json_net, "localPref",
-                                                   attr->local_pref);
+                       if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF))
                                json_object_int_add(json_net, "locPrf",
-                                                       attr->local_pref);
-                       }
+                                                   attr->local_pref);
 
                        json_object_int_add(json_net, "weight", attr->weight);
 
                        /* Print aspath */
-                       if (attr->aspath) {
-
-                               /*
-                                * Adding "path" field to match with
-                                * corresponding CLI. "localPref" will be
-                                * deprecated in future.
-                                */
-                               json_object_string_add(json_net, "asPath",
-                                                      attr->aspath->str);
+                       if (attr->aspath)
                                json_object_string_add(json_net, "path",
-                                                       attr->aspath->str);
-                       }
+                                                      attr->aspath->str);
 
                        /* Print origin */
                        json_object_string_add(json_net, "bgpOriginCode",
@@ -9077,21 +9039,15 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp,
                        bgp_origin_long_str[attr->origin]);
 
        if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC)) {
-               if (json_paths) {
-                       /*
-                        * Adding "metric" field to match with
-                        * corresponding CLI. "med" will be
-                        * deprecated in future.
-                        */
-                       json_object_int_add(json_path, "med", attr->med);
+               if (json_paths)
                        json_object_int_add(json_path, "metric", attr->med);
-               else
+               else
                        vty_out(vty, ", metric %u", attr->med);
        }
 
        if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF)) {
                if (json_paths)
-                       json_object_int_add(json_path, "localpref",
+                       json_object_int_add(json_path, "locPrf",
                                            attr->local_pref);
                else
                        vty_out(vty, ", localpref %u", attr->local_pref);