diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-09-17 09:59:51 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-07-05 14:18:11 +0900 |
commit | e76a583cf93d8b004ce99dd30c3743316da3cc21 (patch) | |
tree | 082422bef18a0e07d5a5345c6ecbc47e7d749452 | |
parent | d435da72b0e7deaafd93dad62fb29bde08e42ac0 (diff) |
cli: pretty format addpath capability
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | gobgp/cmd/neighbor.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gobgp/cmd/neighbor.go b/gobgp/cmd/neighbor.go index e248d3f2..02182374 100644 --- a/gobgp/cmd/neighbor.go +++ b/gobgp/cmd/neighbor.go @@ -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) } |