fw: additional unsolicited Data policies
refs #2181
Change-Id: I439a77f8f48ad194459dc2391cd0ad8d0860b83e
diff --git a/daemon/fw/unsolicited-data-policy.cpp b/daemon/fw/unsolicited-data-policy.cpp
index 894cc86..79c6d77 100644
--- a/daemon/fw/unsolicited-data-policy.cpp
+++ b/daemon/fw/unsolicited-data-policy.cpp
@@ -41,6 +41,12 @@
}
UnsolicitedDataDecision
+DropAllUnsolicitedDataPolicy::decide(const Face& inFace, const Data& data) const
+{
+ return UnsolicitedDataDecision::DROP;
+}
+
+UnsolicitedDataDecision
AdmitLocalUnsolicitedDataPolicy::decide(const Face& inFace, const Data& data) const
{
if (inFace.getScope() == ndn::nfd::FACE_SCOPE_LOCAL) {
@@ -49,5 +55,20 @@
return UnsolicitedDataDecision::DROP;
}
+UnsolicitedDataDecision
+AdmitNetworkUnsolicitedDataPolicy::decide(const Face& inFace, const Data& data) const
+{
+ if (inFace.getScope() == ndn::nfd::FACE_SCOPE_NON_LOCAL) {
+ return UnsolicitedDataDecision::CACHE;
+ }
+ return UnsolicitedDataDecision::DROP;
+}
+
+UnsolicitedDataDecision
+AdmitAllUnsolicitedDataPolicy::decide(const Face& inFace, const Data& data) const
+{
+ return UnsolicitedDataDecision::CACHE;
+}
+
} // namespace fw
} // namespace nfd