]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: Add `show bgp json detail` command
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Sat, 10 Apr 2021 07:27:06 +0000 (10:27 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 13 Apr 2021 19:06:32 +0000 (22:06 +0300)
commitf280c93b118be645e7b6ef334f7c30e9f9f08303
tree18b3af1754263f3fe52d8d106d54c6c28e420053
parentd75213d26036a2880f23f5e67cb1c890f20299de
bgpd: Add `show bgp json detail` command

Print detailed version for JSON output when dumping ALL BGP table with
`show bgp <afi> <safi> json detail`.

This output should be at some sort of identical to show_ip_bgp_route_cmd.

To avoid breaking backward-compatibility for `show bgp json`, adding
'detail' keyword for that.

In long-term it's easier for operators to compare stuff just looking at global
view instead of per-prefix for details.

Before:

```
],"192.168.100.1/32": [
  {
    "valid":true,
    "bestpath":true,
    "selectionReason":"First path received",
    "pathFrom":"external",
    "prefix":"192.168.100.1",
    "prefixLen":32,
    "network":"192.168.100.1\/32",
    "metric":0,
    "weight":32768,
    "peerId":"(unspec)",
    "path":"",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"0.0.0.0",
        "hostname":"exit1-debian-9",
        "afi":"ipv4",
        "used":true
      }
    ]
  }
] }  }
```

After:
```
],"192.168.100.1/32": [
  {
    "aspath":{
      "string":"Local",
      "segments":[
      ],
      "length":0
    },
    "origin":"incomplete",
    "metric":0,
    "weight":32768,
    "valid":true,
    "sourced":true,
    "bestpath":{
      "overall":true,
      "selectionReason":"First path received"
    },
    "lastUpdate":{
      "epoch":1618040124,
      "string":"Sat Apr 10 07:35:24 2021\n"
    },
    "nexthops":[
      {
        "ip":"0.0.0.0",
        "hostname":"exit1-debian-9",
        "afi":"ipv4",
        "metric":0,
        "accessible":true,
        "used":true
      }
    ],
    "peer":{
      "peerId":"0.0.0.0",
      "routerId":"192.168.100.1"
    }
  }
] }  }
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/bgp_route.c
bgpd/bgp_route.h