model: Another set of refactoring/renaming to make code compile (not tested yet)
Refs #1005 (http://redmine.named-data.net/)
diff --git a/model/pit/custom-policies/serialized-size-policy.h b/model/pit/custom-policies/serialized-size-policy.h
index 7cfb506..61f6306 100644
--- a/model/pit/custom-policies/serialized-size-policy.h
+++ b/model/pit/custom-policies/serialized-size-policy.h
@@ -96,7 +96,14 @@
current_space_used_ -= get_size (item);
policy_container::erase (*item);
- get_order (item) = item->payload ()->GetInterest ()->GetSerializedSize ();
+ if (item->payload ()->GetInterest ()->GetWire ())
+ {
+ get_order (item) = item->payload ()->GetInterest ()->GetWire ()->GetSize ();
+ }
+ else
+ {
+ get_order (item) = 0;
+ }
current_space_used_ += get_size (item); // this operation can violate policy constraint, so in some case
// it may be necessary to remove some other element
policy_container::insert (*item);
@@ -105,7 +112,11 @@
inline bool
insert (typename parent_trie::iterator item)
{
- uint32_t interestSize = item->payload ()->GetInterest ()->GetSerializedSize ();
+ uint32_t interestSize = 0;
+ if (item->payload ()->GetInterest ()->GetWire ())
+ {
+ interestSize = item->payload ()->GetInterest ()->GetWire ()->GetSize ();
+ }
// can't use logging here
NS_LOG_DEBUG ("Number of entries: " << policy_container::size ()
diff --git a/model/pit/ndn-pit-entry.cc b/model/pit/ndn-pit-entry.cc
index 906fcdd..1908dd0 100644
--- a/model/pit/ndn-pit-entry.cc
+++ b/model/pit/ndn-pit-entry.cc
@@ -25,6 +25,7 @@
#include "ns3/ndn-name.h"
#include "ns3/ndn-interest.h"
+#include "ns3/packet.h"
#include "ns3/simulator.h"
#include "ns3/log.h"
diff --git a/model/pit/ndn-pit.cc b/model/pit/ndn-pit.cc
index ea84496..079cf3f 100644
--- a/model/pit/ndn-pit.cc
+++ b/model/pit/ndn-pit.cc
@@ -27,6 +27,7 @@
#include "ns3/nstime.h"
#include "ns3/uinteger.h"
#include "ns3/simulator.h"
+#include "ns3/packet.h"
#include <boost/lambda/bind.hpp>
#include <boost/lambda/lambda.hpp>