cli: pretty format addpath capability

Signed-off-by: Wataru Ishida <[email protected]>
This commit is contained in:
Wataru Ishida
2017-07-05 14:18:11 +09:00
committed by FUJITA Tomonori
parent d435da72b0
commit e76a583cf9
+14
View File
@@ -350,6 +350,20 @@ func showNeighbor(args []string) error {
fmt.Printf(" Remote: %s\n", s)
}
}
case bgp.BGP_CAP_ADD_PATH:
fmt.Printf(" %s:\t%s\n", c.Code(), support)
if m := lookup(c, p.State.LocalCapabilityList); m != nil {
fmt.Println(" Local:")
for _, item := range m.(*bgp.CapAddPath).Tuples {
fmt.Printf(" %s:\t%s\n", item.RouteFamily, item.Mode)
}
}
if m := lookup(c, p.State.RemoteCapabilityList); m != nil {
fmt.Println(" Remote:")
for _, item := range m.(*bgp.CapAddPath).Tuples {
fmt.Printf(" %s:\t%s\n", item.RouteFamily, item.Mode)
}
}
default:
fmt.Printf(" %s:\t%s\n", c.Code(), support)
}