blob: 0aa5d63757bc30ba7427dc6faadbaf8b463ebd35 [file] [log] [blame]
Steve DiBenedetto471c0602014-02-18 12:32:00 -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_LOCAL_CONTROL_HEADER_MANAGER_HPP
8#define NFD_MGMT_LOCAL_CONTROL_HEADER_MANAGER_HPP
9
10#include "common.hpp"
11#include "face/face.hpp"
12#include "mgmt/app-face.hpp"
13#include "mgmt/manager-base.hpp"
14
15namespace nfd {
16
Steve DiBenedetto2c2b8892014-02-27 11:46:48 -070017const std::string CONTROL_HEADER_PRIVILEGE = "control-header"; // config file privilege name
18
Steve DiBenedetto471c0602014-02-18 12:32:00 -070019class LocalControlHeaderManager : public ManagerBase
20{
21public:
22 LocalControlHeaderManager(function<shared_ptr<Face>(FaceId)> getFace,
Steve DiBenedetto2c2b8892014-02-27 11:46:48 -070023 shared_ptr<InternalFace> face);
Steve DiBenedetto471c0602014-02-18 12:32:00 -070024
25 void
26 onLocalControlHeaderRequest(const Interest& request);
27
Steve DiBenedetto2c2b8892014-02-27 11:46:48 -070028 void
29 onCommandValidated(const shared_ptr<const Interest>& command);
30
Steve DiBenedetto471c0602014-02-18 12:32:00 -070031private:
32 function<shared_ptr<Face>(FaceId)> m_getFace;
33
34 static const Name COMMAND_PREFIX; // /localhost/nfd/control-header
35
36 // number of components in an invalid, but not malformed, unsigned command.
Steve DiBenedetto2c2b8892014-02-27 11:46:48 -070037 // (/localhost/nfd/control-header + control-module + verb) = 5
Steve DiBenedetto471c0602014-02-18 12:32:00 -070038 static const size_t COMMAND_UNSIGNED_NCOMPS;
39
40 // number of components in a valid signed Interest.
Steve DiBenedetto2c2b8892014-02-27 11:46:48 -070041 // UNSIGNED_NCOMPS + 4 command Interest components = 9
Steve DiBenedetto471c0602014-02-18 12:32:00 -070042 static const size_t COMMAND_SIGNED_NCOMPS;
43};
44
45} // namespace nfd
46
47#endif // NFD_MGMT_LOCAL_CONTROL_HEADER_MANAGER_HPP
48
49
50