summaryrefslogtreecommitdiffhomepage
path: root/table/adj.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/adj.go')
-rw-r--r--table/adj.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/table/adj.go b/table/adj.go
index 5e685f2e..8aa40370 100644
--- a/table/adj.go
+++ b/table/adj.go
@@ -156,3 +156,16 @@ func (adj *AdjRib) StaleAll(rfList []bgp.RouteFamily) {
}
}
}
+
+func (adj *AdjRib) Exists(path *Path) bool {
+ if path == nil {
+ return false
+ }
+ family := path.GetRouteFamily()
+ table, ok := adj.table[family]
+ if !ok {
+ return false
+ }
+ _, ok = table[path.getPrefix()]
+ return ok
+}