mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 23:43:20 +02:00
FRR prints uptime different based on how long it is. Prior to this commit yanger expected uptime to be on the format HH:MM:SS which it is as long as it's shorter than a day. If it's longer the format changes, this commit handles this. The commit also adds unit test data triggering the different formats (<day, <week, >week). Side note: cli-pretty could be made to represent the data on "FRR format" again, which is perhaps more human friendly. Signed-off-by: Richard Alpe <richard@bit42.se>
303 lines
6.5 KiB
JSON
303 lines
6.5 KiB
JSON
{
|
|
"0.0.0.0/0":[
|
|
{
|
|
"prefix":"0.0.0.0/0",
|
|
"prefixLen":0,
|
|
"protocol":"ospf",
|
|
"vrfId":0,
|
|
"vrfName":"default",
|
|
"selected":true,
|
|
"destSelected":true,
|
|
"distance":110,
|
|
"metric":2,
|
|
"installed":true,
|
|
"table":254,
|
|
"internalStatus":16,
|
|
"internalFlags":8,
|
|
"internalNextHopNum":1,
|
|
"internalNextHopActiveNum":1,
|
|
"nexthopGroupId":42,
|
|
"installedNexthopGroupId":42,
|
|
"uptime":"00:00:00",
|
|
"nexthops":[
|
|
{
|
|
"flags":3,
|
|
"fib":true,
|
|
"ip":"10.0.23.1",
|
|
"afi":"ipv4",
|
|
"interfaceIndex":7,
|
|
"interfaceName":"e6",
|
|
"active":true,
|
|
"weight":1
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"10.0.0.1/32":[
|
|
{
|
|
"prefix":"10.0.0.1/32",
|
|
"prefixLen":32,
|
|
"protocol":"ospf",
|
|
"vrfId":0,
|
|
"vrfName":"default",
|
|
"selected":true,
|
|
"destSelected":true,
|
|
"distance":110,
|
|
"metric":4000,
|
|
"installed":true,
|
|
"table":254,
|
|
"internalStatus":16,
|
|
"internalFlags":8,
|
|
"internalNextHopNum":1,
|
|
"internalNextHopActiveNum":1,
|
|
"nexthopGroupId":43,
|
|
"installedNexthopGroupId":43,
|
|
"uptime":"00:00:00",
|
|
"nexthops":[
|
|
{
|
|
"flags":3,
|
|
"fib":true,
|
|
"ip":"10.0.13.1",
|
|
"afi":"ipv4",
|
|
"interfaceIndex":6,
|
|
"interfaceName":"e5",
|
|
"active":true,
|
|
"weight":1
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"10.0.0.3/32":[
|
|
{
|
|
"prefix":"10.0.0.3/32",
|
|
"prefixLen":32,
|
|
"protocol":"ospf",
|
|
"vrfId":0,
|
|
"vrfName":"default",
|
|
"distance":110,
|
|
"metric":0,
|
|
"table":254,
|
|
"internalStatus":0,
|
|
"internalFlags":0,
|
|
"internalNextHopNum":1,
|
|
"internalNextHopActiveNum":1,
|
|
"nexthopGroupId":30,
|
|
"uptime":"00:00:00",
|
|
"nexthops":[
|
|
{
|
|
"flags":1,
|
|
"directlyConnected":true,
|
|
"interfaceIndex":1,
|
|
"interfaceName":"lo",
|
|
"active":true,
|
|
"weight":1
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"prefix":"10.0.0.3/32",
|
|
"prefixLen":32,
|
|
"protocol":"connected",
|
|
"vrfId":0,
|
|
"vrfName":"default",
|
|
"selected":true,
|
|
"destSelected":true,
|
|
"distance":0,
|
|
"metric":0,
|
|
"installed":true,
|
|
"table":254,
|
|
"internalStatus":16,
|
|
"internalFlags":8,
|
|
"internalNextHopNum":1,
|
|
"internalNextHopActiveNum":1,
|
|
"nexthopGroupId":25,
|
|
"installedNexthopGroupId":25,
|
|
"uptime":"00:00:00",
|
|
"nexthops":[
|
|
{
|
|
"flags":3,
|
|
"fib":true,
|
|
"directlyConnected":true,
|
|
"interfaceIndex":1,
|
|
"interfaceName":"lo",
|
|
"active":true
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"10.0.13.0/30":[
|
|
{
|
|
"prefix":"10.0.13.0/30",
|
|
"prefixLen":30,
|
|
"protocol":"ospf",
|
|
"vrfId":0,
|
|
"vrfName":"default",
|
|
"distance":110,
|
|
"metric":2000,
|
|
"table":254,
|
|
"internalStatus":0,
|
|
"internalFlags":0,
|
|
"internalNextHopNum":1,
|
|
"internalNextHopActiveNum":1,
|
|
"nexthopGroupId":31,
|
|
"uptime":"00:00:00",
|
|
"nexthops":[
|
|
{
|
|
"flags":1,
|
|
"directlyConnected":true,
|
|
"interfaceIndex":6,
|
|
"interfaceName":"e5",
|
|
"active":true,
|
|
"weight":1
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"prefix":"10.0.13.0/30",
|
|
"prefixLen":30,
|
|
"protocol":"connected",
|
|
"vrfId":0,
|
|
"vrfName":"default",
|
|
"selected":true,
|
|
"destSelected":true,
|
|
"distance":0,
|
|
"metric":0,
|
|
"installed":true,
|
|
"table":254,
|
|
"internalStatus":16,
|
|
"internalFlags":8,
|
|
"internalNextHopNum":1,
|
|
"internalNextHopActiveNum":1,
|
|
"nexthopGroupId":20,
|
|
"installedNexthopGroupId":20,
|
|
"uptime":"00:00:00",
|
|
"nexthops":[
|
|
{
|
|
"flags":3,
|
|
"fib":true,
|
|
"directlyConnected":true,
|
|
"interfaceIndex":6,
|
|
"interfaceName":"e5",
|
|
"active":true
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"10.0.23.0/30":[
|
|
{
|
|
"prefix":"10.0.23.0/30",
|
|
"prefixLen":30,
|
|
"protocol":"ospf",
|
|
"vrfId":0,
|
|
"vrfName":"default",
|
|
"distance":110,
|
|
"metric":1,
|
|
"table":254,
|
|
"internalStatus":0,
|
|
"internalFlags":0,
|
|
"internalNextHopNum":1,
|
|
"internalNextHopActiveNum":1,
|
|
"nexthopGroupId":32,
|
|
"uptime":"00:00:00",
|
|
"nexthops":[
|
|
{
|
|
"flags":1,
|
|
"directlyConnected":true,
|
|
"interfaceIndex":7,
|
|
"interfaceName":"e6",
|
|
"active":true,
|
|
"weight":1
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"prefix":"10.0.23.0/30",
|
|
"prefixLen":30,
|
|
"protocol":"connected",
|
|
"vrfId":0,
|
|
"vrfName":"default",
|
|
"selected":true,
|
|
"destSelected":true,
|
|
"distance":0,
|
|
"metric":0,
|
|
"installed":true,
|
|
"table":254,
|
|
"internalStatus":16,
|
|
"internalFlags":8,
|
|
"internalNextHopNum":1,
|
|
"internalNextHopActiveNum":1,
|
|
"nexthopGroupId":23,
|
|
"installedNexthopGroupId":23,
|
|
"uptime":"20:10:05",
|
|
"nexthops":[
|
|
{
|
|
"flags":3,
|
|
"fib":true,
|
|
"directlyConnected":true,
|
|
"interfaceIndex":7,
|
|
"interfaceName":"e6",
|
|
"active":true
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"192.168.3.0/24":[
|
|
{
|
|
"prefix":"192.168.3.0/24",
|
|
"prefixLen":24,
|
|
"protocol":"ospf",
|
|
"vrfId":0,
|
|
"vrfName":"default",
|
|
"distance":110,
|
|
"metric":1,
|
|
"table":254,
|
|
"internalStatus":0,
|
|
"internalFlags":0,
|
|
"internalNextHopNum":1,
|
|
"internalNextHopActiveNum":1,
|
|
"nexthopGroupId":33,
|
|
"uptime":"5d13h05m",
|
|
"nexthops":[
|
|
{
|
|
"flags":1,
|
|
"directlyConnected":true,
|
|
"interfaceIndex":3,
|
|
"interfaceName":"e2",
|
|
"active":true,
|
|
"weight":1
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"prefix":"192.168.3.0/24",
|
|
"prefixLen":24,
|
|
"protocol":"connected",
|
|
"vrfId":0,
|
|
"vrfName":"default",
|
|
"selected":true,
|
|
"destSelected":true,
|
|
"distance":0,
|
|
"metric":0,
|
|
"installed":true,
|
|
"table":254,
|
|
"internalStatus":16,
|
|
"internalFlags":8,
|
|
"internalNextHopNum":1,
|
|
"internalNextHopActiveNum":1,
|
|
"nexthopGroupId":17,
|
|
"installedNexthopGroupId":17,
|
|
"uptime":"01w1d13h",
|
|
"nexthops":[
|
|
{
|
|
"flags":3,
|
|
"fib":true,
|
|
"directlyConnected":true,
|
|
"interfaceIndex":3,
|
|
"interfaceName":"e2",
|
|
"active":true
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|