blob: d8847862d431b1523dff06167fb9482a1b10500e [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 DiBenedetto7564d972014-03-24 14:28:46 -060037 setStrategy(const ControlParameters& parameters,
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -070038 ControlResponse& response);
39
40 void
Steve DiBenedetto7564d972014-03-24 14:28:46 -060041 unsetStrategy(const ControlParameters& parameters,
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -070042 ControlResponse& response);
43private:
44
45 StrategyChoice& m_strategyChoice;
46
47 static const Name COMMAND_PREFIX; // /localhost/nfd/strategy-choice
48
49 // number of components in an invalid, but not malformed, unsigned command.
Steve DiBenedetto7564d972014-03-24 14:28:46 -060050 // (/localhost/nfd/strategy-choice + verb + parameters) = 5
Steve DiBenedetto5330e0d2014-03-05 21:52:51 -070051 static const size_t COMMAND_UNSIGNED_NCOMPS;
52
53 // number of components in a valid signed Interest.
54 // (see UNSIGNED_NCOMPS), 9 with signed Interest support.
55 static const size_t COMMAND_SIGNED_NCOMPS;
56
57};
58
59} // namespace nfd
60
61#endif // NFD_MGMT_STRATEGY_CHOICE_MANAGER_HPP
62