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"
);
34
NFD_REGISTER_STRATEGY
(
BroadcastStrategy
);
35
36
BroadcastStrategy::BroadcastStrategy
(
Forwarder
& forwarder,
const
Name
&
name
)
37
:
MulticastStrategy
(forwarder,
name
)
38
, m_isFirstUse(true)
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
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
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::Forwarder
main class of NFD
Definition:
forwarder.hpp:54
ndn::Interest
represents an Interest packet
Definition:
interest.hpp:45
broadcast-strategy.hpp
nfd::Face
represents a face
Definition:
face.hpp:57
nfd::fw::BroadcastStrategy::BroadcastStrategy
BroadcastStrategy(Forwarder &forwarder, const Name &name=STRATEGY_NAME)
Definition:
broadcast-strategy.cpp:36
NFD_LOG_WARN
#define NFD_LOG_WARN(expression)
Definition:
logger.hpp:39
nfd::fw::BroadcastStrategy
identical to MulticastStrategy, for backwards compatibility
Definition:
broadcast-strategy.hpp:37
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
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
nfd::fw::NFD_REGISTER_STRATEGY
NFD_REGISTER_STRATEGY(AccessStrategy)
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
nfd::fw::BroadcastStrategy::STRATEGY_NAME
static const Name STRATEGY_NAME
Definition:
broadcast-strategy.hpp:49
nfd::fw::MulticastStrategy
a forwarding strategy that forwards Interest to all FIB nexthops
Definition:
multicast-strategy.hpp:36
NFD_LOG_INIT
#define NFD_LOG_INIT(name)
Definition:
logger.hpp:33
ndn::name
Definition:
name-component.cpp:37
ndnSIM
NFD
daemon
fw
broadcast-strategy.cpp
Generated on Fri Feb 23 2018 12:30:55 for ndnSIM by
1.8.14