From a307c5bc7a4cea293400e4475ea504b4e2b450f4 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Fri, 20 Mar 2015 11:20:40 +0900 Subject: 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 --- table/table_manager.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'table') 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) { -- cgit v1.2.3