summaryrefslogtreecommitdiffhomepage
path: root/table/destination.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/destination.go')
-rw-r--r--table/destination.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/table/destination.go b/table/destination.go
index ac3ef0c8..1ded7962 100644
--- a/table/destination.go
+++ b/table/destination.go
@@ -182,6 +182,24 @@ func (dd *Destination) GetBestPath(id string) *Path {
return nil
}
+func (dd *Destination) GetMultiBestPath(id string) []*Path {
+ list := make([]*Path, 0, len(dd.knownPathList))
+ var best *Path
+ for _, p := range dd.knownPathList {
+ if p.Filtered(id) == POLICY_DIRECTION_NONE {
+ if best == nil {
+ best = p
+ list = append(list, p)
+ } else if best.Compare(p) == 0 {
+ list = append(list, p)
+ } else {
+ return list
+ }
+ }
+ }
+ return nil
+}
+
func (dd *Destination) AddWithdraw(withdraw *Path) {
dd.validatePath(withdraw)
dd.withdrawList = append(dd.withdrawList, withdraw)