NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
broadcast-strategy.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #include "broadcast-strategy.hpp"
27 
28 namespace nfd {
29 namespace fw {
30 
31 NFD_LOG_INIT("BroadcastStrategy");
32 
33 const Name BroadcastStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/broadcast/%FD%02");
35 
37  : MulticastStrategy(forwarder, name)
38  , m_isFirstUse(true)
39 {
40 }
41 
42 void
44  const Interest& interest,
45  shared_ptr<fib::Entry> fibEntry,
46  shared_ptr<pit::Entry> pitEntry)
47 {
48  if (m_isFirstUse) {
49  NFD_LOG_WARN("The broadcast strategy has been renamed as multicast strategy. "
50  "Use ndn:/localhost/nfd/strategy/multicast to select the multicast strategy.");
51  m_isFirstUse = false;
52  }
53 
54  this->MulticastStrategy::afterReceiveInterest(inFace, interest, fibEntry, pitEntry);
55 }
56 
57 } // namespace fw
58 } // namespace nfd
virtual void afterReceiveInterest(const Face &inFace, const Interest &interest, shared_ptr< fib::Entry > fibEntry, shared_ptr< pit::Entry > pitEntry) 1
trigger after Interest is received
main class of NFD
Definition: forwarder.hpp:54
represents an Interest packet
Definition: interest.hpp:45
represents a face
Definition: face.hpp:57
BroadcastStrategy(Forwarder &forwarder, const Name &name=STRATEGY_NAME)
#define NFD_LOG_WARN(expression)
Definition: logger.hpp:39
identical to MulticastStrategy, for backwards compatibility
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
virtual void afterReceiveInterest(const Face &inFace, const Interest &interest, shared_ptr< fib::Entry > fibEntry, shared_ptr< pit::Entry > pitEntry) 1
trigger after Interest is received
NFD_REGISTER_STRATEGY(AccessStrategy)
Name abstraction to represent an absolute name.
Definition: name.hpp:46
a forwarding strategy that forwards Interest to all FIB nexthops
#define NFD_LOG_INIT(name)
Definition: logger.hpp:33