blob: 19bee3372c789e04e481e153c9edd81741388b2c [file] [log] [blame]
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -07001/* -*- 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 DiBenedetto7564d972014-03-24 14:28:46 -060012#include <ndn-cpp-dev/management/nfd-control-parameters.hpp>
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -070013
14namespace nfd {
15
16const std::string STRATEGY_CHOICE_PRIVILEGE = "strategy-choice";
17
18class StrategyChoice;
19
20class StrategyChoiceManager : public ManagerBase
21{
22public:
23 StrategyChoiceManager(StrategyChoice& strategyChoice,
Steve DiBenedetto2c2b8892014-02-27 11:46:48 -070024 shared_ptr<InternalFace> face);
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -070025
26 virtual
27 ~StrategyChoiceManager();
28
29 void
30 onStrategyChoiceRequest(const Interest& request);
31
32PUBLIC_WITH_TESTS_ELSE_PRIVATE:
33 void
34 onValidatedStrategyChoiceRequest(const shared_ptr<const Interest>& request);
35
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -070036 void
Steve DiBenedetto51d242a2014-03-31 13:46:43 -060037 setStrategy(ControlParameters& parameters,
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -070038 ControlResponse& response);
39
40 void
Steve DiBenedetto51d242a2014-03-31 13:46:43 -060041 unsetStrategy(ControlParameters& parameters,
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -070042 ControlResponse& response);
Steve DiBenedetto51d242a2014-03-31 13:46:43 -060043
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -070044private:
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 DiBenedetto7564d972014-03-24 14:28:46 -060051 // (/localhost/nfd/strategy-choice + verb + parameters) = 5
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -070052 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