model: Enabling serialization/deserialization of Exclude filter in ndnSIM wire format
Refs #1009 (http://redmine.named-data.net/issues/1009)
diff --git a/model/ndn-interest.cc b/model/ndn-interest.cc
index 5d76362..3b09fde 100644
--- a/model/ndn-interest.cc
+++ b/model/ndn-interest.cc
@@ -35,6 +35,7 @@
, m_interestLifetime (Seconds (0))
, m_nonce (0)
, m_nackType (NORMAL_INTEREST)
+ , m_exclude (0)
, m_payload (payload)
, m_wire (0)
{
@@ -50,6 +51,7 @@
, m_interestLifetime (interest.m_interestLifetime)
, m_nonce (interest.m_nonce)
, m_nackType (interest.m_nackType)
+ , m_exclude (interest.m_exclude ? Create<Exclude> (*interest.GetExclude ()) : 0)
, m_payload (interest.GetPayload ()->Copy ())
, m_wire (0)
{
@@ -136,6 +138,19 @@
}
void
+Interest::SetExclude (Ptr<Exclude> exclude)
+{
+ m_exclude = exclude;
+ m_wire = 0;
+}
+
+Ptr<const Exclude>
+Interest::GetExclude () const
+{
+ return m_exclude;
+}
+
+void
Interest::SetPayload (Ptr<Packet> payload)
{
m_payload = payload;