diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-03-20 11:20:40 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-20 11:20:40 +0900 |
commit | a307c5bc7a4cea293400e4475ea504b4e2b450f4 (patch) | |
tree | 4bc25d7cc8a2177d1b5a0ee40edf25409e942bce /table | |
parent | 9152c24906d712ab1334e22df6d9b48c38cdf665 (diff) |
server: add Global Rib to support normal BGP functionality
We handle Global Rib as a Peer. Normail (non route server client) peer
has one sibling, Global Rib peer. Global Rib peer has all normal peers
as siblings.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r-- | table/table_manager.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/table/table_manager.go b/table/table_manager.go index c8ff0833..d34e3780 100644 --- a/table/table_manager.go +++ b/table/table_manager.go @@ -261,6 +261,17 @@ func (manager *TableManager) ProcessPaths(pathList []Path) ([]Path, error) { return manager.calculate(destinationList) } +func (manager *TableManager) GetPathList(rf bgp.RouteFamily) []Path { + if _, ok := manager.Tables[rf]; !ok { + return []Path{} + } + var paths []Path + for _, dest := range manager.Tables[rf].getDestinations() { + paths = append(paths, dest.getBestPath()) + } + return paths +} + // process BGPUpdate message // this function processes only BGPUpdate func (manager *TableManager) ProcessUpdate(fromPeer *PeerInfo, message *bgp.BGPMessage) ([]Path, error) { |