summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-21 09:10:39 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-21 09:10:39 +0900
commitec8c83d950c25a6b6d8b75655f9c48907dc9afd8 (patch)
tree4a5cc9c0c8a8265af51290423ebe545928b2c2d3 /server/peer.go
parent6be902345412117bf098e6d115c27ec49085432c (diff)
server: make getBestFromLocal peer's method
Will be used to handle ROUTE_REFRESH. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/peer.go b/server/peer.go
index 4432af9b..b5a62b88 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -125,6 +125,16 @@ func (peer *Peer) getAccepted(rfList []bgp.RouteFamily) []*table.Path {
return pathList
}
+func (peer *Peer) getBestFromLocal() ([]*table.Path, []*table.Path) {
+ pathList, filtered := peer.ApplyPolicy(table.POLICY_DIRECTION_EXPORT, filterpath(peer, peer.getBests(peer.localRib)))
+ if peer.isRouteServerClient() == false {
+ for _, path := range pathList {
+ path.UpdatePathAttrs(&peer.gConf, &peer.conf)
+ }
+ }
+ return pathList, filtered
+}
+
func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) ([]*table.Path, bool, []*bgp.BGPMessage) {
bgpMsgList := []*bgp.BGPMessage{}
pathList := []*table.Path{}