diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-16 17:53:08 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-16 17:53:08 +0900 |
commit | 504bd6f749224c493f3aa49197674ec08e7c0efe (patch) | |
tree | 1dedc510abc57ac38918cd47f733ac2cc086431b /table/destination.go | |
parent | bd82fbdeb6250b2e8f4c18f1792a38a7a5109fad (diff) |
table: remove sentroute stuff
It's not necessary for our first target (multi RIB route server).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/destination.go')
-rw-r--r-- | table/destination.go | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/table/destination.go b/table/destination.go index 16a71f54..5e209712 100644 --- a/table/destination.go +++ b/table/destination.go @@ -54,8 +54,6 @@ type Destination interface { String() string addWithdraw(withdraw Path) addNewPath(newPath Path) - addSentRoute(sentRoute *SentRoute) - removeSentRoute(peer *Peer) bool constructWithdrawPath() Path removeOldPathsFromSource(source *Peer) []Path } @@ -69,7 +67,6 @@ type DestinationDefault struct { bestPath Path bestPathReason string oldBestPath Path - sentRoutes map[*Peer]*SentRoute } func NewDestinationDefault(nlri bgp.AddrPrefixInterface) *DestinationDefault { @@ -82,7 +79,6 @@ func NewDestinationDefault(nlri bgp.AddrPrefixInterface) *DestinationDefault { destination.bestPath = nil destination.bestPathReason = "" destination.oldBestPath = nil - destination.sentRoutes = make(map[*Peer]*SentRoute) return destination } @@ -134,27 +130,12 @@ func (dd *DestinationDefault) addWithdraw(withdraw Path) { dd.validatePath(withdraw) dd.withdrawList = append(dd.withdrawList, withdraw) } + func (dd *DestinationDefault) addNewPath(newPath Path) { dd.validatePath(newPath) dd.newPathList = append(dd.newPathList, newPath) } -func (dd *DestinationDefault) addSentRoute(sentRoute *SentRoute) { - dd.sentRoutes[sentRoute.peer] = sentRoute -} -func (dd *DestinationDefault) removeSentRoute(peer *Peer) bool { - if dd.wasSentTo(peer) { - delete(dd.sentRoutes, peer) - return true - } - return false -} -func (dd *DestinationDefault) wasSentTo(peer *Peer) bool { - _, ok := dd.sentRoutes[peer] - if ok { - return true - } - return false -} + func (dd *DestinationDefault) removeOldPathsFromSource(source *Peer) []Path { removePaths := make([]Path, 0) sourceVerNum := source.VersionNum |