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
multicast-strategy.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#include "
multicast-strategy.hpp
"
27
28
namespace
nfd
{
29
namespace
fw {
30
31
const
Name
MulticastStrategy::STRATEGY_NAME
(
"ndn:/localhost/nfd/strategy/multicast/%FD%01"
);
32
NFD_REGISTER_STRATEGY
(MulticastStrategy);
33
34
MulticastStrategy::MulticastStrategy
(
Forwarder
& forwarder,
const
Name
&
name
)
35
:
Strategy
(forwarder, name)
36
{
37
}
38
39
void
40
MulticastStrategy::afterReceiveInterest
(
const
Face
& inFace,
41
const
Interest
& interest,
42
shared_ptr<fib::Entry> fibEntry,
43
shared_ptr<pit::Entry> pitEntry)
44
{
45
const
fib::NextHopList
& nexthops = fibEntry->getNextHops();
46
47
for
(fib::NextHopList::const_iterator it = nexthops.begin(); it != nexthops.end(); ++it) {
48
shared_ptr<Face> outFace = it->getFace();
49
if
(pitEntry->canForwardTo(*outFace)) {
50
this->
sendInterest
(pitEntry, outFace);
51
}
52
}
53
54
if
(!pitEntry->hasUnexpiredOutRecords()) {
55
this->
rejectPendingInterest
(pitEntry);
56
}
57
}
58
59
}
// namespace fw
60
}
// namespace nfd
nfd::fw::MulticastStrategy::STRATEGY_NAME
static const Name STRATEGY_NAME
Definition:
multicast-strategy.hpp:48
nfd::Forwarder
main class of NFD
Definition:
forwarder.hpp:54
ndn::Interest
represents an Interest packet
Definition:
interest.hpp:45
nfd::Face
represents a face
Definition:
face.hpp:57
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
nfd::fw::MulticastStrategy::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:
multicast-strategy.cpp:40
ns3::ndn::Name
Name
Definition:
ndn-common.cpp:25
nfd::fw::NFD_REGISTER_STRATEGY
NFD_REGISTER_STRATEGY(AccessStrategy)
nfd::fib::NextHopList
std::vector< fib::NextHop > NextHopList
Definition:
fib-entry.hpp:48
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
nfd::fw::Strategy::rejectPendingInterest
void rejectPendingInterest(shared_ptr< pit::Entry > pitEntry)
decide that a pending Interest cannot be forwarded
Definition:
strategy.hpp:169
nfd::fw::Strategy
represents a forwarding strategy
Definition:
strategy.hpp:38
multicast-strategy.hpp
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:161
nfd::fw::MulticastStrategy::MulticastStrategy
MulticastStrategy(Forwarder &forwarder, const Name &name=STRATEGY_NAME)
Definition:
multicast-strategy.cpp:34
ndn::name
Definition:
name-component.cpp:37
ndnSIM
NFD
daemon
fw
multicast-strategy.cpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11