diff options
| author | Pooja Jagadeesh Doijode <pdoijode@nvidia.com> | 2023-01-24 18:15:36 -0800 | 
|---|---|---|
| committer | Pooja Jagadeesh Doijode <pdoijode@nvidia.com> | 2023-01-24 18:15:36 -0800 | 
| commit | 553c8048460a3c01bf984163a3b5f4ac7122b5a2 (patch) | |
| tree | f8047afe08506be5497bcf8cee13328c5cd69979 /zebra/zebra_rnh.h | |
| parent | e7523b9a9437c99409e48051e28f910e47a03867 (diff) | |
zebra: fix JSON fields for "show ip/ipv6 nht"
1. Renamed "gates" to "nexthops"
2. Displaying afi of the nexthops being dispalyed in place of
   "nexthops" JSON object in the old JSON output
3. Calling show_route_nexthop_helper() and show_nexthop_json_helper()
   instead of print_nh() inorder to keeps the fields in "nexthops"
   JSON object in sync with "nexthops" JSON object of
   "show nexthop-group rib json".
Updated vtysh:
    r1# show ip nht
    192.168.0.2
     resolved via connected
     is directly connected, r1-eth0 (vrf default)
     Client list: static(fd 28)
    192.168.0.4
     resolved via connected
     is directly connected, r1-eth0 (vrf default)
     Client list: static(fd 28)
Updated JSON:
    r1# show ip nht json
    {
      "default":{
        "ipv4":{
          "192.168.0.2":{
            "nhtConnected":false,
            "clientList":[
              {
                "protocol":"static",
                "socket":28,
                "protocolFiltered":"none"
              }
            ],
            "nexthops":[
              {
                "flags":3,
                "fib":true,
                "directlyConnected":true,
                "interfaceIndex":2,
                "interfaceName":"r1-eth0",
                "vrf":"default",
                "active":true
              }
            ],
            "resolvedProtocol":"connected"
          }
        }
      }
    }
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
Diffstat (limited to 'zebra/zebra_rnh.h')
| -rw-r--r-- | zebra/zebra_rnh.h | 6 | 
1 files changed, 6 insertions, 0 deletions
diff --git a/zebra/zebra_rnh.h b/zebra/zebra_rnh.h index 44ce65b4b6..88be69a81d 100644 --- a/zebra/zebra_rnh.h +++ b/zebra/zebra_rnh.h @@ -58,6 +58,12 @@ extern bool rnh_nexthop_valid(const struct route_entry *re,  void rnh_set_hide_backups(bool hide_p);  bool rnh_get_hide_backups(void); +void show_nexthop_json_helper(json_object *json_nexthop, +			      const struct nexthop *nexthop, +			      const struct route_entry *re); +void show_route_nexthop_helper(struct vty *vty, const struct route_entry *re, +			       const struct nexthop *nexthop); +  #ifdef __cplusplus  }  #endif  | 
