NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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
const
Name
BroadcastStrategy::STRATEGY_NAME
(
"ndn:/localhost/nfd/strategy/broadcast/%FD%01"
);
32
33
BroadcastStrategy::BroadcastStrategy
(
Forwarder
& forwarder,
const
Name
& name)
34
:
Strategy
(forwarder, name)
35
{
36
}
37
38
BroadcastStrategy::~BroadcastStrategy
()
39
{
40
}
41
42
void
43
BroadcastStrategy::afterReceiveInterest
(
const
Face
& inFace,
44
const
Interest& interest,
45
shared_ptr<fib::Entry> fibEntry,
46
shared_ptr<pit::Entry> pitEntry)
47
{
48
const
fib::NextHopList
& nexthops = fibEntry->getNextHops();
49
50
for
(fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
51
shared_ptr<Face> outFace = it->getFace();
52
if
(pitEntry->canForwardTo(*outFace)) {
53
this->
sendInterest
(pitEntry, outFace);
54
}
55
}
56
57
if
(!pitEntry->hasUnexpiredOutRecords()) {
58
this->
rejectPendingInterest
(pitEntry);
59
}
60
}
61
62
}
// namespace fw
63
}
// namespace nfd
nfd::fw::BroadcastStrategy::afterReceiveInterest
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
Definition:
broadcast-strategy.cpp:43
nfd::fw::BroadcastStrategy::~BroadcastStrategy
virtual ~BroadcastStrategy()
Definition:
broadcast-strategy.cpp:38
nfd::Forwarder
main class of NFD
Definition:
forwarder.hpp:54
broadcast-strategy.hpp
nfd::Face
represents a face
Definition:
face.hpp:59
nfd::fw::BroadcastStrategy::BroadcastStrategy
BroadcastStrategy(Forwarder &forwarder, const Name &name=STRATEGY_NAME)
Definition:
broadcast-strategy.cpp:33
ns3::ndn::Name
Name
Definition:
ndn-common.cpp:25
nfd::fib::NextHopList
std::vector< fib::NextHop > NextHopList
Definition:
fib-entry.hpp:48
nfd::fw::Strategy::rejectPendingInterest
void rejectPendingInterest(shared_ptr< pit::Entry > pitEntry)
decide that a pending Interest cannot be forwarded
Definition:
strategy.hpp:168
nfd::fw::BroadcastStrategy::STRATEGY_NAME
static const Name STRATEGY_NAME
Definition:
broadcast-strategy.hpp:53
nfd::fw::Strategy
represents a forwarding strategy
Definition:
strategy.hpp:37
nfd::fw::Strategy::sendInterest
void sendInterest(shared_ptr< pit::Entry > pitEntry, shared_ptr< Face > outFace, bool wantNewNonce=false)
send Interest to outFace
Definition:
strategy.hpp:160
ndnSIM
NFD
daemon
fw
broadcast-strategy.cpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7