bgpd: Remove deprecated JSON fields for show bgp ... json

med --------> metric
localPref --> locPrf
aspath -----> path

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
Donatas Abraitis 2020-04-01 17:02:30 +03:00
parent 54b71f2fa3
commit 0fbac0b478

View 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);