NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
strategy-choice-manager.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_MGMT_STRATEGY_CHOICE_MANAGER_HPP
27 #define NFD_DAEMON_MGMT_STRATEGY_CHOICE_MANAGER_HPP
28 
29 #include "mgmt/manager-base.hpp"
31 
32 #include <ndn-cxx/management/nfd-control-parameters.hpp>
33 
34 namespace nfd {
35 
36 const std::string STRATEGY_CHOICE_PRIVILEGE = "strategy-choice";
37 
38 class StrategyChoice;
39 
41 {
42 public:
43  StrategyChoiceManager(StrategyChoice& strategyChoice,
44  shared_ptr<InternalFace> face,
45  ndn::KeyChain& keyChain);
46 
47  virtual
49 
50  void
51  onStrategyChoiceRequest(const Interest& request);
52 
54 
55  void
56  listStrategies(const Interest& request);
57 
58  void
59  onValidatedStrategyChoiceRequest(const shared_ptr<const Interest>& request);
60 
61  void
62  setStrategy(ControlParameters& parameters,
63  ControlResponse& response);
64 
65  void
66  unsetStrategy(ControlParameters& parameters,
67  ControlResponse& response);
68 
69 private:
70 
71  StrategyChoice& m_strategyChoice;
72 
73  StrategyChoicePublisher m_listPublisher;
74 
75  static const Name COMMAND_PREFIX; // /localhost/nfd/strategy-choice
76 
77  // number of components in an invalid, but not malformed, unsigned command.
78  // (/localhost/nfd/strategy-choice + verb + parameters) = 5
79  static const size_t COMMAND_UNSIGNED_NCOMPS;
80 
81  // number of components in a valid signed Interest.
82  // (see UNSIGNED_NCOMPS), 9 with signed Interest support.
83  static const size_t COMMAND_SIGNED_NCOMPS;
84 
85  static const Name LIST_DATASET_PREFIX; // /localhost/nfd/strategy-choice/list
86 
87 };
88 
89 } // namespace nfd
90 
91 #endif // NFD_DAEMON_MGMT_STRATEGY_CHOICE_MANAGER_HPP
represents the Strategy Choice table
void onStrategyChoiceRequest(const Interest &request)
StrategyChoiceManager(StrategyChoice &strategyChoice, shared_ptr< InternalFace > face, ndn::KeyChain &keyChain)
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition: common.hpp:39
const std::string STRATEGY_CHOICE_PRIVILEGE