summaryrefslogtreecommitdiffhomepage
path: root/table/table_manager.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/table_manager.go')
-rw-r--r--table/table_manager.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/table/table_manager.go b/table/table_manager.go
index 3d52fce7..eb4a20bf 100644
--- a/table/table_manager.go
+++ b/table/table_manager.go
@@ -139,6 +139,10 @@ func NewTableManager(owner string, rfList []bgp.RouteFamily) *TableManager {
return t
}
+func (manager *TableManager) OwnerName() string {
+ return manager.owner
+}
+
func (manager *TableManager) calculate(destinationList []Destination) ([]Path, error) {
newPaths := make([]Path, 0)
@@ -159,7 +163,7 @@ func (manager *TableManager) calculate(destinationList []Destination) ([]Path, e
}
destination.setBestPathReason(reason)
- currentBestPath := destination.getBestPath()
+ currentBestPath := destination.GetBestPath()
if newBestPath != nil && currentBestPath == newBestPath {
// best path is not changed
@@ -192,7 +196,7 @@ func (manager *TableManager) calculate(destinationList []Destination) ([]Path, e
"next_hop": currentBestPath.GetNexthop().String(),
}).Debug("best path is lost")
- p := destination.getBestPath()
+ p := destination.GetBestPath()
newPaths = append(newPaths, p.Clone(true))
}
destination.setBestPath(nil)
@@ -218,7 +222,7 @@ func (manager *TableManager) calculate(destinationList []Destination) ([]Path, e
destination.setBestPath(newBestPath)
}
- if len(destination.getKnownPathList()) == 0 && destination.getBestPath() == nil {
+ if len(destination.getKnownPathList()) == 0 && destination.GetBestPath() == nil {
rf := destination.getRouteFamily()
t := manager.Tables[rf]
deleteDest(t, destination)
@@ -259,7 +263,7 @@ func (manager *TableManager) GetPathList(rf bgp.RouteFamily) []Path {
}
var paths []Path
for _, dest := range manager.Tables[rf].GetDestinations() {
- paths = append(paths, dest.getBestPath())
+ paths = append(paths, dest.GetBestPath())
}
return paths
}
@@ -360,10 +364,11 @@ func (adj *AdjRib) GetOutCount(rf bgp.RouteFamily) int {
return len(adj.adjRibOut[rf])
}
-func (adj *AdjRib) DropAllIn(rf bgp.RouteFamily) {
+func (adj *AdjRib) DropAll(rf bgp.RouteFamily) {
if _, ok := adj.adjRibIn[rf]; ok {
// replace old one
adj.adjRibIn[rf] = make(map[string]*ReceivedRoute)
+ adj.adjRibOut[rf] = make(map[string]*ReceivedRoute)
}
}