diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-10-16 07:35:02 +0000 |
---|---|---|
committer | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-10-16 14:07:06 +0000 |
commit | 1f4a3192af12c240e08941490ad8d9dfd7f1bb10 (patch) | |
tree | 8f61edea2e019d45b02d3356202f7839245ee234 /table/table_manager.go | |
parent | 11969f468543e881d7a4c758bb8f7af5797793b5 (diff) |
cli/api: support getting table summary information
$ gobgp global rib summary -a ipv4
$ gobgp neighbor 10.0.0.1 local summary
$ gobgp neighbor 10.0.0.1 adj-in summary
$ gobgp neighbor 10.0.0.1 adj-out summary
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/table_manager.go')
-rw-r--r-- | table/table_manager.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/table/table_manager.go b/table/table_manager.go index f93c3a54..083889c7 100644 --- a/table/table_manager.go +++ b/table/table_manager.go @@ -378,3 +378,11 @@ func (manager *TableManager) GetDestination(path *Path) *Destination { } return t.GetDestination(path.getPrefix()) } + +func (manager *TableManager) TableInfo(id string, family bgp.RouteFamily) (*TableInfo, error) { + t, ok := manager.Tables[family] + if !ok { + return nil, fmt.Errorf("address family %s is not configured", family) + } + return t.Info(id), nil +} |