/* 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, " ");
/* 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, " ");
}
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",
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);