20 #ifndef NDNSIM_HELPER_NDN_STRATEGY_CHOICE_HELPER_HPP 21 #define NDNSIM_HELPER_NDN_STRATEGY_CHOICE_HELPER_HPP 23 #include "ns3/ndnSIM/model/ndn-common.hpp" 27 #include "ns3/node-container.h" 29 #include "ns3/ndnSIM/model/ndn-l3-protocol.hpp" 30 #include "ns3/ndnSIM/NFD/daemon/mgmt/strategy-choice-manager.hpp" 31 #include "ns3/ndnSIM/NFD/daemon/fw/forwarder.hpp" 32 #include "ns3/ndnSIM/NFD/daemon/table/strategy-choice.hpp" 67 Install(Ptr<Node> node,
const Name& namePrefix,
const Name& strategy);
74 Install(
const NodeContainer& c,
const Name& namePrefix,
const Name& strategy);
80 InstallAll(
const Name& namePrefix,
const Name& strategy);
86 template<
class Strategy>
88 Install(Ptr<Node> node,
const Name& namePrefix);
94 template<
class Strategy>
96 Install(
const NodeContainer& c,
const Name& namePrefix);
102 template<
class Strategy>
104 InstallAll(
const Name& namePrefix);
111 template<
class Strategy>
113 StrategyChoiceHelper::Install(Ptr<Node> node,
const Name& namePrefix)
115 Ptr<L3Protocol> l3Protocol = node->GetObject<
L3Protocol>();
116 NS_ASSERT(l3Protocol !=
nullptr);
117 NS_ASSERT(l3Protocol->getForwarder() !=
nullptr);
122 if (!strategyChoice.
hasStrategy(Strategy::STRATEGY_NAME)) {
123 strategyChoice.
install(make_unique<Strategy>(ref(forwarder)));
126 Install(node, namePrefix, Strategy::STRATEGY_NAME);
129 template<
class Strategy>
131 StrategyChoiceHelper::Install(
const NodeContainer& c,
const Name& namePrefix)
133 for (NodeContainer::Iterator i = c.Begin(); i != c.End(); ++i) {
134 Install<Strategy>(*i, namePrefix);
138 template<
class Strategy>
140 StrategyChoiceHelper::InstallAll(
const Name& namePrefix)
142 Install<Strategy>(NodeContainer::GetGlobal(), namePrefix);
148 #endif // NDNSIM_HELPER_NDN_STRATEGY_CHOICE_HELPER_HPP bool hasStrategy(const Name &strategyName, bool isExact=false) const
determines if a strategy is installed
Copyright (c) 2011-2015 Regents of the University of California.
represents parameters in a ControlCommand request or response
NFD Strategy Choice Helper (FIB) helper.
std::pair< bool, fw::Strategy * > install(unique_ptr< fw::Strategy > strategy)
install a strategy
Copyright (c) 2011-2015 Regents of the University of California.
Copyright (c) 2011-2015 Regents of the University of California.
Implementation network-layer of NDN stack.
represents a forwarding strategy
represents the Strategy Choice table