Steve DiBenedetto | 5330e0d | 2014-03-05 21:52:51 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (C) 2014 Named Data Networking Project |
| 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
| 7 | #ifndef NFD_MGMT_STRATEGY_CHOICE_MANAGER_HPP |
| 8 | #define NFD_MGMT_STRATEGY_CHOICE_MANAGER_HPP |
| 9 | |
| 10 | #include "mgmt/manager-base.hpp" |
| 11 | |
Steve DiBenedetto | 7564d97 | 2014-03-24 14:28:46 -0600 | [diff] [blame] | 12 | #include <ndn-cpp-dev/management/nfd-control-parameters.hpp> |
Steve DiBenedetto | 5330e0d | 2014-03-05 21:52:51 -0700 | [diff] [blame] | 13 | |
| 14 | namespace nfd { |
| 15 | |
| 16 | const std::string STRATEGY_CHOICE_PRIVILEGE = "strategy-choice"; |
| 17 | |
| 18 | class StrategyChoice; |
| 19 | |
| 20 | class StrategyChoiceManager : public ManagerBase |
| 21 | { |
| 22 | public: |
| 23 | StrategyChoiceManager(StrategyChoice& strategyChoice, |
Steve DiBenedetto | 2c2b889 | 2014-02-27 11:46:48 -0700 | [diff] [blame] | 24 | shared_ptr<InternalFace> face); |
Steve DiBenedetto | 5330e0d | 2014-03-05 21:52:51 -0700 | [diff] [blame] | 25 | |
| 26 | virtual |
| 27 | ~StrategyChoiceManager(); |
| 28 | |
| 29 | void |
| 30 | onStrategyChoiceRequest(const Interest& request); |
| 31 | |
| 32 | PUBLIC_WITH_TESTS_ELSE_PRIVATE: |
| 33 | void |
| 34 | onValidatedStrategyChoiceRequest(const shared_ptr<const Interest>& request); |
| 35 | |
Steve DiBenedetto | 5330e0d | 2014-03-05 21:52:51 -0700 | [diff] [blame] | 36 | void |
Steve DiBenedetto | 51d242a | 2014-03-31 13:46:43 -0600 | [diff] [blame^] | 37 | setStrategy(ControlParameters& parameters, |
Steve DiBenedetto | 5330e0d | 2014-03-05 21:52:51 -0700 | [diff] [blame] | 38 | ControlResponse& response); |
| 39 | |
| 40 | void |
Steve DiBenedetto | 51d242a | 2014-03-31 13:46:43 -0600 | [diff] [blame^] | 41 | unsetStrategy(ControlParameters& parameters, |
Steve DiBenedetto | 5330e0d | 2014-03-05 21:52:51 -0700 | [diff] [blame] | 42 | ControlResponse& response); |
Steve DiBenedetto | 51d242a | 2014-03-31 13:46:43 -0600 | [diff] [blame^] | 43 | |
Steve DiBenedetto | 5330e0d | 2014-03-05 21:52:51 -0700 | [diff] [blame] | 44 | private: |
| 45 | |
| 46 | StrategyChoice& m_strategyChoice; |
| 47 | |
| 48 | static const Name COMMAND_PREFIX; // /localhost/nfd/strategy-choice |
| 49 | |
| 50 | // number of components in an invalid, but not malformed, unsigned command. |
Steve DiBenedetto | 7564d97 | 2014-03-24 14:28:46 -0600 | [diff] [blame] | 51 | // (/localhost/nfd/strategy-choice + verb + parameters) = 5 |
Steve DiBenedetto | 5330e0d | 2014-03-05 21:52:51 -0700 | [diff] [blame] | 52 | static const size_t COMMAND_UNSIGNED_NCOMPS; |
| 53 | |
| 54 | // number of components in a valid signed Interest. |
| 55 | // (see UNSIGNED_NCOMPS), 9 with signed Interest support. |
| 56 | static const size_t COMMAND_SIGNED_NCOMPS; |
| 57 | |
| 58 | }; |
| 59 | |
| 60 | } // namespace nfd |
| 61 | |
| 62 | #endif // NFD_MGMT_STRATEGY_CHOICE_MANAGER_HPP |
| 63 | |