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>