Project

General

Profile

Bug #2764 ยป hopcount.diff

Christian Kreuzberger, 04/22/2015 01:51 AM

View differences:

NFD/daemon/fw/forwarder.cpp
29 29
#include "face/null-face.hpp"
30 30
#include "available-strategies.hpp"
31 31

  
32
#include "model/ndn-ns3.hpp"
33
#include "../utils/ndn-fw-hop-count-tag.hpp"
34

  
35

  
36

  
32 37
#include <boost/random/uniform_int_distribution.hpp>
33 38

  
34 39
namespace nfd {
......
115 120
      // set PIT straggler timer
116 121
      this->setStragglerTimer(pitEntry, true, csMatch->getFreshnessPeriod());
117 122

  
123

  
124

  
118 125
      // goto outgoing Data pipeline
119 126
      this->onOutgoingData(*csMatch, inFace);
120 127
      return;
......
283 290
    return;
284 291
  }
285 292

  
293
#ifdef FIX_CS_HOPCOUNT
294
  // remove hop count tag before adding to content store !!!
295
  ns3::Ptr<ns3::Packet> tmpPacket = ns3::ndn::Convert::ToPacket(data);
296
  ns3::ndn::FwHopCountTag tag;
297
  tmpPacket->RemovePacketTag(tag);
298

  
299
  // CS insert
300
  if (m_csFromNdnSim == nullptr)
301
    m_cs.insert(*(ns3::ndn::Convert::FromPacket<Data>(tmpPacket)));
302
  else
303
    m_csFromNdnSim->Add(ns3::ndn::Convert::FromPacket<Data>(tmpPacket));
304
#else
286 305
  // CS insert
287 306
  if (m_csFromNdnSim == nullptr)
288 307
    m_cs.insert(data);
289 308
  else
290 309
    m_csFromNdnSim->Add(data.shared_from_this());
310
#endif
311

  
291 312

  
292 313
  std::set<shared_ptr<Face> > pendingDownstreams;
293 314
  // foreach PitEntry
    (1-1/1)