diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-25 23:52:21 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-25 23:52:21 +0900 |
commit | 45050d9b97f3821c6dbdbc98678a62ddfcf81aad (patch) | |
tree | e54184769a3e441d763e0cecad93ed13372b849a /server | |
parent | 6f95b7dc62b0ce8523e4f6da2e2bff5f4a4d3b78 (diff) |
remove collector mode support
We need to update yang config collector mode (split into config and
state). before that, let's remove the feature itself to see if there
is any user of it.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/peer.go | 16 | ||||
-rw-r--r-- | server/server.go | 10 |
2 files changed, 7 insertions, 19 deletions
diff --git a/server/peer.go b/server/peer.go index 0d0eb490..d191e734 100644 --- a/server/peer.go +++ b/server/peer.go @@ -58,8 +58,8 @@ func NewPeer(g *config.Global, conf *config.Neighbor, loc *table.TableManager, p peer.tableId = table.GLOBAL_RIB_NAME } rfs, _ := config.AfiSafis(conf.AfiSafis).ToRfList() - peer.adjRibIn = table.NewAdjRib(peer.ID(), rfs, g.Collector.Enabled) - peer.adjRibOut = table.NewAdjRib(peer.ID(), rfs, g.Collector.Enabled) + peer.adjRibIn = table.NewAdjRib(peer.ID(), rfs) + peer.adjRibOut = table.NewAdjRib(peer.ID(), rfs) return peer } @@ -136,19 +136,13 @@ func (peer *Peer) getBestFromLocal(rfList []bgp.RouteFamily) ([]*table.Path, []* options := &table.PolicyOptions{ Neighbor: peer.fsm.peerInfo.Address, } - var source []*table.Path - if peer.fsm.gConf.Collector.Enabled { - source = peer.localRib.GetPathList(peer.TableID(), rfList) - } else { - source = peer.localRib.GetBestPathList(peer.TableID(), rfList) - } - for _, path := range source { + for _, path := range peer.localRib.GetBestPathList(peer.TableID(), rfList) { p := peer.policy.ApplyPolicy(peer.TableID(), table.POLICY_DIRECTION_EXPORT, filterpath(peer, path), options) if p == nil { filtered = append(filtered, path) continue } - if !peer.fsm.gConf.Collector.Enabled && !peer.isRouteServerClient() { + if !peer.isRouteServerClient() { p = p.Clone(p.IsWithdraw) p.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf) } @@ -189,7 +183,7 @@ func (peer *Peer) processOutgoingPaths(paths, withdrawals []*table.Path) []*tabl if path == nil { continue } - if !peer.isRouteServerClient() && !peer.fsm.gConf.Collector.Enabled { + if !peer.isRouteServerClient() { path = path.Clone(path.IsWithdraw) path.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf) } diff --git a/server/server.go b/server/server.go index a021dd84..37c43447 100644 --- a/server/server.go +++ b/server/server.go @@ -474,7 +474,7 @@ func (server *BgpServer) dropPeerAllRoutes(peer *Peer, families []bgp.RouteFamil for _, rf := range families { best, _ := server.globalRib.DeletePathsByPeer(ids, peer.fsm.peerInfo, rf) - if !peer.isRouteServerClient() && !server.bgpConfig.Global.Collector.Enabled { + if !peer.isRouteServerClient() { server.broadcastBests(best[table.GLOBAL_RIB_NAME]) } @@ -692,9 +692,7 @@ func (server *BgpServer) propagateUpdate(peer *Peer, pathList []*table.Path) ([] if len(best[table.GLOBAL_RIB_NAME]) == 0 { return nil, alteredPathList } - if !server.bgpConfig.Global.Collector.Enabled { - server.broadcastBests(best[table.GLOBAL_RIB_NAME]) - } + server.broadcastBests(best[table.GLOBAL_RIB_NAME]) } for _, targetPeer := range server.neighborMap { @@ -1604,9 +1602,6 @@ func (server *BgpServer) handleModConfig(grpcReq *GrpcRequest) error { MaxLabel: g.MplsLabelMax, }, AfiSafis: families, - Collector: config.Collector{ - Enabled: g.Collector, - }, }, } if err := config.SetDefaultConfigValues(nil, b); err != nil { @@ -1742,7 +1737,6 @@ func (server *BgpServer) handleGrpc(grpcReq *GrpcRequest) []*SenderMsg { ListenAddresses: g.ListenConfig.LocalAddressList, MplsLabelMin: g.MplsLabelRange.MinLabel, MplsLabelMax: g.MplsLabelRange.MaxLabel, - Collector: g.Collector.Enabled, }, } grpcReq.ResponseCh <- result |