model: Implementing two more events for forwarding strategy: DidAddFibEntry and WillRemoveFibEntry
Currently, only DidAddFibEntry method is used and only in PerFibLimits
strategy. Change logic in global routing helper: set per FIB limits only if
forwarding strategy has created a corresponding Limit object.
diff --git a/utils/trie/trie-with-policy.h b/utils/trie/trie-with-policy.h
index 8afa6f8..08cb21c 100644
--- a/utils/trie/trie-with-policy.h
+++ b/utils/trie/trie-with-policy.h
@@ -116,6 +116,22 @@
policy_.update (position);
return true;
}
+
+ /**
+ * @brief Find a node that has the exact match with the key
+ */
+ inline iterator
+ find_exact (const FullKey &key)
+ {
+ iterator foundItem, lastItem;
+ bool reachLast;
+ boost::tie (foundItem, reachLast, lastItem) = trie_.find (key);
+
+ if (!reachLast || lastItem->payload () == PayloadTraits::empty_payload)
+ return end ();
+
+ return lastItem;
+ }
/**
* @brief Find a node that has the longest common prefix with key (FIB/PIT lookup)