]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: add json option to show commands in bgp_nexthop
authorPooja Jagadeesh Doijode <pdoijode@nvidia.com>
Tue, 27 Dec 2022 23:03:30 +0000 (15:03 -0800)
committerPooja Jagadeesh Doijode <pdoijode@nvidia.com>
Wed, 28 Dec 2022 21:43:50 +0000 (13:43 -0800)
commitbf85e4c5f1008a12faea6e52de01b910d2b20e2c
tree77c64ea325ebea7fce00bedd19609acfe54e3c23
parentcb8d1c5598290e88f89c5bfcd13050fe4de4a154
bgpd: add json option to show commands in bgp_nexthop

Commands with json option:
 - show bgp nexthop
 - show bgp import-check-table

Example output below, "nexthop" and "import-check-table" are only
different in the nexthop entries, the format is the same
```
leaf-A# show bgp nexthop 10.11.10.1 detail json
{
  "nexthops":{
    "10.11.10.1":{
      "valid":true,
      "complete":true,
      "igpMetric":0,
      "pathCount":1,
      "peer":"10.11.10.1",
      "gates":[
        {
          "ifname":"eth1"
        }
      ],
      "lastUpdate":{
        "epoch":1669161758,
        "string":"Wed Nov 23 00:02:38 2022\n"
      },
      "paths":[
        {
          "afi":"IPv4",
          "safi":"unicast",
          "prefix":"192.168.11.0/24",
          "vrf":"default",
          "flags":[
            "valid",
            "dmedSelected",
            "counted"
          ]
        }
      ]
    }
  }
}
leaf-A# show bgp nexthop json
{
  "nexthops":{
    "10.10.10.1":{
      "valid":true,
      "complete":true,
      "igpMetric":0,
      "pathCount":1,
      "peer":"10.10.10.1",
      "gates":[
        {
          "ifname":"eth0"
        }
      ],
      "lastUpdate":{
        "epoch":1669161758,
        "string":"Wed Nov 23 00:02:38 2022\n"
      }
    },
    "10.11.10.1":{
      "valid":true,
      "complete":true,
      "igpMetric":0,
      "pathCount":1,
      "peer":"10.11.10.1",
      "gates":[
        {
          "ifname":"eth1"
        }
      ],
      "lastUpdate":{
        "epoch":1669161758,
        "string":"Wed Nov 23 00:02:38 2022\n"
      }
    }
  }
}

```

Signed-off-by: Yaroslav Fedoriachenko <yar.fed99@gmail.com>
bgpd/bgp_nexthop.c
doc/user/bgp.rst