mirror of
https://github.com/alice-lg/birdwatcher.git
synced 2025-03-09 00:00:05 +01:00
added per peer table filtered routes dump
This commit is contained in:
parent
b96a864b04
commit
941ac9ceba
1 changed files with 8 additions and 3 deletions
11
bird/bird.go
11
bird/bird.go
|
@ -270,14 +270,19 @@ func RoutesDumpPerPeerTable() (Parsed, bool) {
|
|||
filtered := []Parsed{}
|
||||
|
||||
// Get protocols with filtered routes
|
||||
protocols, _ := ProtocolsBgp()
|
||||
protocolsRes, _ := ProtocolsBgp()
|
||||
protocols := protocolsRes["protocols"].(Parsed)
|
||||
|
||||
for protocol, details := range protocols {
|
||||
details, ok := details.(Parsed)
|
||||
counters, ok := details["routes"].(map[string]int)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
filterCount := counters["filtered"]
|
||||
counters, ok := details["routes"].(Parsed)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
filterCount := counters["filtered"].(int64)
|
||||
if filterCount == 0 {
|
||||
continue // nothing to do here.
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue