diff options
author | Wesley Coakley <wcoakley@cumulusnetworks.com> | 2020-05-21 21:18:34 +0200 |
---|---|---|
committer | Wesley Coakley <wcoakley@cumulusnetworks.com> | 2020-05-27 16:28:02 +0200 |
commit | 81c0078ef4d0bb6471447e6eecd28663e0620cb3 (patch) | |
tree | 90f6166e7ffb1a15a542e35eb050d82b64a819df /lib/nexthop_group.c | |
parent | pbrd, lib: opt. json for `show pbr nexthop-group` (diff) | |
download | frr-81c0078ef4d0bb6471447e6eecd28663e0620cb3.tar.xz frr-81c0078ef4d0bb6471447e6eecd28663e0620cb3.zip |
pbrd, lib: verbosity++ for json `show` directives
Increased the verbosity of the json keys and flattened the returned
structure by removing superfluous keys.
Signed-off-by: Wesley Coakley <wcoakley@cumulusnetworks.com>
Diffstat (limited to 'lib/nexthop_group.c')
-rw-r--r-- | lib/nexthop_group.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c index f9e337d75..ab04fb904 100644 --- a/lib/nexthop_group.c +++ b/lib/nexthop_group.c @@ -1003,25 +1003,25 @@ void nexthop_group_json_nexthop(json_object *j, struct nexthop *nh) switch (nh->type) { case NEXTHOP_TYPE_IFINDEX: - json_object_string_add(j, "nexthop", + json_object_string_add(j, "target", ifindex2ifname(nh->ifindex, nh->vrf_id)); break; case NEXTHOP_TYPE_IPV4: - json_object_string_add(j, "nexthop", inet_ntoa(nh->gate.ipv4)); + json_object_string_add(j, "target", inet_ntoa(nh->gate.ipv4)); break; case NEXTHOP_TYPE_IPV4_IFINDEX: - json_object_string_add(j, "nexthop", inet_ntoa(nh->gate.ipv4)); + json_object_string_add(j, "target", inet_ntoa(nh->gate.ipv4)); json_object_string_add(j, "vrfId", ifindex2ifname(nh->ifindex, nh->vrf_id)); break; case NEXTHOP_TYPE_IPV6: json_object_string_add( - j, "nexthop", + j, "target", inet_ntop(AF_INET6, &nh->gate.ipv6, buf, sizeof(buf))); break; case NEXTHOP_TYPE_IPV6_IFINDEX: json_object_string_add( - j, "nexthop", + j, "target", inet_ntop(AF_INET6, &nh->gate.ipv6, buf, sizeof(buf))); json_object_string_add(j, "vrfId", ifindex2ifname(nh->ifindex, nh->vrf_id)); @@ -1032,7 +1032,7 @@ void nexthop_group_json_nexthop(json_object *j, struct nexthop *nh) if (nh->vrf_id != VRF_DEFAULT) { vrf = vrf_lookup_by_id(nh->vrf_id); - json_object_string_add(j, "nexthopVrf", vrf->name); + json_object_string_add(j, "targetVrf", vrf->name); } if (nh->nh_label && nh->nh_label->num_labels > 0) { |